Documentation ¶
Index ¶
Constants ¶
View Source
const ( EnvVarAccessKeyID = "ALICLOUD_ACCESS_KEY" EnvVarAccessKeySecret = "ALICLOUD_SECRET_KEY" EnvVarAccessKeyStsToken = "ALICLOUD_ACCESS_KEY_STS_TOKEN" EnvVarRoleArn = "ALICLOUD_ROLE_ARN" EnvVarRoleSessionName = "ALICLOUD_ROLE_SESSION_NAME" EnvVarRoleSessionExpiration = "ALICLOUD_ROLE_SESSION_EXPIRATION" EnvVarPrivateKey = "ALICLOUD_PRIVATE_KEY" EnvVarPublicKeyID = "ALICLOUD_PUBLIC_KEY_ID" EnvVarSessionExpiration = "ALICLOUD_SESSION_EXPIRATION" EnvVarRoleName = "ALICLOUD_ROLE_NAME" )
Variables ¶
View Source
var (
ErrNoValidCredentialsFound = errors.New("no valid credentials were found")
)
Functions ¶
This section is empty.
Types ¶
type ChainProvider ¶
type ChainProvider struct {
Providers []Provider
}
func (*ChainProvider) Retrieve ¶
func (p *ChainProvider) Retrieve() (auth.Credential, error)
type Configuration ¶
type ConfigurationProvider ¶
type ConfigurationProvider struct {
Configuration *Configuration
}
func (*ConfigurationProvider) Retrieve ¶
func (p *ConfigurationProvider) Retrieve() (auth.Credential, error)
Retrieve walks through all currently supported credential types and attempts to build them using the given configuration.
type EnvProvider ¶
type EnvProvider struct{}
func (*EnvProvider) Retrieve ¶
func (p *EnvProvider) Retrieve() (auth.Credential, error)
type InstanceMetadataProvider ¶
type InstanceMetadataProvider struct {
RoleName string
}
func (*InstanceMetadataProvider) GetRoleName ¶
func (p *InstanceMetadataProvider) GetRoleName() (roleName string, err error)
func (*InstanceMetadataProvider) Retrieve ¶
func (p *InstanceMetadataProvider) Retrieve() (auth.Credential, error)
type Provider ¶
type Provider interface {
Retrieve() (auth.Credential, error)
}
func NewChainProvider ¶
NewChainProvider will attempt to use its given providers in the order in which they're provided. It will return credentials for the first provider that doesn't return an error.
func NewConfigurationCredentialProvider ¶
func NewConfigurationCredentialProvider(configuration *Configuration) Provider
func NewEnvCredentialProvider ¶
func NewEnvCredentialProvider() Provider
func NewInstanceMetadataProvider ¶
func NewInstanceMetadataProvider() Provider
Click to show internal directories.
Click to hide internal directories.