aws

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

Package aws provides the functionality about AWS.

Index

Constants

View Source
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

func CreateSAMLRequest(appIDURI string) (string, error)

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

Jump to

Keyboard shortcuts

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