provider

package module
v0.10.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var UserAgent = ""

Functions

func GetSTSEndpoint added in v0.7.0

func GetSTSEndpoint(region string, vpcNetwork bool) string

func IsNoAvailableProviderError added in v0.10.0

func IsNoAvailableProviderError(err error) bool

func IsNotEnableError added in v0.10.0

func IsNotEnableError(err error) bool

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 deprecated

func DefaultChainProvider() *ChainProvider

Deprecated: use NewDefaultChainProvider instead

func DefaultChainProviderWithLogger deprecated added in v0.3.0

func DefaultChainProviderWithLogger(l Logger) *ChainProvider

Deprecated: use NewDefaultChainProvider instead

func NewChainProvider

func NewChainProvider(providers ...CredentialsProvider) *ChainProvider

func NewChainProviderWithOptions added in v0.9.0

func NewChainProviderWithOptions(providers []CredentialsProvider, opts ChainProviderOptions) *ChainProvider

func NewDefaultChainProvider added in v0.7.0

func NewDefaultChainProvider(opts DefaultChainProviderOptions) *ChainProvider

func (*ChainProvider) Credentials

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

func (*ChainProvider) SelectProvider added in v0.10.0

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

func (*ChainProvider) Stop added in v0.10.0

func (c *ChainProvider) Stop(ctx context.Context)

type ChainProviderOptions added in v0.9.0

type ChainProviderOptions struct {
	EnableRuntimeSwitch        bool
	RuntimeSwitchCacheDuration time.Duration
	// contains filtered or unexported fields
}

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 DefaultChainProviderOptions added in v0.7.0

type DefaultChainProviderOptions struct {
	EnableRuntimeSwitch        bool
	RuntimeSwitchCacheDuration time.Duration

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

type ECSMetadataProvider

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

func (*ECSMetadataProvider) Credentials

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

func (*ECSMetadataProvider) Stop added in v0.10.0

func (e *ECSMetadataProvider) Stop(ctx context.Context)

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
	EnvSecurityToken   string

	EnvRoleArn         string
	EnvOIDCProviderArn string
	EnvOIDCTokenFile   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)

func (*FileProvider) Stop added in v0.10.0

func (f *FileProvider) Stop(ctx context.Context)

type FileProviderOptions

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

type FunctionProvider added in v0.8.0

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

func NewFunctionProvider added in v0.8.0

func NewFunctionProvider(getCredentials func(ctx context.Context) (*Credentials, error)) *FunctionProvider

func (*FunctionProvider) Credentials added in v0.8.0

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

type Logger

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

type NoAvailableProviderError added in v0.10.0

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

func NewNoAvailableProviderError added in v0.10.0

func NewNoAvailableProviderError(err error) *NoAvailableProviderError

func (NoAvailableProviderError) Error added in v0.10.0

func (e NoAvailableProviderError) Error() 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 {
	Logger Logger
	// contains filtered or unexported fields
}

func NewOIDCProvider

func NewOIDCProvider(opts OIDCProviderOptions) *OIDCProvider

func (*OIDCProvider) Credentials

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

func (*OIDCProvider) Stop added in v0.10.0

func (o *OIDCProvider) Stop(ctx context.Context)

type OIDCProviderOptions

type OIDCProviderOptions struct {
	STSEndpoint string

	SessionName string

	RoleArn            string
	EnvRoleArn         string
	OIDCProviderArn    string
	EnvOIDCProviderArn string
	OIDCTokenFile      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 {
	Logger Logger
	// 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)

func (*RoleArnProvider) Stop added in v0.10.0

func (r *RoleArnProvider) Stop(ctx context.Context)

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 STSTokenProvider added in v0.8.0

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

func NewSTSTokenProvider added in v0.8.0

func NewSTSTokenProvider(accessKeyId, accessKeySecret, securityToken string) *STSTokenProvider

func (*STSTokenProvider) Credentials added in v0.8.0

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

func (*STSTokenProvider) SetExpiration added in v0.8.0

func (a *STSTokenProvider) SetExpiration(exp time.Time) *STSTokenProvider

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 Stopper added in v0.10.0

type Stopper interface {
	Stop(ctx context.Context)
}

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)

func (*Updater) Stop added in v0.10.0

func (u *Updater) Stop(shutdownCtx 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