Normalize OAuth scopes into the list shape expected by authlib.
(
scopes: dict[str, str] | list[str] | None,
)
| 37 | |
| 38 | |
| 39 | def _normalize_oauth_scopes( |
| 40 | scopes: dict[str, str] | list[str] | None, |
| 41 | ) -> list[str]: |
| 42 | """Normalize OAuth scopes into the list shape expected by authlib.""" |
| 43 | if not scopes: |
| 44 | return [] |
| 45 | if isinstance(scopes, dict): |
| 46 | return list(scopes.keys()) |
| 47 | return list(scopes) |
| 48 | |
| 49 | |
| 50 | class AuthHandler: |