provider

package module
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgent = ""

Functions

This section is empty.

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 CredentialForV2SDK added in v0.5.0

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

func NewCredentialForV2SDK added in v0.5.0

func (CredentialForV2SDK) GetAccessKeyId added in v0.5.0

func (c CredentialForV2SDK) GetAccessKeyId() (*string, error)

func (CredentialForV2SDK) GetAccessKeySecret added in v0.5.0

func (c CredentialForV2SDK) GetAccessKeySecret() (*string, error)

func (CredentialForV2SDK) GetBearerToken added in v0.5.0

func (c CredentialForV2SDK) GetBearerToken() *string

func (CredentialForV2SDK) GetSecurityToken added in v0.5.0

func (c CredentialForV2SDK) GetSecurityToken() (*string, error)

func (CredentialForV2SDK) GetType added in v0.5.0

func (c CredentialForV2SDK) GetType() *string

type CredentialForV2SDKOptions added in v0.5.0

type CredentialForV2SDKOptions struct {
	Logger Logger
}

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 RoleArnProvider added in v0.5.0

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

func NewRoleArnProvider added in v0.5.0

func NewRoleArnProvider(cp CredentialsProvider, roleArn string, opts RoleArnProviderOptions) *RoleArnProvider

func (*RoleArnProvider) Credentials added in v0.5.0

func (r *RoleArnProvider) Credentials(ctx context.Context) (*Credentials, error)

type RoleArnProviderOptions added in v0.5.0

type RoleArnProviderOptions struct {
	STSEndpoint string

	SessionName string

	Timeout   time.Duration
	Transport http.RoundTripper

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

type SignerForV1SDK added in v0.5.0

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

func NewSignerForV1SDK added in v0.5.0

func NewSignerForV1SDK(p CredentialsProvider, opts SignerForV1SDKOptions) *SignerForV1SDK

func (SignerForV1SDK) GetAccessKeyId added in v0.5.0

func (s SignerForV1SDK) GetAccessKeyId() (string, error)

func (SignerForV1SDK) GetExtraParam added in v0.5.0

func (s SignerForV1SDK) GetExtraParam() map[string]string

func (SignerForV1SDK) GetName added in v0.5.0

func (s SignerForV1SDK) GetName() string

func (SignerForV1SDK) GetType added in v0.5.0

func (s SignerForV1SDK) GetType() string

func (SignerForV1SDK) GetVersion added in v0.5.0

func (s SignerForV1SDK) GetVersion() string

func (SignerForV1SDK) Sign added in v0.5.0

func (s SignerForV1SDK) Sign(stringToSign, secretSuffix string) string

type SignerForV1SDKOptions added in v0.5.0

type SignerForV1SDKOptions struct {
	Logger Logger
}

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