See https://datatracker.ietf.org/doc/html/rfc6749#section-5.1
| 4 | |
| 5 | |
| 6 | class OAuthToken(BaseModel): |
| 7 | """See https://datatracker.ietf.org/doc/html/rfc6749#section-5.1""" |
| 8 | |
| 9 | access_token: str |
| 10 | token_type: Literal["Bearer"] = "Bearer" |
| 11 | expires_in: int | None = None |
| 12 | scope: str | None = None |
| 13 | refresh_token: str | None = None |
| 14 | |
| 15 | @field_validator("token_type", mode="before") |
| 16 | @classmethod |
| 17 | def normalize_token_type(cls, v: str | None) -> str | None: |
| 18 | if isinstance(v, str): |
| 19 | # Bearer is title-cased in the spec, so we normalize it |
| 20 | # https://datatracker.ietf.org/doc/html/rfc6750#section-4 |
| 21 | return v.title() |
| 22 | return v # pragma: no cover |
| 23 | |
| 24 | |
| 25 | class AuthorizationCodeResult(BaseModel): |
no outgoing calls