credential

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMissingKey = errors.New("missing key")

Functions

This section is empty.

Types

type JSONStore

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

func NewJSONStore

func NewJSONStore(filename, clientID, clientSecret string) (JSONStore, error)

func (JSONStore) GetClientCredentials

func (j JSONStore) GetClientCredentials() (clientID, clientSecret string, err error)

func (JSONStore) GetToken

func (j JSONStore) GetToken() (accessToken, refreshToken string, expiry time.Time, err error)

func (JSONStore) HasCredentials

func (j JSONStore) HasCredentials() (bool, error)

func (JSONStore) UpdateToken

func (j JSONStore) UpdateToken(accessToken, refreshToken string, expiry time.Time) error

type Store

type Store interface {
	GetClientCredentials() (clientID, clientSecret string, err error)
	GetToken() (accessToken, refreshToken string, expiry time.Time, err error)
	HasCredentials() (bool, error)
	UpdateToken(accessToken, refreshToken string, expiry time.Time) error
}

type VaultStore

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

func NewVaultStore

func NewVaultStore(vaultKey string) (VaultStore, error)

func (VaultStore) GetClientCredentials

func (v VaultStore) GetClientCredentials() (clientID, clientSecret string, err error)

func (VaultStore) GetToken

func (v VaultStore) GetToken() (accessToken, refreshToken string, expiry time.Time, err error)

func (VaultStore) HasCredentials

func (v VaultStore) HasCredentials() (bool, error)

func (VaultStore) UpdateToken

func (v VaultStore) UpdateToken(accessToken, refreshToken string, expiry time.Time) (err error)

Jump to

Keyboard shortcuts

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