providers

package
v1.62.464 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 35

Documentation

Overview

Package providers Deprecated

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 Configuration struct {
	AccessKeyID           string
	AccessKeySecret       string
	AccessKeyStsToken     string
	RoleArn               string
	RoleSessionName       string
	RoleSessionExpiration *int
	PrivateKey            string
	PublicKeyID           string
	SessionExpiration     *int
	RoleName              string
}

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

func NewChainProvider(providers []Provider) Provider

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

Jump to

Keyboard shortcuts

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