alibabacloudconfig

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2025 License: MIT Imports: 9 Imported by: 0

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 AlibabaCloud CLI credentials don't exist.
	ErrCredentialsNotFound = errors.New("AlibabaCloud CLI credentials not found")
)

Functions

This section is empty.

Types

type AliCloudCredentials

type AliCloudCredentials struct {
	AliCloudAccessKey     string `json:"access_key_id"`
	AliCloudSecretKey     string `json:"access_key_secret"`
	AliCloudSessionToken  string `json:"ram_session_name"`
	AliCloudSecurityToken string `json:"sts_token"`
	PrincipalARN          string `json:"ram_role_arn"`
	Region                string `json:"region,omitempty"`
}

AliCloudCredentials represents the set of attributes used to authenticate to AlibabaCloud with a short lived session

type CredentialsProvider

type CredentialsProvider struct {
	Filename string
	Profile  string
}

CredentialsProvider loads AlibabaCloud CLI credentials file

func NewSharedCredentials

func NewSharedCredentials(profile 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

Load load the AlibabaCloud CLI credentials file

func (*CredentialsProvider) Save

func (p *CredentialsProvider) Save(alibabacloudCreds *AliCloudCredentials) error

Save persist the credentials

Jump to

Keyboard shortcuts

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