awscreds

package
v0.0.0-...-9592e8f Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	AccessKey       string    `yaml:"access_key"`
	SecretAccessKey string    `yaml:"secret_access_key"`
	SessionToken    string    `yaml:"session_token"`
	Expiry          time.Time `yaml:"expiry"`
}

Credentials type

func (*Credentials) HasExpired

func (c *Credentials) HasExpired() bool

HasExpired checks if the credentials has expired

func (*Credentials) Validate

func (c *Credentials) Validate() error

Validate the awscreds credentials.

type CredentialsCache

type CredentialsCache interface {
	Get() (Credentials, error)
	Put(credentials Credentials) error
	Delete(credentials Credentials) error
}

CredentialsCache defines an interface for credentials caches.

type CredentialsResolver

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

CredentialsResolver struct

func NewCredentialsResolver

func NewCredentialsResolver(cognitoConfig *config.Config, credentialsCache CredentialsCache, tokensResolver *oauth.TokensResolver, cognitoIdentity *cognitoidentity.CognitoIdentity) *CredentialsResolver

NewCredentialsResolver creates a new credentials resolver.

func (*CredentialsResolver) GetAwsCredentials

func (r *CredentialsResolver) GetAwsCredentials() (Credentials, error)

GetAwsCredentials returns the AWS Credentials, refreshing if expired.

func (*CredentialsResolver) GetTempCredentials

func (r *CredentialsResolver) GetTempCredentials(idToken string) (Credentials, error)

GetTempCredentials gets the temporary STS AWS credentials for the oauth tokens, and saves them.

func (*CredentialsResolver) RefreshAwsCredentials

func (r *CredentialsResolver) RefreshAwsCredentials() (Credentials, error)

RefreshAwsCredentials refreshes the AWS credentials.

type FileCache

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

FileCache handles getting and putting credentials from a cache

func NewFileCache

func NewFileCache(cacheDir string) *FileCache

NewFileCache creates a new instance

func (*FileCache) Delete

func (c *FileCache) Delete(credentials Credentials) error

Delete the credentials from cache.

func (*FileCache) Get

func (c *FileCache) Get() (Credentials, error)

Get loads awscreds credentials from cache.

func (*FileCache) Put

func (c *FileCache) Put(credentials Credentials) error

Put saves awscreds credentials to cache.

type KeychainCache

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

KeychainCache handles caching aws creds in the keychain.

func NewKeychainCache

func NewKeychainCache(keychain *secrets.Keychain) *KeychainCache

NewKeychainCache creates a new keychain cache.

func (KeychainCache) Delete

func (k KeychainCache) Delete(credentials Credentials) error

Delete deletes creds from the cache.

func (KeychainCache) Get

func (k KeychainCache) Get() (Credentials, error)

Get gets creds from the cache.

func (KeychainCache) Put

func (k KeychainCache) Put(credentials Credentials) error

Put puts creds in the cache.

Jump to

Keyboard shortcuts

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