Dataclass for data extracted from a Supabase JWT.
| 106 | |
| 107 | |
| 108 | class SupabaseUserData(pydantic.BaseModel): |
| 109 | """ |
| 110 | Dataclass for data extracted from a Supabase JWT. |
| 111 | """ |
| 112 | |
| 113 | model_config = {'extra': 'ignore'} |
| 114 | |
| 115 | iss: str # Issuer: The URL of your Supabase project |
| 116 | sub: str # Subject: The user's UUID |
| 117 | iat: int # Issued At: When the token was created |
| 118 | exp: int # Expiration Time: When the token expires |
| 119 | aud: str # Audience: Usually "authenticated" |
| 120 | |
| 121 | email: str # The user's email address |
| 122 | role: str # The user's role (typically "authenticated") |
| 123 | app_metadata: dict # Contains information like the provider used for authentication |
| 124 | user_metadata: dict # Custom data associated with the user, such as their name |
| 125 | session_id: str # A unique identifier for the current session |
| 126 | |
| 127 | |
| 128 | def _decode_supabase_jwt(token: str) -> SupabaseUserData: |
no outgoing calls
no test coverage detected
searching dependent graphs…