Documentation ¶
Index ¶
- Variables
- func WithKeyring(k keyring.Keyring) func(o *Opts)
- type InMemoryTokenStore
- type Keyring
- func (s *Keyring) Clear(key string) error
- func (s *Keyring) HasKey(key string) (bool, error)
- func (s *Keyring) List() ([]keyring.Item, error)
- func (s *Keyring) ListKeys() ([]string, error)
- func (s *Keyring) Retrieve(key string, target interface{}) error
- func (s *Keyring) Store(key string, payload interface{}) error
- type NotifyRefreshTokenSource
- type Opts
- type Storage
- type TokenNotifyFunc
- type WindowsOpts
- type WindowsStorage
Constants ¶
This section is empty.
Variables ¶
var (
ErrNotFound = errors.New("auth token not found")
)
Functions ¶
func WithKeyring ¶
WithKeyring specifies a custom keyring to use.
Types ¶
type InMemoryTokenStore ¶
type InMemoryTokenStore struct {
// contains filtered or unexported fields
}
func NewInMemoryTokenStore ¶
func NewInMemoryTokenStore() *InMemoryTokenStore
func (*InMemoryTokenStore) Clear ¶
func (ts *InMemoryTokenStore) Clear() error
type Keyring ¶ added in v1.22.0
type Keyring struct {
// contains filtered or unexported fields
}
Keyring is a wrapper around 99designs/keyring that handles config via env vars and marshalling/unmarshalling of items.
func (*Keyring) HasKey ¶ added in v1.22.0
returns false if the key is not found, true if it is found, or false and an error if there was a keyring related error
type NotifyRefreshTokenSource ¶
type NotifyRefreshTokenSource struct { New oauth2.TokenSource T *oauth2.Token SaveToken TokenNotifyFunc // called when token refreshed so new refresh token can be persisted // contains filtered or unexported fields }
NotifyRefreshTokenSource is essentially `oauth2.ResuseTokenSource` with `TokenNotifyFunc` added.
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
type TokenNotifyFunc ¶
TokenNotifyFunc is a function that accepts an oauth2 Token upon refresh, and returns an error if it should not be used.
type WindowsOpts ¶ added in v1.33.1
type WindowsStorage ¶ added in v1.33.1
type WindowsStorage struct {
// contains filtered or unexported fields
}
func NewWindows ¶ added in v1.33.1
func NewWindows(opts Opts) WindowsStorage
New creates a new token storage driver. The context is the authentication context to use. This is usually 'default' and in future can be expanded to allow CLI users to switch between separate Common Fate tenancies.
func (*WindowsStorage) Clear ¶ added in v1.33.1
func (s *WindowsStorage) Clear() error
Clear the token