secrets

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithWriteSecrets

func WithWriteSecrets(f func(WriteSecrets) error, opts ...Option) error

Types

type Option

type Option interface {
	// contains filtered or unexported methods
}

Options to specify when reading secrets.

func RequireGithub

func RequireGithub() Option

Assert that secrets contain all Github credentials

func RequireGithubToken

func RequireGithubToken() Option

Assert that secrets contain a github token

func RequireLekko

func RequireLekko() Option

Assert that secrets contain all Lekko credentials

func RequireLekkoTeam

func RequireLekkoTeam() Option

Assert that secrets contain a lekko team

func RequireLekkoToken

func RequireLekkoToken() Option

Assert that secrets contain a lekko token

type ReadSecrets

type ReadSecrets interface {
	GetLekkoUsername() string
	GetLekkoToken() string
	HasLekkoToken() bool
	GetLekkoTeam() string
	HasLekkoAPIKey() bool
	GetLekkoAPIKey() string
	GetGithubToken() string
	GetGithubUser() string
	HasGithubToken() bool
	GetUsername() string
	GetToken() string
}

func NewSecretsFromEnv added in v0.3.26

func NewSecretsFromEnv() ReadSecrets

func NewSecretsOrFail

func NewSecretsOrFail(opts ...Option) ReadSecrets

type WriteSecrets

type WriteSecrets interface {
	ReadSecrets
	SetLekkoUsername(username string)
	SetLekkoToken(token string)
	SetLekkoTeam(team string)
	SetGithubToken(token string)
	SetGithubUser(user string)
	SetLekkoAPIKey(apikey string)
}

WriteSecrets holds all the user-specific information that needs to exist for the cli to work, but should not live in a shared config repo. For instance, it holds the github auth token. The secrets are backed by the filesystem under the user's home directory, so these secrets don't need to be fetched as part of every cli command.

Jump to

Keyboard shortcuts

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