update id

This commit is contained in:
2025-09-14 23:11:49 -03:00
parent 9fb1895557
commit 8675edc36e
9 changed files with 28 additions and 20 deletions

View File

@@ -1,4 +1,4 @@
from http import HTTPStatus, client
from http import HTTPStatus
from http.cookies import SimpleCookie
import jwt
@@ -33,13 +33,11 @@ def authorize():
request=router.current_event,
end_user=sub,
)
req_scopes = set(scope_to_list(grant.request.payload.scope))
user_scopes = set(scope_to_list(session_scope)) if session_scope else set()
client_scopes = set(scope_to_list(grant.client.scope))
user_scopes = set(scope_to_list(session_scope)) if session_scope else set()
if not req_scopes.issubset(
client_scopes
& (user_scopes | {'openid', 'email', 'profile', 'offline_access'})
if not client_scopes.issubset(
user_scopes | {'openid', 'email', 'profile', 'offline_access'}
):
raise errors.InvalidScopeError(status_code=HTTPStatus.UNAUTHORIZED)