mcptoken

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTokenExists  = errors.New("mcp access token already exists")
	ErrNoToken      = errors.New("mcp access token does not exist")
	ErrInvalidToken = errors.New("invalid mcp access token")
	ErrUnavailable  = errors.New("mcp token service unavailable")
)

Functions

This section is empty.

Types

type Metadata

type Metadata struct {
	CreatedAt time.Time
	RotatedAt *time.Time
}

type PersistedState

type PersistedState struct {
	Verifier  [sha256.Size]byte
	CreatedAt time.Time
	RotatedAt *time.Time
}

type Service

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

func New

func New(store Store, now func() time.Time) (*Service, error)

func (*Service) Create

func (s *Service) Create(ctx context.Context) (string, Metadata, error)

func (*Service) Revoke

func (s *Service) Revoke(ctx context.Context) error

func (*Service) Rotate

func (s *Service) Rotate(ctx context.Context) (string, Metadata, error)

func (*Service) Status

func (s *Service) Status() Status

func (*Service) Verify

func (s *Service) Verify(token string) error

type State

type State string
const (
	StateNone     State = "none"
	StateActive   State = "active"
	StateDegraded State = "degraded"
)

type Status

type Status struct {
	State    State
	Metadata Metadata
}

type Store

type Store interface {
	Load(context.Context) (PersistedState, bool, error)
	Save(context.Context, PersistedState) error
	Delete(context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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