keyringstore

package
v1.84.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 20, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewKeyringTokenStore

func NewKeyringTokenStore() mcp.OAuthTokenStore

NewKeyringTokenStore returns the process-wide token store backed by the OS keyring, falling back to InMemoryTokenStore when no backend is available. It always returns the same instance.

func Register

func Register()

Register installs the keyring-backed token store as the default for MCP OAuth. The CLI calls this during startup; embedders that don't need persistent keyring-backed storage can simply not call it and keep the in-memory default.

Types

type KeyringTokenStore

type KeyringTokenStore struct {
	// contains filtered or unexported fields
}

KeyringTokenStore keeps OAuth tokens in memory, sealing them to disk with a key held in the OS keyring. The keyring is touched at most once per process (to fetch or create the key), so the user's "Always Allow" decision keeps applying to refreshes and to newly authorized servers.

func (*KeyringTokenStore) GetToken

func (s *KeyringTokenStore) GetToken(resourceURL string) (*mcp.OAuthToken, error)

func (*KeyringTokenStore) ListOAuthTokens

func (s *KeyringTokenStore) ListOAuthTokens() []mcp.OAuthTokenEntry

ListOAuthTokens returns a snapshot of all stored tokens.

func (*KeyringTokenStore) RemoveToken

func (s *KeyringTokenStore) RemoveToken(resourceURL string) error

func (*KeyringTokenStore) StoreToken

func (s *KeyringTokenStore) StoreToken(resourceURL string, token *mcp.OAuthToken) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL