auth

package
v1.16.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Coalesce

func Coalesce(values ...string) string

Coalesce is a helper function to return the first non-empty string from the inputs This helps us to migrate away from the deprecated duplicate aws auth profile metadata fields in Dapr 1.17.

Types

type CredentialProvider

type CredentialProvider interface {
	Retrieve(ctx context.Context) (aws.Credentials, error)
	Type() ProviderType
}

CredentialProvider provides an interface for retrieving AWS credentials.

func NewCredentialProvider

func NewCredentialProvider(ctx context.Context, opts Options, configOpts []func(*config.LoadOptions) error) (CredentialProvider,
	error,
)

type Options

type Options struct {
	Logger     logger.Logger
	Properties map[string]string

	Region                string `json:"region" mapstructure:"region" mapstructurealiases:"awsRegion"`
	AccessKey             string `json:"accessKey" mapstructure:"accessKey"`
	SecretKey             string `json:"secretKey" mapstructure:"secretKey"`
	SessionToken          string `json:"sessionToken" mapstructure:"sessionToken"`
	AssumeRoleArn         string `json:"assumeRoleArn" mapstructure:"assumeRoleArn"`
	AssumeRoleSessionName string `json:"assumeRoleSessionName" mapstructure:"assumeRoleSessionName"`
	TrustAnchorArn        string `json:"trustAnchorArn" mapstructure:"trustAnchorArn"`
	TrustProfileArn       string `json:"trustProfileArn" mapstructure:"trustProfileArn"`

	Endpoint string `json:"endpoint" mapstructure:"endpoint"`
}

type ProviderType

type ProviderType int
const (
	StaticProviderTypeStatic ProviderType = iota
	StaticProviderTypeAssumeRole
	X509ProviderType
	ProviderTypeUnknown // Or default
)

type Static

type Static struct {
	ProviderType          ProviderType
	Logger                logger.Logger
	AccessKey             string
	SecretKey             string
	SessionToken          string
	Region                string
	Endpoint              string
	AssumeRoleArn         string
	AssumeRoleSessionName string

	CredentialProvider aws.CredentialsProvider
}

func (*Static) Retrieve

func (a *Static) Retrieve(ctx context.Context) (aws.Credentials, error)

func (*Static) Type

func (a *Static) Type() ProviderType

type X509

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

func (*X509) RefreshX509

func (x *X509) RefreshX509(ctx context.Context) error

func (*X509) Retrieve

func (x *X509) Retrieve(ctx context.Context) (aws.Credentials, error)

func (*X509) Type

func (x *X509) Type() ProviderType

Jump to

Keyboard shortcuts

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