Documentation ¶
Overview ¶
Package aws provides the functionality about AWS.
Index ¶
- Constants
- func AssumeRoleWithSAML(ctx context.Context, durationHours int, roleArn string, principalArn string, ...) (*sts.Credentials, error)
- func CreateSAMLRequest(appIDURI string) (string, error)
- func ExtractRoleArnAndPrincipalArn(samlResponse SAMLResponse, roleName string) (string, string, error)
- func NewAWSClient() awsClientInterface
- func SaveCredentials(profileName string, credentials sts.Credentials) error
- type Assertion
- type Attribute
- type AttributeStatement
- type AttributeValue
- type SAMLResponse
Constants ¶
const (
// EndpointURL receives SAML response.
EndpointURL = "https://signin.aws.amazon.com/saml"
)
Variables ¶
This section is empty.
Functions ¶
func AssumeRoleWithSAML ¶
func AssumeRoleWithSAML(ctx context.Context, durationHours int, roleArn string, principalArn string, base64Response string) (*sts.Credentials, error)
AssumeRoleWithSAML sends a AssumeRoleWithSAML request to AWS and returns credentials
func CreateSAMLRequest ¶
CreateSAMLRequest creates the Base64 encoded SAML authentication request XML compressed by Deflate.
func ExtractRoleArnAndPrincipalArn ¶
func ExtractRoleArnAndPrincipalArn(samlResponse SAMLResponse, roleName string) (string, string, error)
ExtractRoleArnAndPrincipalArn extracts role ARN and principal ARN from SAML response
func NewAWSClient ¶ added in v1.2.7
func NewAWSClient() awsClientInterface
NewAWSClient creates a new AWSClient instance
By default NewSession will only load credentials from the shared credentials file (~/.aws/credentials).
func SaveCredentials ¶
func SaveCredentials(profileName string, credentials sts.Credentials) error
SaveCredentials saves credentials to AWS credentials file.
Types ¶
type Assertion ¶
type Assertion struct {
AttributeStatement AttributeStatement
}
Assertion is an Assertion element of SAML response
type Attribute ¶
type Attribute struct { Name string `xml:",attr"` AttributeValues []AttributeValue `xml:"AttributeValue"` }
Attribute is an Attribute element of SAML response
type AttributeStatement ¶
type AttributeStatement struct {
Attributes []Attribute `xml:"Attribute"`
}
AttributeStatement is an AttributeStatement element of SAML response
type AttributeValue ¶
type AttributeValue struct {
Value string `xml:",innerxml"`
}
AttributeValue is an AttributeValue element of SAML response
type SAMLResponse ¶
type SAMLResponse struct {
Assertion Assertion
}
SAMLResponse is SAML response
func ParseSAMLResponse ¶
func ParseSAMLResponse(base64Response string) (*SAMLResponse, error)
ParseSAMLResponse parses base64 encoded response to SAMLResponse structure