store

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: Apache-2.0 Imports: 7 Imported by: 1

Documentation

Overview

Package store defines simple token and client-configuration stores used by the authorization helpers in the parent `auth` package.

It currently ships with an in-memory implementation that is sufficient for most CLI or unit-test scenarios but can be swapped for a persistent backend if required.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryStoreOption

type MemoryStoreOption func(*memoryStore)

func WithClientConfig

func WithClientConfig(client *oauth2.Config) MemoryStoreOption

type Store

type Store interface {
	LookupClientConfig(issuer string) (*oauth2.Config, bool)
	AddClientConfig(issuer string, client *oauth2.Config) error
	AddAuthorizationServerMetadata(metadata *meta.AuthorizationServerMetadata) error
	LookupAuthorizationServerMetadata(issuer string) (*meta.AuthorizationServerMetadata, bool)
	AddIssuerPublicKeys(issuer string, keys map[string]crypto.PublicKey) error
	LookupIssuerPublicKeys(issuer string) (map[string]crypto.PublicKey, bool)
	AddToken(key TokenKey, token *oauth2.Token) error
	LookupToken(key TokenKey) (*oauth2.Token, bool)
}

Store is a pluggable persistence layer for tokens & client IDs. The in‑memory default is fine for CLI tools; swap with Redis/SQL for fleets.

func NewMemoryStore

func NewMemoryStore(options ...MemoryStoreOption) Store

type TokenKey

type TokenKey struct {
	Issuer string
	Scopes string
}

Jump to

Keyboard shortcuts

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