Documentation ¶
Index ¶
- Constants
- func GetEnvVars() model.Values
- func NewAutoDetect(opts AutoDetectOptions) model.Loader
- type AutoDetectOptions
- type Callback
- type CallbackFunc
- type File
- type Http
- func (l *Http) Load(ctx context.Context) (model.Values, error)
- func (l *Http) WithCredentials(username string, password string) *Http
- func (l *Http) WithDefaultTLS() *Http
- func (l *Http) WithHeaderItem(key string, value string) *Http
- func (l *Http) WithHeaders(headers map[string]string) *Http
- func (l *Http) WithHost(host string) *Http
- func (l *Http) WithPath(path string) *Http
- func (l *Http) WithQuery(query map[string][]string) *Http
- func (l *Http) WithQueryItem(key string, values []string) *Http
- func (l *Http) WithTLS(tlsConfig *tls.Config) *Http
- func (l *Http) WithURL(rawURL string) *Http
- type Memory
- type TlsEnvVarNames
- type Vault
- func (l *Vault) Load(ctx context.Context) (model.Values, error)
- func (l *Vault) WithAccessToken(token string) *Vault
- func (l *Vault) WithAuth(auth VaultAuthMethod) *Vault
- func (l *Vault) WithDefaultTLS() *Vault
- func (l *Vault) WithHeaderItem(key string, value string) *Vault
- func (l *Vault) WithHeaders(headers map[string]string) *Vault
- func (l *Vault) WithHost(host string) *Vault
- func (l *Vault) WithPath(path string) *Vault
- func (l *Vault) WithTLS(tlsConfig *tls.Config) *Vault
- func (l *Vault) WithURL(rawURL string) *Vault
- type VaultAppRoleAuth
- func (a *VaultAppRoleAuth) WithMountPath(mountPath string) *VaultAppRoleAuth
- func (a *VaultAppRoleAuth) WithRoleId(roleId string) *VaultAppRoleAuth
- func (a *VaultAppRoleAuth) WithSecretId(secretId string) *VaultAppRoleAuth
- func (a *VaultAppRoleAuth) WithSecretUnwrap(unwrap interface{}) *VaultAppRoleAuth
- type VaultAuthMethod
- type VaultAwsAuth
- func (a *VaultAwsAuth) WithIamServerID(id string) *VaultAwsAuth
- func (a *VaultAwsAuth) WithIdentitySignature() *VaultAwsAuth
- func (a *VaultAwsAuth) WithMountPath(mountPath string) *VaultAwsAuth
- func (a *VaultAwsAuth) WithNonce(nonce string) *VaultAwsAuth
- func (a *VaultAwsAuth) WithPKCS7Signature() *VaultAwsAuth
- func (a *VaultAwsAuth) WithRSA2048Signature() *VaultAwsAuth
- func (a *VaultAwsAuth) WithRegion(region string) *VaultAwsAuth
- func (a *VaultAwsAuth) WithRole(role string) *VaultAwsAuth
- func (a *VaultAwsAuth) WithSignature(signature interface{}) *VaultAwsAuth
- func (a *VaultAwsAuth) WithType(_type interface{}) *VaultAwsAuth
- func (a *VaultAwsAuth) WithTypeEC2() *VaultAwsAuth
- func (a *VaultAwsAuth) WithTypeIAM() *VaultAwsAuth
- type VaultAzureAuth
- type VaultGcpAuth
- func (a *VaultGcpAuth) WithIamServiceAccountEmail(email string) *VaultGcpAuth
- func (a *VaultGcpAuth) WithMountPath(mountPath string) *VaultGcpAuth
- func (a *VaultGcpAuth) WithRole(role string) *VaultGcpAuth
- func (a *VaultGcpAuth) WithType(_type interface{}) *VaultGcpAuth
- func (a *VaultGcpAuth) WithTypeGCE() *VaultGcpAuth
- func (a *VaultGcpAuth) WithTypeIAM() *VaultGcpAuth
- type VaultKubernetesAuth
- type VaultLdapAuth
Constants ¶
const ( VaultAwsAuthTypeIAM = iota + 1 VaultAwsAuthTypeEC2 )
const ( VaultAwsAuthSignatureIdentity = iota + 1 VaultAwsAuthSignaturePKCS7 VaultAwsAuthSignatureRSA2048 )
const ( VaultGcpAuthTypeGCE = iota + 1 VaultGcpAuthTypeIAM )
Variables ¶
This section is empty.
Functions ¶
func GetEnvVars ¶ added in v0.2.0
func NewAutoDetect ¶
func NewAutoDetect(opts AutoDetectOptions) model.Loader
NewAutoDetect tries to create a new loader based on the origin type, like a file or Hashicorp Vault
Types ¶
type AutoDetectOptions ¶
type AutoDetectOptions struct { // CmdLine specifies if command line parameters are checked in first place CmdLine struct { Check bool // Long is the long version of the command line parameter. Defaults to --settings Long string // Short is the short version of the command line parameter. Defaults to -S Short string } // EnvVar is the environment variable that contains a file or url of the configuration settings EnvVar string // TlsEnvVar can specify and override where to look for client side certificates TlsEnvVar TlsEnvVarNames }
AutoDetectOptions indicates the behavior of the auto-detect module
type Callback ¶
type Callback struct {
// contains filtered or unexported fields
}
Callback wraps content to be loaded from a callback function
func (*Callback) WithCallback ¶
func (l *Callback) WithCallback(callback CallbackFunc) *Callback
WithCallback sets the callback function
type File ¶
type File struct {
// contains filtered or unexported fields
}
File wraps content to be loaded from a file on disk
func NewFileFromCommandLine ¶
NewFileFromCommandLine create a new file loader from a command line parameter
func NewFileFromEnvironmentVariable ¶
NewFileFromEnvironmentVariable create a new file loader from an environment variable
func (*File) Load ¶
Load loads the content from the file NOTE: We are not making use of the context assuming configuration files will be small and on a local disk
func (*File) WithFilename ¶
WithFilename sets the file name
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
Http wraps content to be loaded from a URL
func (*Http) WithCredentials ¶
WithCredentials sets the username and password
func (*Http) WithDefaultTLS ¶
WithDefaultTLS sets a default tls.Config object
func (*Http) WithHeaderItem ¶
WithHeaderItem sets a single request header
func (*Http) WithHeaders ¶
WithHeaders sets the request headers
func (*Http) WithQueryItem ¶
WithQueryItem sets a single query parameter
type Memory ¶
type Memory struct {
// contains filtered or unexported fields
}
Memory wraps content to be loaded from a string
func NewMemoryFromEnvironmentVariable ¶
NewMemoryFromEnvironmentVariable create a new memory data loader from an environment variable
type TlsEnvVarNames ¶
type TlsEnvVarNames struct { CaCert string // Defaults to SSL_CA_CERT environment variable ClientCert string // Defaults to SSL_CLIENT_CERT environment variable ClientKey string // Defaults to SSL_CLIENT_KEY environment variable }
TlsEnvVarNames establishes environment variables to look for client certificates for http requests
type Vault ¶
type Vault struct {
// contains filtered or unexported fields
}
Vault wraps content to be loaded from a Hashicorp Vault instance
func (*Vault) WithAccessToken ¶
WithAccessToken sets the access token to use as authorization
func (*Vault) WithAuth ¶
func (l *Vault) WithAuth(auth VaultAuthMethod) *Vault
WithAuth sets the authorization method to use
func (*Vault) WithDefaultTLS ¶
WithDefaultTLS sets a default tls.Config object
func (*Vault) WithHeaderItem ¶
WithHeaderItem sets a single request header
func (*Vault) WithHeaders ¶
WithHeaders sets the request headers
type VaultAppRoleAuth ¶
type VaultAppRoleAuth struct {
// contains filtered or unexported fields
}
VaultAppRoleAuth contains the options to access vault with the AppRole authentication mechanism
func NewVaultAppRoleAuthMethod ¶
func NewVaultAppRoleAuthMethod() *VaultAppRoleAuth
NewVaultAppRoleAuthMethod creates a new AppRole authentication method helper
func (*VaultAppRoleAuth) WithMountPath ¶
func (a *VaultAppRoleAuth) WithMountPath(mountPath string) *VaultAppRoleAuth
WithMountPath sets an optional mount path. Defaults to approle
func (*VaultAppRoleAuth) WithRoleId ¶
func (a *VaultAppRoleAuth) WithRoleId(roleId string) *VaultAppRoleAuth
WithRoleId sets the role id
func (*VaultAppRoleAuth) WithSecretId ¶
func (a *VaultAppRoleAuth) WithSecretId(secretId string) *VaultAppRoleAuth
WithSecretId sets the secret id
func (*VaultAppRoleAuth) WithSecretUnwrap ¶
func (a *VaultAppRoleAuth) WithSecretUnwrap(unwrap interface{}) *VaultAppRoleAuth
WithSecretUnwrap specifies if the secret must be unwrapped
type VaultAuthMethod ¶
type VaultAuthMethod interface {
// contains filtered or unexported methods
}
VaultAuthMethod is an interface used to set up an authentication mechanism
type VaultAwsAuth ¶
type VaultAwsAuth struct {
// contains filtered or unexported fields
}
VaultAwsAuth contains the options to access vault with the AWS authentication mechanism
func NewVaultAwsAuthMethod ¶
func NewVaultAwsAuthMethod() *VaultAwsAuth
NewVaultAwsAuthMethod creates a new AWS authentication method helper
func (*VaultAwsAuth) WithIamServerID ¶
func (a *VaultAwsAuth) WithIamServerID(id string) *VaultAwsAuth
WithIamServerID sets the server id header when authenticating as IAM
func (*VaultAwsAuth) WithIdentitySignature ¶
func (a *VaultAwsAuth) WithIdentitySignature() *VaultAwsAuth
WithIdentitySignature tells the client to use the cryptographic identity document signature to verify EC2 auth logins
func (*VaultAwsAuth) WithMountPath ¶
func (a *VaultAwsAuth) WithMountPath(mountPath string) *VaultAwsAuth
WithMountPath sets an optional mount path. Defaults to aws
func (*VaultAwsAuth) WithNonce ¶
func (a *VaultAwsAuth) WithNonce(nonce string) *VaultAwsAuth
WithNonce sets nonce to use. Defaults to generate a random uuid
func (*VaultAwsAuth) WithPKCS7Signature ¶
func (a *VaultAwsAuth) WithPKCS7Signature() *VaultAwsAuth
WithPKCS7Signature tells the client to use the PKCS #7 signature to verify EC2 auth logins
func (*VaultAwsAuth) WithRSA2048Signature ¶
func (a *VaultAwsAuth) WithRSA2048Signature() *VaultAwsAuth
WithRSA2048Signature tells the client to use the RSA 2048 signature to verify EC2 auth logins
func (*VaultAwsAuth) WithRegion ¶
func (a *VaultAwsAuth) WithRegion(region string) *VaultAwsAuth
WithRegion sets the region to use. Defaults to us-east-1
func (*VaultAwsAuth) WithRole ¶
func (a *VaultAwsAuth) WithRole(role string) *VaultAwsAuth
WithRole sets the role
func (*VaultAwsAuth) WithSignature ¶
func (a *VaultAwsAuth) WithSignature(signature interface{}) *VaultAwsAuth
WithSignature tells the client which type of signature to use when verifying EC2 auth logins
func (*VaultAwsAuth) WithType ¶
func (a *VaultAwsAuth) WithType(_type interface{}) *VaultAwsAuth
WithType sets the authentication type IAM or EC2
func (*VaultAwsAuth) WithTypeEC2 ¶
func (a *VaultAwsAuth) WithTypeEC2() *VaultAwsAuth
WithTypeEC2 sets the authentication type as EC2
func (*VaultAwsAuth) WithTypeIAM ¶
func (a *VaultAwsAuth) WithTypeIAM() *VaultAwsAuth
WithTypeIAM sets the authentication type as IAM
type VaultAzureAuth ¶
type VaultAzureAuth struct {
// contains filtered or unexported fields
}
VaultAzureAuth contains the options to access vault with the Azure authentication mechanism
func NewVaultAzureAuthMethod ¶
func NewVaultAzureAuthMethod() *VaultAzureAuth
NewVaultAzureAuthMethod creates a new Azure authentication method helper
func (*VaultAzureAuth) WithMountPath ¶
func (a *VaultAzureAuth) WithMountPath(mountPath string) *VaultAzureAuth
WithMountPath sets an optional mount path. Defaults to azure
func (*VaultAzureAuth) WithResource ¶
func (a *VaultAzureAuth) WithResource(url string) *VaultAzureAuth
WithResource sets an optional different resource URL. Defaults to Azure Public Cloud's ARM URL
func (*VaultAzureAuth) WithRole ¶
func (a *VaultAzureAuth) WithRole(role string) *VaultAzureAuth
WithRole sets the role
type VaultGcpAuth ¶
type VaultGcpAuth struct {
// contains filtered or unexported fields
}
VaultGcpAuth contains the options to access vault with the GCP authentication mechanism
func NewVaultGcpAuthMethod ¶
func NewVaultGcpAuthMethod() *VaultGcpAuth
NewVaultGcpAuthMethod creates a new GCP authentication method helper
func (*VaultGcpAuth) WithIamServiceAccountEmail ¶
func (a *VaultGcpAuth) WithIamServiceAccountEmail(email string) *VaultGcpAuth
WithIamServiceAccountEmail sets the service account email for IAM authentication type
func (*VaultGcpAuth) WithMountPath ¶
func (a *VaultGcpAuth) WithMountPath(mountPath string) *VaultGcpAuth
WithMountPath sets an optional mount path. Defaults to gcp
func (*VaultGcpAuth) WithRole ¶
func (a *VaultGcpAuth) WithRole(role string) *VaultGcpAuth
WithRole sets the role
func (*VaultGcpAuth) WithType ¶
func (a *VaultGcpAuth) WithType(_type interface{}) *VaultGcpAuth
WithType sets the authentication type IAM or EC2
func (*VaultGcpAuth) WithTypeGCE ¶
func (a *VaultGcpAuth) WithTypeGCE() *VaultGcpAuth
WithTypeGCE sets the authentication type as GCE
func (*VaultGcpAuth) WithTypeIAM ¶
func (a *VaultGcpAuth) WithTypeIAM() *VaultGcpAuth
WithTypeIAM sets the authentication type as IAM
type VaultKubernetesAuth ¶
type VaultKubernetesAuth struct {
// contains filtered or unexported fields
}
VaultKubernetesAuth contains the options to access vault with the Kubernetes authentication mechanism
func NewVaultKubernetesAuthMethod ¶
func NewVaultKubernetesAuthMethod() *VaultKubernetesAuth
NewVaultKubernetesAuthMethod creates a new Kubernetes authentication method helper
func (*VaultKubernetesAuth) WithAccountToken ¶
func (a *VaultKubernetesAuth) WithAccountToken(token string) *VaultKubernetesAuth
WithAccountToken sets the account access token
func (*VaultKubernetesAuth) WithMountPath ¶
func (a *VaultKubernetesAuth) WithMountPath(mountPath string) *VaultKubernetesAuth
WithMountPath sets an optional mount path. Defaults to kubernetes
func (*VaultKubernetesAuth) WithRole ¶
func (a *VaultKubernetesAuth) WithRole(role string) *VaultKubernetesAuth
WithRole sets the role
type VaultLdapAuth ¶
type VaultLdapAuth struct {
// contains filtered or unexported fields
}
VaultLdapAuth contains the options to access vault with the LDAP authentication mechanism
func NewVaultLdapAuthMethod ¶
func NewVaultLdapAuthMethod() *VaultLdapAuth
NewVaultLdapAuthMethod creates a new LDAP authentication method helper
func (*VaultLdapAuth) WithMountPath ¶
func (a *VaultLdapAuth) WithMountPath(mountPath string) *VaultLdapAuth
WithMountPath sets an optional mount path. Defaults to ldap
func (*VaultLdapAuth) WithPassword ¶
func (a *VaultLdapAuth) WithPassword(password string) *VaultLdapAuth
WithPassword sets the access password
func (*VaultLdapAuth) WithUsername ¶
func (a *VaultLdapAuth) WithUsername(userName string) *VaultLdapAuth
WithUsername sets the username