credproviders

package
v0.0.0-...-b6f9f64 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AzureProviderName provides a name of Azure provider
	AzureProviderName = "AzureProvider"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssumeRoleProvider

type AssumeRoleProvider struct {
	AwsRoleArnEnv              EnvVar
	AwsWebIdentityTokenFileEnv EnvVar
	AwsRoleSessionNameEnv      EnvVar
	// contains filtered or unexported fields
}

An AssumeRoleProvider retrieves credentials for assume role with web identity.

func NewAssumeRoleProvider

func NewAssumeRoleProvider(httpClient *http.Client, expiryWindow time.Duration) *AssumeRoleProvider

NewAssumeRoleProvider returns a pointer to an assume role provider.

func (*AssumeRoleProvider) IsExpired

func (a *AssumeRoleProvider) IsExpired() bool

IsExpired returns true if the credentials are expired.

func (*AssumeRoleProvider) Retrieve

func (a *AssumeRoleProvider) Retrieve() (credentials.Value, error)

Retrieve retrieves the keys from the AWS service.

func (*AssumeRoleProvider) RetrieveWithContext

func (a *AssumeRoleProvider) RetrieveWithContext(ctx context.Context) (credentials.Value, error)

RetrieveWithContext retrieves the keys from the AWS service.

type AzureProvider

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

An AzureProvider retrieves credentials from Azure IMDS.

func NewAzureProvider

func NewAzureProvider(httpClient *http.Client, expiryWindow time.Duration) *AzureProvider

NewAzureProvider returns a pointer to an Azure credential provider.

func (*AzureProvider) IsExpired

func (a *AzureProvider) IsExpired() bool

IsExpired returns if the credentials have been retrieved.

func (*AzureProvider) Retrieve

func (a *AzureProvider) Retrieve() (credentials.Value, error)

Retrieve retrieves the keys from the Azure service.

func (*AzureProvider) RetrieveWithContext

func (a *AzureProvider) RetrieveWithContext(ctx context.Context) (credentials.Value, error)

RetrieveWithContext retrieves the keys from the Azure service.

type EC2Provider

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

An EC2Provider retrieves credentials from EC2 metadata.

func NewEC2Provider

func NewEC2Provider(httpClient *http.Client, expiryWindow time.Duration) *EC2Provider

NewEC2Provider returns a pointer to an EC2 credential provider.

func (*EC2Provider) IsExpired

func (e *EC2Provider) IsExpired() bool

IsExpired returns true if the credentials are expired.

func (*EC2Provider) Retrieve

func (e *EC2Provider) Retrieve() (credentials.Value, error)

Retrieve retrieves the keys from the AWS service.

func (*EC2Provider) RetrieveWithContext

func (e *EC2Provider) RetrieveWithContext(ctx context.Context) (credentials.Value, error)

RetrieveWithContext retrieves the keys from the AWS service.

type ECSProvider

type ECSProvider struct {
	AwsContainerCredentialsRelativeURIEnv EnvVar
	// contains filtered or unexported fields
}

An ECSProvider retrieves credentials from ECS metadata.

func NewECSProvider

func NewECSProvider(httpClient *http.Client, expiryWindow time.Duration) *ECSProvider

NewECSProvider returns a pointer to an ECS credential provider.

func (*ECSProvider) IsExpired

func (e *ECSProvider) IsExpired() bool

IsExpired returns true if the credentials are expired.

func (*ECSProvider) Retrieve

func (e *ECSProvider) Retrieve() (credentials.Value, error)

Retrieve retrieves the keys from the AWS service.

func (*ECSProvider) RetrieveWithContext

func (e *ECSProvider) RetrieveWithContext(ctx context.Context) (credentials.Value, error)

RetrieveWithContext retrieves the keys from the AWS service.

type EnvProvider

type EnvProvider struct {
	AwsAccessKeyIDEnv     EnvVar
	AwsSecretAccessKeyEnv EnvVar
	AwsSessionTokenEnv    EnvVar
	// contains filtered or unexported fields
}

A EnvProvider retrieves credentials from the environment variables of the running process. Environment credentials never expire.

func NewEnvProvider

func NewEnvProvider() *EnvProvider

NewEnvProvider returns a pointer to an ECS credential provider.

func (*EnvProvider) IsExpired

func (e *EnvProvider) IsExpired() bool

IsExpired returns true if the credentials have not been retrieved.

func (*EnvProvider) Retrieve

func (e *EnvProvider) Retrieve() (credentials.Value, error)

Retrieve retrieves the keys from the environment.

type EnvVar

type EnvVar string

EnvVar is an environment variable

func (EnvVar) Get

func (ev EnvVar) Get() string

Get retrieves the environment variable

type StaticProvider

type StaticProvider struct {
	credentials.Value
	// contains filtered or unexported fields
}

A StaticProvider is a set of credentials which are set programmatically, and will never expire.

func (*StaticProvider) IsExpired

func (s *StaticProvider) IsExpired() bool

IsExpired returns if the credentials are expired.

For StaticProvider, the credentials never expired.

func (*StaticProvider) Retrieve

func (s *StaticProvider) Retrieve() (credentials.Value, error)

Retrieve returns the credentials or error if the credentials are invalid.

Jump to

Keyboard shortcuts

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