vault

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatKeyForDisplay

func FormatKeyForDisplay(k string) string

Types

type AssumeRoleProvider

type AssumeRoleProvider struct {
	// contains filtered or unexported fields
}

func (AssumeRoleProvider) Retrieve

func (p AssumeRoleProvider) Retrieve() (*TempCredentials, error)

type Config

type Config struct {
	// ProfileName specifies the name of the profile config
	ProfileName string

	// Region is the Alicloud region
	Region string

	// AssumeRole config
	RoleARN         string
	RoleSessionName string

	// Specifies the wanted duration for credentials generated with AssumeRole
	AssumeRoleDuration int
}

Config is a collection of configuration options for creating temporary credentials

type ConfigLoader

type ConfigLoader struct {
	BaseConfig   Config
	AliyunConfig config.Configuration
}

func (*ConfigLoader) AddNewProfile added in v1.0.1

func (cl *ConfigLoader) AddNewProfile(name string) error

func (*ConfigLoader) DeleteProfile added in v1.0.2

func (cl *ConfigLoader) DeleteProfile(profileName string) error

func (*ConfigLoader) GetProfileNames

func (cl *ConfigLoader) GetProfileNames() []string

func (*ConfigLoader) Init added in v1.0.1

func (cl *ConfigLoader) Init() error

func (*ConfigLoader) LoadProfile

func (cl *ConfigLoader) LoadProfile(profileName string) (*Config, error)

Init loads the profile from the config file and environment variables into config

type CredentialKeyring

type CredentialKeyring struct {
	Keyring keyring.Keyring
}

func (*CredentialKeyring) CredentialsKeys

func (ck *CredentialKeyring) CredentialsKeys() (credentialsNames []string, err error)

func (*CredentialKeyring) Get

func (ck *CredentialKeyring) Get(credentialsName string) (creds *Credentials, err error)

func (*CredentialKeyring) Has

func (ck *CredentialKeyring) Has(credentialsName string) (bool, error)

func (*CredentialKeyring) Remove

func (ck *CredentialKeyring) Remove(credentialsName string) error

func (*CredentialKeyring) Set

func (ck *CredentialKeyring) Set(credentialsName string, creds *Credentials) error

type Credentials

type Credentials struct {
	AccessKeyID     string
	SecretAccessKey string
	Created         string
}

func NewCredentials

func NewCredentials(accessKeyID, secretAccessKey string) *Credentials

type LongtermCredsProvider added in v1.1.0

type LongtermCredsProvider struct {
	// contains filtered or unexported fields
}

func (LongtermCredsProvider) Retrieve added in v1.1.0

func (p LongtermCredsProvider) Retrieve() (*TempCredentials, error)

type TempCredentials

type TempCredentials struct {
	Creds    *Credentials
	StsToken string
	Duration string
}

func GenerateTempCredentials

func GenerateTempCredentials(config *Config, k *CredentialKeyring) (*TempCredentials, error)

func NewTempCredentials

func NewTempCredentials(creds *Credentials, stsToken string, duration string) *TempCredentials

Jump to

Keyboard shortcuts

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