Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrCredentialsHomeNotFound returned when a user home directory can't be located. ErrCredentialsHomeNotFound = errors.New("user home directory not found") // ErrCredentialsNotFound returned when the required aws credentials don't exist. ErrCredentialsNotFound = errors.New("aws credentials not found") )
Functions ¶
This section is empty.
Types ¶
type AWSCredentials ¶
type AWSCredentials struct { AWSAccessKey string `ini:"aws_access_key_id"` AWSSecretKey string `ini:"aws_secret_access_key"` AWSSessionToken string `ini:"aws_session_token"` AWSSecurityToken string `ini:"aws_security_token"` PrincipalARN string `ini:"x_principal_arn"` Expires time.Time `ini:"x_security_token_expires"` Region string `ini:"region,omitempty"` }
AWSCredentials represents the set of attributes used to authenticate to AWS with a short lived session
type CredentialsProvider ¶
CredentialsProvider loads aws credentials file
func NewSharedCredentials ¶
func NewSharedCredentials(profile string, filename string) *CredentialsProvider
NewSharedCredentials helper to create the credentials provider
func (*CredentialsProvider) CredsExists ¶
func (p *CredentialsProvider) CredsExists() (bool, error)
CredsExists verify that the credentials exist
func (*CredentialsProvider) Expired ¶
func (p *CredentialsProvider) Expired() bool
Expired checks if the current credentials are expired
func (*CredentialsProvider) Load ¶
func (p *CredentialsProvider) Load() (*AWSCredentials, error)
Load load the aws credentials file
func (*CredentialsProvider) Save ¶
func (p *CredentialsProvider) Save(awsCreds *AWSCredentials) error
Save persist the credentials
Click to show internal directories.
Click to hide internal directories.