oauthtoken

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 13 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 {
	// 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) Load

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

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 File

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

func NewFile

func NewFile(path string) (*File, error)

func (*File) Load

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

func (*File) Store

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

type FileContents

type FileContents struct {
	Tokens map[string]*oauth2.Token `json:"tokens"`
}

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) 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
}

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