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
Constants ¶
This section is empty.
Variables ¶
View Source
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.
Click to show internal directories.
Click to hide internal directories.