Documentation
¶
Index ¶
- Constants
- func NewCredentialsProvider(ctx context.Context, opts ...auth.Option) aws.CredentialsProvider
- type Credentials
- type Implementation
- type Provider
- func (p Provider) GetAccessCredentialOptionsForArtifactRepository(artifactRepository string, _ ...auth.Option) ([]auth.Option, error)
- func (Provider) GetAccessCredentialOptionsForCluster(opts ...auth.Option) ([][]auth.Option, error)
- func (Provider) GetAccessCredentialOptionsForGitRepository(gitURL *url.URL) ([]auth.Option, error)
- func (Provider) GetAudiences(_ context.Context, opts ...auth.Option) ([]string, error)
- func (Provider) GetIdentity(opts ...auth.Option) (string, error)
- func (Provider) GetName() string
- func (p Provider) NewAccessCredentialForIdentity(ctx context.Context, identity auth.Credential, opts ...auth.Option) (auth.Credential, error)
- func (p Provider) NewArtifactRegistryCredentials(ctx context.Context, registryInput string, accessCredential auth.Credential, ...) (*auth.ArtifactRegistryCredentials, error)
- func (p Provider) NewControllerToken(ctx context.Context, opts ...auth.Option) (auth.Credential, error)
- func (Provider) NewGitCredentials(_ context.Context, gitInput string, accessCredential auth.Credential, ...) (*auth.GitCredentials, error)
- func (p Provider) NewRESTConfig(ctx context.Context, accessCredentials []auth.Credential, opts ...auth.Option) (*auth.RESTConfig, error)
- func (Provider) ParseArtifactRepository(artifactRepository string) (string, error)
- func (Provider) ParseGitRepository(gitURL *url.URL) (string, error)
Constants ¶
const (
ProviderName = "aws"
)
ProviderName is the name of the AWS authentication provider.
Variables ¶
This section is empty.
Functions ¶
func NewCredentialsProvider ¶
NewCredentialsProvider creates a new credentials provider for the given options.
Types ¶
type Credentials ¶ added in v0.21.0
type Credentials struct{ types.Credentials }
Credentials is the AWS credential.
func (*Credentials) GetDuration ¶ added in v0.21.0
func (c *Credentials) GetDuration() time.Duration
GetDuration implements auth.Credential.
type Implementation ¶
type Implementation interface {
LoadDefaultConfig(ctx context.Context, optFns ...func(*config.LoadOptions) error) (aws.Config, error)
AssumeRoleWithWebIdentity(ctx context.Context, params *sts.AssumeRoleWithWebIdentityInput, options sts.Options) (*sts.AssumeRoleWithWebIdentityOutput, error)
GetAuthorizationToken(ctx context.Context, cfg aws.Config) (any, error)
GetPublicAuthorizationToken(ctx context.Context, cfg aws.Config) (any, error)
DescribeCluster(ctx context.Context, params *eks.DescribeClusterInput, options eks.Options) (*eks.DescribeClusterOutput, error)
PresignGetCallerIdentity(ctx context.Context, optFn func(*sts.PresignOptions), options sts.Options) (*signerv4.PresignedHTTPRequest, error)
}
Implementation provides the required methods of the AWS libraries.
type Provider ¶
type Provider struct{ Implementation }
Provider implements the auth.Provider interface for AWS authentication.
func (Provider) GetAccessCredentialOptionsForArtifactRepository ¶ added in v0.64.0
func (p Provider) GetAccessCredentialOptionsForArtifactRepository(artifactRepository string, _ ...auth.Option) ([]auth.Option, error)
GetAccessCredentialOptionsForArtifactRepository implements auth.Provider.
func (Provider) GetAccessCredentialOptionsForCluster ¶ added in v0.64.0
GetAccessCredentialOptionsForCluster implements auth.Provider.
func (Provider) GetAccessCredentialOptionsForGitRepository ¶ added in v0.64.0
GetAccessCredentialOptionsForGitRepository implements auth.GitCredentialsProvider. AWS requires a region for obtaining access credentials. To avoid requiring callers to pass a region in addition to the CodeCommit URL, we extract the region from the URL and inject it as AWSRegion so that object-level workload identity (which requires an explicit region) works without extra config.
func (Provider) GetAudiences ¶ added in v0.21.0
GetAudiences implements auth.Provider.
func (Provider) GetIdentity ¶
GetIdentity implements auth.Provider.
func (Provider) NewAccessCredentialForIdentity ¶ added in v0.64.0
func (p Provider) NewAccessCredentialForIdentity(ctx context.Context, identity auth.Credential, opts ...auth.Option) (auth.Credential, error)
NewAccessCredentialForIdentity implements auth.Provider.
func (Provider) NewArtifactRegistryCredentials ¶ added in v0.12.0
func (p Provider) NewArtifactRegistryCredentials(ctx context.Context, registryInput string, accessCredential auth.Credential, opts ...auth.Option) (*auth.ArtifactRegistryCredentials, error)
NewArtifactRegistryCredentials implements auth.Provider.
func (Provider) NewControllerToken ¶ added in v0.12.0
func (p Provider) NewControllerToken(ctx context.Context, opts ...auth.Option) (auth.Credential, error)
NewControllerToken implements auth.Provider.
func (Provider) NewGitCredentials ¶ added in v0.42.0
func (Provider) NewGitCredentials(_ context.Context, gitInput string, accessCredential auth.Credential, _ ...auth.Option) (*auth.GitCredentials, error)
NewGitCredentials implements auth.GitCredentialsProvider.
func (Provider) NewRESTConfig ¶ added in v0.21.0
func (p Provider) NewRESTConfig(ctx context.Context, accessCredentials []auth.Credential, opts ...auth.Option) (*auth.RESTConfig, error)
NewRESTConfig implements auth.Provider.
func (Provider) ParseArtifactRepository ¶ added in v0.12.0
ParseArtifactRepository implements auth.Provider. ParseArtifactRepository returns the ECR region, unless the registry is one of the public ECR hostnames, in which case it returns cryptov1.RegistryAWSPublicECR.
func (Provider) ParseGitRepository ¶ added in v0.42.0
ParseGitRepository implements auth.GitCredentialsProvider. It validates the URL is a CodeCommit URL and returns the URL string so that it is included in the cache key: CodeCommit credentials are a SigV4 signature over the request URL, so distinct URLs must map to distinct cache entries.