add test to token

This commit is contained in:
2025-09-29 09:05:15 -03:00
parent 1b6e4b7b5e
commit c527fa0245
5 changed files with 58 additions and 9 deletions

View File

@@ -4,9 +4,9 @@ ISSUER: str = os.getenv('ISSUER') # type: ignore
OAUTH2_TABLE: str = os.getenv('OAUTH2_TABLE') # type: ignore
OAUTH2_SCOPES_SUPPORTED: str = os.getenv('OAUTH2_SCOPES_SUPPORTED', '')
OAUTH2_REFRESH_TOKEN_EXPIRES_IN = 86_400 * 7 # 7 days
JWT_SECRET: str = os.environ.get('JWT_SECRET') # type: ignore
JWT_ALGORITHM = 'HS256'
# JWT_EXP_SECONDS = 900 # 15 minutes
SESSION_EXPIRES_IN = 86400 * 30 # 30 days

View File

@@ -74,6 +74,7 @@ class AuthorizationServer(oauth2.AuthorizationServer):
'created_at': now_,
}
)
transact.put(
item={
'id': 'OAUTH2#TOKEN',
@@ -156,6 +157,7 @@ class AuthorizationServer(oauth2.AuthorizationServer):
body,
headers,
):
logger.debug('handle_response', status=status, body=body)
return Response(
status_code=status,
body=body,

View File

@@ -309,8 +309,8 @@ class IssuerParameter(rfc9207.IssuerParameter):
GRANT_TYPES_EXPIRES_IN = {
'authorization_code': 60 * 10, # 10 minutes
'refresh_token': 86_400 * 7, # 7 days
'authorization_code': 60 * 3, # 3 minutes
'refresh_token': 60 * 30, # 30 minutes
}