hashicorp

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VaultAddrViperKey = "vault.addr"
)
View Source
const (
	VaultAuthGithubTokenViperKey = "vault.auth.github-token"
)
View Source
const (
	VaultTokenViperKey = "vault.token"
)

Variables

This section is empty.

Functions

func VaultAddress

func VaultAddress(v *viper.Viper, f *pflag.FlagSet)

func VaultAuthGitHubToken

func VaultAuthGitHubToken(v *viper.Viper, f *pflag.FlagSet)

func VaultFlags

func VaultFlags(v *viper.Viper, f *pflag.FlagSet)

func VaultMount

func VaultMount(v *viper.Viper, f *pflag.FlagSet)

func VaultTLSCA

func VaultTLSCA(v *viper.Viper, f *pflag.FlagSet)

func VaultTLSCert

func VaultTLSCert(v *viper.Viper, f *pflag.FlagSet)

func VaultTLSKey

func VaultTLSKey(v *viper.Viper, f *pflag.FlagSet)

func VaultTLSSkipVerify

func VaultTLSSkipVerify(v *viper.Viper, f *pflag.FlagSet)

func VaultToken

func VaultToken(v *viper.Viper, f *pflag.FlagSet)

Types

type AuthConfig

type AuthConfig struct {
	Token       string
	GitHubToken string
}

type ClientConfig

type ClientConfig struct {
	Address string
	Path    string

	AgentAddress string

	Auth *AuthConfig

	HTTP *kilnhttp.ClientConfig

	MinRetryWait *kilntypes.Duration
	MaxRetryWait *kilntypes.Duration
	MaxRetries   *int

	RateLimit *RateLimitConfig
}

ClientConfig object that be converted into an api.Config later

func NewClientConfigFromViper

func NewClientConfigFromViper(v *viper.Viper) *ClientConfig

func (*ClientConfig) SetDefault

func (cfg *ClientConfig) SetDefault() *ClientConfig

func (*ClientConfig) ToHashicorpConfig

func (cfg *ClientConfig) ToHashicorpConfig() (*api.Config, error)

type KVv2Client

type KVv2Client struct {
	*api.Client
	// contains filtered or unexported fields
}

func NewKVv2Client

func NewKVv2Client(cfg *ClientConfig) (*KVv2Client, error)

func (*KVv2Client) Delete

func (c *KVv2Client) Delete(ctx context.Context, id string) error

func (*KVv2Client) Get

func (c *KVv2Client) Get(ctx context.Context, pth, version string) (secret *api.Secret, data, metadata map[string]interface{}, err error)

func (*KVv2Client) GithubLogin

func (c *KVv2Client) GithubLogin(ctx context.Context) (*api.SecretAuth, error)

func (*KVv2Client) HealthCheck

func (c *KVv2Client) HealthCheck(ctx context.Context) error

func (*KVv2Client) Init

func (c *KVv2Client) Init(ctx context.Context) error

func (*KVv2Client) IsKVv2

func (c *KVv2Client) IsKVv2(ctx context.Context, pth string) (mount string, isKVv2 bool, err error)

func (*KVv2Client) List

func (c *KVv2Client) List(ctx context.Context, pth string) ([]string, error)

func (*KVv2Client) Logger

func (c *KVv2Client) Logger() logrus.FieldLogger

func (*KVv2Client) LookupToken

func (c *KVv2Client) LookupToken(ctx context.Context, token string) (*api.Secret, error)

func (*KVv2Client) Put

func (c *KVv2Client) Put(ctx context.Context, id string, data map[string]interface{}) (*api.Secret, error)

func (*KVv2Client) SetLogger

func (c *KVv2Client) SetLogger(logger logrus.FieldLogger)

func (*KVv2Client) SetToken

func (c *KVv2Client) SetToken(token string)

func (*KVv2Client) UnwrapToken

func (c *KVv2Client) UnwrapToken(ctx context.Context, token string) (*api.Secret, error)

type RateLimitConfig

type RateLimitConfig struct {
	Rate  float64
	Burst int
}

Jump to

Keyboard shortcuts

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