Documentation ¶
Index ¶
- Constants
- func AssumeRole(roleSessionName string, stsClient STSRoleAssumer, roleArn string) (*types.Credentials, error)
- func AssumeRoleSequence(roleSessionName string, seedClient STSRoleAssumer, roleArnSequence []string, ...) (*types.Credentials, error)
- func AssumeRoleWithJWT(jwt string, roleArn string, stsClient STSRoleWithWebIdentityAssumer) (*types.Credentials, error)
- func GetConsoleURL(signinToken string) (*url.URL, error)
- func StsClientWithProxy(proxyURL string) (*sts.Client, error)
- type AWSCredentialsResponse
- type AWSFederatedSessionData
- type AWSSigninTokenResponse
- type STSClientProviderFunc
- type STSRoleAssumer
- type STSRoleWithWebIdentityAssumer
Constants ¶
View Source
const ( AwsFederatedSigninEndpoint = "https://signin.aws.amazon.com/federation" AwsConsoleURL = "https://console.aws.amazon.com/" DefaultIssuer = "Red Hat SRE" )
Variables ¶
This section is empty.
Functions ¶
func AssumeRole ¶
func AssumeRole(roleSessionName string, stsClient STSRoleAssumer, roleArn string) (*types.Credentials, error)
func AssumeRoleSequence ¶
func AssumeRoleSequence(roleSessionName string, seedClient STSRoleAssumer, roleArnSequence []string, proxyURL string, stsClientProviderFunc STSClientProviderFunc) (*types.Credentials, error)
func AssumeRoleWithJWT ¶
func AssumeRoleWithJWT(jwt string, roleArn string, stsClient STSRoleWithWebIdentityAssumer) (*types.Credentials, error)
Types ¶
type AWSCredentialsResponse ¶
type AWSCredentialsResponse struct { AccessKeyID string `json:"AccessKeyID" yaml:"AccessKeyID"` SecretAccessKey string `json:"SecretAccessKey" yaml:"SecretAccessKey"` SessionToken string `json:"SessionToken" yaml:"SessionToken"` Region string `json:"Region,omitempty" yaml:"Region,omitempty"` Expiration string `json:"Expiration,omitempty" yaml:"Expiration,omitempty"` }
func (AWSCredentialsResponse) EnvFormat ¶
func (r AWSCredentialsResponse) EnvFormat() string
func (AWSCredentialsResponse) RenderOutput ¶
func (r AWSCredentialsResponse) RenderOutput(outputFormat string) (string, error)
type AWSFederatedSessionData ¶ added in v0.1.11
type AWSSigninTokenResponse ¶ added in v0.1.11
type AWSSigninTokenResponse struct {
SigninToken string
}
func GetSigninToken ¶ added in v0.1.11
func GetSigninToken(awsCredentials *types.Credentials) (*AWSSigninTokenResponse, error)
type STSClientProviderFunc ¶
type STSClientProviderFunc func(optFns ...func(*config.LoadOptions) error) (STSRoleAssumer, error)
var DefaultSTSClientProviderFunc STSClientProviderFunc = func(optnFns ...func(options *config.LoadOptions) error) (STSRoleAssumer, error) { cfg, err := config.LoadDefaultConfig(context.TODO(), optnFns...) if err != nil { return nil, fmt.Errorf("failed to load default AWS config: %w", err) } return sts.NewFromConfig(cfg), nil }
type STSRoleAssumer ¶
type STSRoleAssumer interface {
AssumeRole(ctx context.Context, params *sts.AssumeRoleInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleOutput, error)
}
type STSRoleWithWebIdentityAssumer ¶
type STSRoleWithWebIdentityAssumer interface {
AssumeRoleWithWebIdentity(ctx context.Context, params *sts.AssumeRoleWithWebIdentityInput, optFns ...func(*sts.Options)) (*sts.AssumeRoleWithWebIdentityOutput, error)
}
Click to show internal directories.
Click to hide internal directories.