vault

package
v1.0.10107-047e331 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package vault provides a Kong CLI Resolver that will provide default flag values from Vault

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	DisableTLS bool
	Host       string
	Port       int
	SecretName string
	Token      secret.String
}

type Resolver

type Resolver struct {
	// contains filtered or unexported fields
}

Resolver is Kong resolver that can collect default flag values from Vault.

func New

func New(ctx context.Context, cfg Config) (*Resolver, error)

New creates a new resolver, authenticating with the optional passed in token (used for local testing). If token is empty then K8s service account auth is attempted.

func (*Resolver) Resolve

func (r *Resolver) Resolve(_ *kong.Context, _ *kong.Path, flag *kong.Flag) (interface{}, error)

Resolve resolves default values for any flag that has an env set. The hierarchy of commands is ignored, expecting that the env var was named uniquely in the config. Only one env is supported per flag

func (*Resolver) Validate

func (r *Resolver) Validate(_ *kong.Application) error

Jump to

Keyboard shortcuts

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