Skip to content

Commit

Permalink
document public authorization attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
byewokko committed Dec 9, 2024
1 parent 2859ddc commit 12c5e40
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions asab/web/auth/authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -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", {})
Expand Down

0 comments on commit 12c5e40

Please sign in to comment.