aws

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: May 11, 2021 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	XML_QUERY_ROLES   = "/samlp:Response/saml:Assertion/saml:AttributeStatement/saml:Attribute/saml:AttributeValue"
	XML_QUERY_EXPIRES = "/samlp:Response/saml:Assertion/saml:Conditions/@NotOnOrAfter"
)

Variables

This section is empty.

Functions

func GetExpireTime

func GetExpireTime(assertion string) (*time.Time, error)

When does this SAML expire?

func GetRolePrincipalARN

func GetRolePrincipalARN(assertion string, role string) (string, error)

get the ARN of the provided role ARN from the saml assertion

func GetRoles

func GetRoles(assertion string) ([]string, error)

get list of role ARNs in a SAML Assertion

Types

type STSSession

type STSSession struct {
	RoleARN         string    `json:"ROLE_ARN"`
	AccessKeyID     string    `json:"AWS_ACCESS_KEY_ID"`
	SecretAccessKey string    `json:"AWS_SECRET_ACCESS_KEY"`
	SessionToken    string    `json:"AWS_SESSION_TOKEN"`
	Expiration      time.Time `json:"AWS_SESSION_EXPIRATION"`
	Provider        string    `json:"STS_PROVIDER"`
	Issuer          string    `json:"STS_ISSUER"`
	Region          string    `json:"-"`
}

func GetSTSSession

func GetSTSSession(assertion string, role string, region string, duration int64) (STSSession, error)

func (*STSSession) Expired

func (s *STSSession) Expired() bool

func (*STSSession) GetExpireTimeString

func (s *STSSession) GetExpireTimeString() string

Jump to

Keyboard shortcuts

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