credential

package
v0.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ATTRIBUTE_PASSWORD = "password"
View Source
const ATTRIBUTE_USERNAME = "username"
View Source
const ERR_ATTRIBUTE_NOT_EXIST = "sorry that attribute hasn't been set on this credential"
View Source
const ERR_FACTORY_MUST_BE_INITIALIZED = "sorry the factory must be created correctly before proceeding"
View Source
const ERR_FACTORY_PRIVATE_ATTEMPT_DEPLOY = "you have attempted to deploy environment variables but your factory is private"
View Source
const ERR_KEY_MUST_MATCH_REGEX = "sorry the key must only include numbers, letters and underscores [0-9A-Za-z_]"
View Source
const ERR_USERNAME_OR_PASSWORD_NOT_SET = "sorry you must set a username or password"
View Source
const REGEX_KEY_NAME = "(?m)^[0-9A-Za-z_]+$"
View Source
const TEST_VAR_ALTERNATE_PASSWORD_ENV_LABEL = "PASSWORD"
View Source
const TEST_VAR_ALTERNATE_USERNAME_ENV_LABEL = "USERNAME"
View Source
const TEST_VAR_APPLICATION_NAME = "my_test_credential_application"
View Source
const TEST_VAR_ATTRIBUTE_NAME = "a_test_attribute"
View Source
const TEST_VAR_ATTRIBUTE_VALUE = "a test attribute value"
View Source
const TEST_VAR_BAD_ATTRIBUTE_NAME = "a_ /test_attribute"
View Source
const TEST_VAR_PASSWORD = "as=/sle\\sowkjg@!"
View Source
const TEST_VAR_PASSWORD_ENV_LABEL = "PASSWORD"
View Source
const TEST_VAR_USERNAME = "a_test_username"
View Source
const TEST_VAR_USERNAME_ENV_LABEL = "USERNAME"

Variables

This section is empty.

Functions

This section is empty.

Types

type Credential

type Credential struct {
	Username    string            `json:"username"`
	Password    string            `json:"password"`
	Initialized bool              `json:"initialized"`
	Attributes  map[string]string `json:"attributes"`
	Factory     *factory.Factory
	// contains filtered or unexported fields
}

func Load

func Load(sourceFactory *factory.Factory) (*Credential, error)

func New

func New(credentialFactory *factory.Factory, username string, password string) (*Credential, error)

func (*Credential) DeployEnv

func (credential *Credential) DeployEnv() error

func (*Credential) GetAttribute

func (credential *Credential) GetAttribute(key string) (string, error)

func (*Credential) Save

func (credential *Credential) Save() error

func (*Credential) SetAttribute

func (credential *Credential) SetAttribute(key string, value string) error

Jump to

Keyboard shortcuts

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