Documentation
¶
Index ¶
- Constants
- func AWSConfigPath() string
- func AWSCredPath() string
- func ConfigDirRoot() string
- func ConfigEntry(name string) string
- func DeleteBrowserCache() error
- func GetAttributeValuesFromAssertion(assertion, attributeName string) ([]string, error)
- func IsValidSamlAssertion(assertion string) bool
- type AWS
- type AWSConfig
- type AWSConfig_GoogleConfig
- type AWSCredentials
- type AssumeRoleOptions
- type LoginOptions
- type Role
- type SessionStatus
Constants ¶
View Source
const ( XmlAttrGetRole = "https://aws.amazon.com/SAML/Attributes/Role" XmlAttrGetRoleSessionName = "https://aws.amazon.com/SAML/Attributes/RoleSessionName" XmlAttrGetSessionDuration = "https://aws.amazon.com/SAML/Attributes/SessionDuration" )
View Source
const ( ReadOnlyAccessPolicyArn = "arn:aws:iam::aws:policy/ReadOnlyAccess" BillingReadOnlyAccessPolicyArn = "arn:aws:iam::aws:policy/AWSBillingReadOnlyAccess" )
Variables ¶
This section is empty.
Functions ¶
func AWSConfigPath ¶
func AWSConfigPath() string
func AWSCredPath ¶
func AWSCredPath() string
func ConfigDirRoot ¶
func ConfigDirRoot() string
func ConfigEntry ¶
func DeleteBrowserCache ¶
func DeleteBrowserCache() error
func GetAttributeValuesFromAssertion ¶
GetAttributeValuesFromAssertion parse SAML Assertion in form of XML document to return a list of attribute values from attribute name
func IsValidSamlAssertion ¶
Types ¶
type AWS ¶
func (*AWS) AssumeRole ¶
func (amz *AWS) AssumeRole(ctx context.Context, role *Role, opts *AssumeRoleOptions) (*types.Credentials, error)
AssumeRole is going to call sts.AssumeRoleWithSAMLInput to assume to a specific role. If opts is nil, default options are used.
func (*AWS) ParseRoles ¶
type AWSConfig ¶
type AWSConfig struct {
Profile string
Region string
Google AWSConfig_GoogleConfig
}
AWSConfig reflects values in the AWS CLI config file (mainly as `~/.aws/config`)
func LoadConfig ¶
type AWSConfig_GoogleConfig ¶
type AWSCredentials ¶
type AWSCredentials struct {
Profile string
*types.Credentials
}
AWSCredentials reflects values in the AWS CLI credentials file (mainly as `~/.aws/credentials`)
func (*AWSCredentials) SaveTo ¶
func (cred *AWSCredentials) SaveTo(path string) error
type AssumeRoleOptions ¶ added in v1.2.0
type AssumeRoleOptions struct {
// ReadOnly restricts the session to read-only permissions when true.
ReadOnly bool
// BillingReadOnly restricts the session to billing read-only permissions when true.
BillingReadOnly bool
}
AssumeRoleOptions configures how a role is assumed.
type LoginOptions ¶
type Role ¶
type SessionStatus ¶ added in v1.2.0
type SessionStatus struct {
Profile string
Expiration time.Time
IsValid bool
TimeLeft time.Duration
}
SessionStatus represents the status of an AWS session
func LoadSessionStatus ¶ added in v1.2.0
func LoadSessionStatus(path, profile string) (*SessionStatus, error)
LoadSessionStatus loads the session status for a given profile from the credentials file
Click to show internal directories.
Click to hide internal directories.