oauthtoken

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheAlert

type CacheAlert struct {
	LoadStorer
	// contains filtered or unexported fields
}

CacheAlert is a tokenLoadStorer that detects when a token's subject for a different cluster is changing, and produces a warning over an appropriate communication channel.

func (*CacheAlert) Store

func (a *CacheAlert) Store(ctx context.Context, cluster string, token *oauth2.Token) error

type DebugPrint

type DebugPrint struct{}

func (*DebugPrint) Load

func (d *DebugPrint) Load(ctx context.Context, cluster string) (*oauth2.Token, error)

func (*DebugPrint) Store

func (d *DebugPrint) Store(ctx context.Context, cluster string, token *oauth2.Token) error

type FakeTokenStore added in v0.0.3

type FakeTokenStore struct {
	Tokens                       map[string]*oauth2.Token
	LoadErr, StoreErr, DeleteErr error
}

FakeTokenStore is a test implementation of LoadStorer that stores tokens in memory instead of the system keychain.

func NewFakeTokenStore added in v0.0.3

func NewFakeTokenStore() *FakeTokenStore

func (*FakeTokenStore) Delete added in v0.0.3

func (f *FakeTokenStore) Delete(ctx context.Context, cluster string) error

func (*FakeTokenStore) Load added in v0.0.3

func (f *FakeTokenStore) Load(ctx context.Context, cluster string) (*oauth2.Token, error)

func (*FakeTokenStore) Store added in v0.0.3

func (f *FakeTokenStore) Store(ctx context.Context, cluster string, token *oauth2.Token) error

type Keyring

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

Keyring stores a JWT token on the user's keyring via the OS-specific keyring mechanism of the current platform.

func (*Keyring) Delete added in v0.0.3

func (f *Keyring) Delete(ctx context.Context, cluster string) error

func (*Keyring) Load

func (f *Keyring) Load(ctx context.Context, cluster string) (*oauth2.Token, error)

func (*Keyring) Store

func (f *Keyring) Store(ctx context.Context, cluster string, token *oauth2.Token) error

type LoadStorer

type LoadStorer interface {
	Load(context.Context, string) (*oauth2.Token, error)
	Store(context.Context, string, *oauth2.Token) error
	Delete(context.Context, string) error
}

func NewCacheAlert

func NewCacheAlert(impl LoadStorer, stderr io.Writer) LoadStorer

func NewKeyring

func NewKeyring() (LoadStorer, error)

Jump to

Keyboard shortcuts

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