fix(webui): route missing API bootstrap tokens to auth
maintainer edit: handle review feedback by treating bootstrap responses without api_token as auth-required, and remove the obsolete issue_token(api_token=...) compatibility path now that API tokens are issued separately.
This commit is contained in:
@@ -42,12 +42,10 @@ class GatewayTokenStore:
|
||||
return False
|
||||
return True
|
||||
|
||||
def issue_token(self, ttl_s: int | float, *, api_token: bool = False) -> str:
|
||||
def issue_token(self, ttl_s: int | float) -> str:
|
||||
token_value = f"nbwt_{secrets.token_urlsafe(32)}"
|
||||
expiry = time.monotonic() + float(ttl_s)
|
||||
self.issued_tokens[token_value] = expiry
|
||||
if api_token:
|
||||
self.api_tokens[token_value] = expiry
|
||||
return token_value
|
||||
|
||||
def issue_api_token(self, ttl_s: int | float) -> str:
|
||||
|
||||
Reference in New Issue
Block a user