Documentation
¶
Index ¶
- Constants
- Variables
- func AssumeInlineRole(ctx context.Context, role InlineRole, environ []string) (map[string]string, error)
- func FilesBasePath(manager types.AuthManager, identityName string) string
- func GetSupportedTaskPolicies() []string
- func IsSupportedTaskPolicy(arn string) bool
- func LoadCredentialsFromEnvironment(ctx context.Context, environment map[string]string) (*types.AWSCredentials, error)
- func NewAWSAmbientIdentity(name string, config *schema.Identity) (types.Identity, error)
- func NewAssumeRoleIdentity(name string, config *schema.Identity) (types.Identity, error)
- func NewAssumeRootIdentity(name string, config *schema.Identity) (types.Identity, error)
- func NewCredentialProcessIdentity(name string, config *schema.Identity) (types.Identity, error)
- func NewPermissionSetIdentity(name string, config *schema.Identity) (types.Identity, error)
- func NewSTSClientWithCredentials(ctx context.Context, awsBase *types.AWSCredentials, region string, ...) (*sts.Client, string, error)
- func NewUserIdentity(name string, config *schema.Identity) (types.Identity, error)
- type HTTPClient
- type InlineRole
Constants ¶
const ( FieldAccessKeyID = "access_key_id" FieldSecretAccessKey = "secret_access_key" FieldMfaArn = "mfa_arn" FieldSessionDuration = "session_duration" )
AWS credential field names.
Variables ¶
var GenericPromptCredentialsFunc types.CredentialPromptFunc
GenericPromptCredentialsFunc is the generic credential prompting function. It uses CredentialPromptSpec to determine what fields to collect.
var PromptCredentialsFunc func(identityName string, mfaArn string) (*types.AWSCredentials, error)
PromptCredentialsFunc is the AWS-specific credential prompting function. It wraps the generic function for backward compatibility. When set, it's called when credentials are missing or invalid.
Functions ¶
func AssumeInlineRole ¶
func AssumeInlineRole(ctx context.Context, role InlineRole, environ []string) (map[string]string, error)
AssumeInlineRole assumes the role on top of the AWS credentials found in environ, a list of KEY=VALUE entries in which the last entry of a key wins. The starting credentials come from environ alone, in the order of the SDK default chain: static keys, a web identity token file, the profile and files that environ names, container credentials, then instance metadata. The process environment is neither read nor changed. It returns the environment variables that make the new session the credentials of a child process, and registers the secrets with the output masker.
func FilesBasePath ¶
func FilesBasePath(manager types.AuthManager, identityName string) string
FilesBasePath exposes filesBasePath to AWS identities implemented outside this package, such as native plugin identities and the mock identity, so every AWS identity writes, reports and removes its files under the same base path as its root provider.
func GetSupportedTaskPolicies ¶ added in v1.203.0
func GetSupportedTaskPolicies() []string
GetSupportedTaskPolicies returns the list of supported AWS-managed root task policies.
func IsSupportedTaskPolicy ¶ added in v1.203.0
IsSupportedTaskPolicy checks if a task policy ARN is in the list of known supported policies.
func LoadCredentialsFromEnvironment ¶
func LoadCredentialsFromEnvironment(ctx context.Context, environment map[string]string) (*types.AWSCredentials, error)
LoadCredentialsFromEnvironment reuses Atmos's isolated profile loader for credential materializers.
func NewAWSAmbientIdentity ¶ added in v1.213.0
NewAWSAmbientIdentity creates a new AWS ambient identity.
func NewAssumeRoleIdentity ¶
NewAssumeRoleIdentity creates a new AWS assume role identity.
func NewAssumeRootIdentity ¶ added in v1.203.0
NewAssumeRootIdentity creates a new AWS assume root identity.
func NewCredentialProcessIdentity ¶
NewCredentialProcessIdentity creates a new aws/credential-process identity.
func NewPermissionSetIdentity ¶
NewPermissionSetIdentity creates a new AWS permission set identity.
func NewSTSClientWithCredentials ¶ added in v1.203.0
func NewSTSClientWithCredentials( ctx context.Context, awsBase *types.AWSCredentials, region string, identityConfig *schema.Identity, ) (*sts.Client, string, error)
NewSTSClientWithCredentials creates an STS client using the provided credentials and region. This is a shared helper used by assume-role and assume-root identities.
Types ¶
type HTTPClient ¶ added in v1.215.0
HTTPClient abstracts HTTP requests for token exchange (testability).
type InlineRole ¶
type InlineRole struct {
// Role is the role ARN.
Role string
// SessionName is the STS role session name. It defaults to a generated name.
SessionName string
// Duration is the session length. Zero selects the STS default.
Duration time.Duration
// WebIdentityToken selects AssumeRoleWithWebIdentity, which needs no starting credentials.
WebIdentityToken string
}
InlineRole is an IAM role that a component, rather than the Atmos configuration, asks to assume. It reuses the aws/assume-role identity, so STS calls, endpoints, and error reporting behave the same way.
Source Files
¶
- ambient.go
- assume_role.go
- assume_root.go
- credential_contract.go
- credential_process.go
- credential_prompt.go
- credentials_loader.go
- files_base_path.go
- inline_role.go
- inline_role_credentials.go
- permission_set.go
- permission_set_cache.go
- sts_client.go
- user.go
- user_legacy_keyring.go
- webflow.go
- webflow_browser.go
- webflow_cache.go
- webflow_dpop.go
- webflow_oauth.go
- webflow_token.go
- webflow_ui.go