yera.tools.mcp.oauth_storage
Persistent secret storage for MCP OAuth protocol state.
Symbols
decode_oauth_client_info
decode_oauth_client_info(
value: SecretValue,
) → OAuthClientInformationFullDecode OAuth client registration from an opaque secret.
Parameters
Versioned opaque value read from the Yera secret store.
Returns
The validated OAuth client registration.
decode_oauth_tokens
decode_oauth_tokens(
value: SecretValue,
) → OAuthTokenDecode an OAuth token bundle from an opaque secret.
Parameters
Versioned opaque value read from the Yera secret store.
Returns
The validated OAuth token bundle.
encode_oauth_client_info
encode_oauth_client_info(
client_info: OAuthClientInformationFull,
) → SecretValueEncode OAuth client registration as an opaque secret.
Parameters
Registration returned by the authorization server.
Returns
A versioned opaque value suitable for the Yera secret store.
encode_oauth_tokens
encode_oauth_tokens(
tokens: OAuthToken,
) → SecretValueEncode a complete OAuth token bundle as an opaque secret.
Parameters
Tokens returned by the OAuth authorization server.
Returns
A versioned opaque value suitable for the Yera secret store.
oauth_client_info_identity
oauth_client_info_identity(
authorization_id: str,
) → SecretIdentityBuild the secret identity for OAuth client registration.
Parameters
Stable identity of the OAuth authorization.
Returns
Secret-store identity for registered client information.
oauth_token_identity
oauth_token_identity(
authorization_id: str,
) → SecretIdentityBuild the secret identity for one OAuth token bundle.
Parameters
Stable identity of the OAuth authorization.
Returns
Secret-store identity for the authorization's tokens.
SecretStoreOAuthStorage
Adapt Yera secret storage to the MCP SDK OAuth storage contract.
Methods
SecretStoreOAuthStorage.get_tokens
get_tokens() → OAuthToken | NoneReturn stored OAuth tokens when present.
Returns
The stored token bundle, or None before authorization.
SecretStoreOAuthStorage.get_client_info
get_client_info() → OAuthClientInformationFull | NoneReturn stored OAuth client registration when present.
Returns
Registered client information, or None when unavailable.
SecretStoreOAuthStorage.set_tokens
set_tokens(
tokens: OAuthToken,
) → NoneCreate or replace the stored OAuth token bundle.
Parameters
Complete token response supplied by the MCP SDK.
SecretStoreOAuthStorage.set_client_info
set_client_info(
client_info: OAuthClientInformationFull,
) → NoneCreate or replace stored OAuth client registration.
Parameters
Registration supplied by the MCP SDK.