Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "fix(cache): token authentication lookup" #5

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions powerdns_api_proxy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ def load_config(path: Optional[Path] = None) -> ProxyConfig:
return config


@lru_cache(maxsize=1000)
def token_defined(config: ProxyConfig, token: str) -> bool:
sha512 = hashlib.sha512()
sha512.update(token.encode())
Expand All @@ -58,7 +57,6 @@ def dependency_check_token_defined(
check_token_defined(load_config(), X_API_Key)


@lru_cache(maxsize=1000)
def get_environment_for_token(
config: ProxyConfig, token: str
) -> ProxyConfigEnvironment:
Expand Down
8 changes: 0 additions & 8 deletions powerdns_api_proxy/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,6 @@ def api_token_defined(cls, v):
raise ValueError('pdns_api_token must a non-empty string')
return v

def __hash__(self):
return hash(
self.pdns_api_url
+ self.pdns_api_token
+ str(self.pdns_api_verify_ssl)
+ str(self.environments)
)


class ResponseAllowed(BaseModel):
zones: list[ProxyConfigZone]
Expand Down
Loading