diff --git a/asab/web/auth/authorization.py b/asab/web/auth/authorization.py index 6cc78c6b..e152b2be 100644 --- a/asab/web/auth/authorization.py +++ b/asab/web/auth/authorization.py @@ -14,8 +14,26 @@ class Authorization: """ Contains authentication and authorization claims, provides methods for checking and enforcing access control. + + Attributes: + CredentialsId (str): + Unique identifier of the authorized entity in the ASAB ecosystem. + Usually corresponds to JWT attribute "sub". + Username (str): End-user's preferred username. + Email (str): End-user email address. + Phone (str): End-user phone number. + SessionId (str): Sign-on session identifier. + Issuer (str): Unique identifier of the server that issued the authorization. + IssuedAt (datetime.datetime): Timestamp when the authorization was issued. + Expiration (datetime.datetime): Timestamp when the authorization expires. """ def __init__(self, claims: dict): + """ + Initialize Authorization object from authorization server claims. + + Args: + claims (dict): Authorization server claims (from ID token, UserInfo etc.). + """ # Userinfo should not be accessed directly self._Claims = claims or {} self._Resources = self._Claims.get("resources", {})