Documentation
¶
Index ¶
Constants ¶
View Source
const ( SourceEnv = "env" SourceKeyring = "keyring" SourceStatic = "static" SourceGoogle = "google" )
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundErr ¶
Types ¶
type Config ¶
type Config []ConfigEntry
type ConfigEntry ¶
type ConfigEntry struct {
// Source is the name of the source used to look up the secret.
Source string `json:"source"`
json.RawMessage
}
ConfigEntry is a single entry in the lookup chain. This form is used when unmarshalling the config.
func (*ConfigEntry) UnmarshalJSON ¶ added in v0.0.7
func (c *ConfigEntry) UnmarshalJSON(data []byte) error
type Env ¶
type Env struct {
// Source is the name of the source used to look up the secret.
// It must be "env".
Source string `json:"source"`
// Name is the name of the environment variable to look up.
Name string `json:"name"`
// Binding binds the value of the environment variable to a well-known name in the helper.
// If not specified, the value is bound to the default secret of the helper.
Binding string `json:"binding,omitempty"`
}
func (*Env) Canonicalize ¶
func (e *Env) Canonicalize()
type Google ¶ added in v0.0.7
type Google struct {
// Source must be "google".
Source string `json:"source"`
// TokenType selects which kind of token to mint: "access" (default) or "id" / "jwt".
TokenType string `json:"token_type,omitempty"`
// Scopes are defined in
// https://developers.google.com/identity/protocols/oauth2/scopes
Scopes []string `json:"scopes,omitempty"`
// Audience is the OIDC target audience.
// It is used when minting an ID token.
Audience string `json:"audience,omitempty"`
// Binding binds the value to a well-known name in the helper.
// If not specified, the value is bound to the default secret of the helper.
Binding string `json:"binding,omitempty"`
}
func (*Google) Canonicalize ¶ added in v0.0.7
func (g *Google) Canonicalize()
type GoogleTokenResponse ¶ added in v0.0.8
type Keyring ¶
type Keyring struct {
// Source is the name of the source used to look up the secret.
// It must be "keyring".
Source string `json:"source"`
// Service is the name of the key to look up in the keyring.
Service string `json:"service"`
// Binding binds the value of the keyring secret to a well-known name in the helper.
// If not specified, the value is bound to the default secret of the helper.
Binding string `json:"binding,omitempty"`
}
func (*Keyring) Canonicalize ¶
func (k *Keyring) Canonicalize()
type LookupChain ¶
type LookupChain struct {
// contains filtered or unexported fields
}
func New ¶
func New(config Config) *LookupChain
func (*LookupChain) Lookup ¶
func (c *LookupChain) Lookup(binding string) (string, error)
Lookup looks up a binding in the chain. It returns the first value found, or an error.
func (*LookupChain) SetupInstructions ¶
func (c *LookupChain) SetupInstructions(binding, meaning string) string
type NotFoundErr ¶
type NotFoundErr struct {
// contains filtered or unexported fields
}
func (*NotFoundErr) Error ¶
func (e *NotFoundErr) Error() string
type Static ¶
type Static struct {
// Source is the name of the source used to look up the secret.
// It must be "static".
Source string `json:"source"`
// Value is the static value to return.
Value string `json:"name"`
// Binding binds the value of the environment variable to a well-known name in the helper.
// If not specified, the value is bound to the default secret of the helper.
Binding string `json:"binding,omitempty"`
}
func (*Static) Canonicalize ¶
func (s *Static) Canonicalize()
Click to show internal directories.
Click to hide internal directories.