add test to token
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user