provider

package module
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgent = ""

Functions

func ShaHmac1

func ShaHmac1(source, secret string) string

Types

type AccessKeyProvider

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

func NewAccessKeyProvider

func NewAccessKeyProvider(accessKeyId, accessKeySecret string) *AccessKeyProvider

func (*AccessKeyProvider) Credentials

func (a *AccessKeyProvider) Credentials(ctx context.Context) (*Credentials, error)

type ChainProvider

type ChainProvider struct {
	Logger Logger
	// contains filtered or unexported fields
}

func DefaultChainProvider

func DefaultChainProvider() *ChainProvider

func DefaultChainProviderWithLogger added in v0.3.0

func DefaultChainProviderWithLogger(l Logger) *ChainProvider

func NewChainProvider

func NewChainProvider(providers ...CredentialsProvider) *ChainProvider

func (*ChainProvider) Credentials

func (c *ChainProvider) Credentials(ctx context.Context) (*Credentials, error)

type Credentials

type Credentials struct {
	AccessKeyId     string
	AccessKeySecret string
	SecurityToken   string
	Expiration      time.Time
}

func (Credentials) DeepCopy

func (c Credentials) DeepCopy() Credentials

type CredentialsProvider

type CredentialsProvider interface {
	Credentials(ctx context.Context) (*Credentials, error)
}

type ECSMetadataProvider

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

func (*ECSMetadataProvider) Credentials

func (e *ECSMetadataProvider) Credentials(ctx context.Context) (*Credentials, error)

type ECSMetadataProviderOptions

type ECSMetadataProviderOptions struct {
	Endpoint  string
	Timeout   time.Duration
	Transport http.RoundTripper

	RoleName                string
	MetadataTokenTTLSeconds int

	ExpiryWindow  time.Duration
	RefreshPeriod time.Duration
	Logger        Logger
}

type EncryptedFileProvider

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

func (*EncryptedFileProvider) Credentials

func (e *EncryptedFileProvider) Credentials(ctx context.Context) (*Credentials, error)

type EncryptedFileProviderOptions

type EncryptedFileProviderOptions struct {
	FilePath      string
	RefreshPeriod time.Duration
	ExpiryWindow  time.Duration
	Logger        Logger
}

type EnvProvider

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

func NewEnvProvider

func NewEnvProvider(opts EnvProviderOptions) *EnvProvider

func (*EnvProvider) Credentials

func (e *EnvProvider) Credentials(ctx context.Context) (*Credentials, error)

type EnvProviderOptions

type EnvProviderOptions struct {
	EnvAccessKeyId     string
	EnvAccessKeySecret string
}

type FileProvider

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

func NewFileProvider

func NewFileProvider(filepath string, decoder func(data []byte) (*Credentials, error), opts FileProviderOptions) *FileProvider

func (*FileProvider) Credentials

func (f *FileProvider) Credentials(ctx context.Context) (*Credentials, error)

type FileProviderOptions

type FileProviderOptions struct {
	RefreshPeriod time.Duration
	ExpiryWindow  time.Duration
	Logger        Logger
	LogPrefix     string
}

type Logger

type Logger interface {
	Info(msg string)
	Debug(msg string)
	Error(err error, msg string)
}

type NotEnableError

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

func NewNotEnableError

func NewNotEnableError(err error) *NotEnableError

func (NotEnableError) Error

func (e NotEnableError) Error() string

type OIDCProvider

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

func NewOIDCProvider

func NewOIDCProvider(opts OIDCProviderOptions) *OIDCProvider

func (*OIDCProvider) Credentials

func (o *OIDCProvider) Credentials(ctx context.Context) (*Credentials, error)

type OIDCProviderOptions

type OIDCProviderOptions struct {
	STSEndpoint string

	SessionName string

	EnvRoleArn         string
	EnvOIDCProviderArn string
	EnvOIDCTokenFile   string

	Timeout   time.Duration
	Transport http.RoundTripper

	ExpiryWindow  time.Duration
	RefreshPeriod time.Duration
	Logger        Logger
	// contains filtered or unexported fields
}

type Updater

type Updater struct {
	Logger Logger
	// contains filtered or unexported fields
}

func NewUpdater

func NewUpdater(getter getCredentialsFunc, opts UpdaterOptions) *Updater

func (*Updater) Credentials

func (u *Updater) Credentials(ctx context.Context) (*Credentials, error)

func (*Updater) Expired

func (u *Updater) Expired() bool

func (*Updater) Start

func (u *Updater) Start(ctx context.Context)

type UpdaterOptions

type UpdaterOptions struct {
	ExpiryWindow  time.Duration
	RefreshPeriod time.Duration
	Logger        Logger
	LogPrefix     string
}

Jump to

Keyboard shortcuts

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