credmgrs

package
Version: v0.0.0-...-d259b69 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2021 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotAuthorized = errors.New("not authorized")
	ErrNotFound      = errors.New("not found")
)

Functions

func AsmSecretPath

func AsmSecretPath(identity DBKey) string

Types

type CredentialManager

type CredentialManager interface {
	// Name should provide a loggable and error-returnable identifying
	// name for the credential manager.
	Name() string

	// Password should retrieve the password for a given identity.
	// If the identity is not found, an error should be returned.
	// IMPORTANT: While the identity given for the password should
	// be trusted, we should not assume the identity should have
	// access to the database they're requesting it for. It's the
	// responsibility of the Password call to ensure that the given
	// IAM ARN _should_ have access to the given DB.
	Password(reqLogger *log.Entry, identity DBKey) (string, error)
}

func RetrieveConfigured

func RetrieveConfigured(logger *log.Logger, config config.Config) (CredentialManager, error)

RetrieveConfigured checks the environment for configured cred providers, and selects the first working configuration.

type DBKey

type DBKey struct {
	IAMArn string
	DBHost string
	DBPort string
	DBUser string
}

Jump to

Keyboard shortcuts

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