Documentation ¶
Overview ¶
Package secrets provides mechanisms for referring to and accessing sensitive information, NOT including cryptographic keys. These can be, for example, passwords, API tokens, or OAuth client secrets.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
An Option configures behaviour of Secret.Fetch().
func GCPOption ¶
func GCPOption(o option.ClientOption) Option
GCPOption returns a Fetch() Option indicating that the secretmanger.Client used to fetch the secret must use the ClientOption.
type Secret ¶
A Secret identifies a secret but doesn't carry the value itself.
func (*Secret) Fetch ¶
Fetch fetches and returns the Secret's payload. It ignores all Options that aren't relevant to s.Source; for example, passing a GCPOption with an environment variable is allowed.
func (*Secret) Set ¶
Set is the inverse of s.String(). Together, these mean that *Secret implements flag.Value, for use with flag.Var().
type Source ¶
type Source string
A Sources defines the source of the secret.
const ( // The Raw Source carries a raw, unprotected "secret"; it MUST NOT be used // for sensitive data, and is exposed to allow raw data when a Secret string // is expected. Raw Source = "not-secret" // The GCP Source fetches secrets from the GCP Secrets Manager. GCP Source = "gcp" // The Environment Source fetches secrets from an environment variable. Environment Source = "env" )