mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-08-24 06:24:18 +02:00
* Add subject field to AccessToken initialization Fixes #4266 Add `subject` property to the AccessToken. ```python return AccessToken( token=access_token_as_dict["token"], client_id=access_token_as_dict["client_id"], scopes=access_token_as_dict["scopes"], subject=access_token_as_dict["subject"], # Optional fields expires_at=access_token_as_dict.get("expires_at"), resource=access_token_as_dict.get("resource"), claims=access_token_as_dict.get("claims") or {}, ) ``` * Populate AccessToken.subject across all token verifiers Closes #4266. get_access_token().subject was always None: the SDK's AccessToken.subject wasn't carried into FastMCP's AccessToken by the dependency-layer conversion, and none of the built-in TokenVerifiers (JWT, introspection, and the OAuth-provider verifiers for Discord, Clerk, Google, WorkOS, HuggingFace, GitHub, and Cognito) populated it from the sub claim/field they already extract. --------- Co-authored-by: Jeremiah Lowin <153965+jlowin@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_bearer_auth_backend.py | ||
| test_custom_routes.py | ||
| test_http_auth_middleware.py | ||
| test_http_dependencies.py | ||
| test_http_middleware.py | ||
| test_lifespan_once_per_process.py | ||
| test_session_idle_timeout.py | ||
| test_session_owner_enforcement.py | ||
| test_stale_access_token.py | ||
| test_streamable_http_shutdown.py | ||