keymanager

package
v0.0.0-...-3ac0d25 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Path        string
	ServiceName string
	Account     string
	Label       string
	Description string
}

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns default configuration for keychain

type Credential

type Credential struct {
	Credentials      credentials.Value
	AccessKeyID      string `json:"AccessKeyID"`
	SecretAccessKey  string `json:"SecretAccessKey"`
	SessionToken     string `json:"SessionToken"`
	Label            string `json:"label"`
	CreatedTime      time.Time
	ModificationTime time.Time
}

type KeyChain

type KeyChain struct {
	Config
}

func NewKeyChain

func NewKeyChain() (*KeyChain, error)

NewKeyChain creates a keychain

func (*KeyChain) Add

func (k *KeyChain) Add() error

Add adds credentials to keychain

func (*KeyChain) Generate

func (k *KeyChain) Generate(profile string, config *schema.Config) (*credentials.Credentials, error)

Generate creates new executable credentials

func (*KeyChain) GetCredentialsFromPrompt

func (k *KeyChain) GetCredentialsFromPrompt() (*credentials.Value, error)

GetCredentialsFromPrompt gets credentials from command line

func (*KeyChain) Status

func (k *KeyChain) Status(out io.Writer) error

Status shows the current status of keychain list

type KeyManager

type KeyManager interface {
	Generate(string, *schema.Config) (*credentials.Credentials, error)
	Status(io.Writer) error
	Add() error
}

func GenerateKeyManager

func GenerateKeyManager(keyType string) (KeyManager, error)

GenerateKeyManager returns key manager according to key type

Jump to

Keyboard shortcuts

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