secrets

package
v0.3.19 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const AuthenticateGituhubMessage = "User is not authenticated.\nRun 'lekko auth login' to authenticate with GitHub."

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
	GetLekkoRepoPath() string
	HasLekkoRepoPath() bool
	GetGithubToken() string
	GetGithubUser() string
	HasGithubToken() bool
	GetUsername() string
	GetToken() string
	GetGithubOwner() string
	GetGithubRepo() string
}

func NewSecretsOrFail

func NewSecretsOrFail(opts ...Option) ReadSecrets

type WriteSecrets

type WriteSecrets interface {
	ReadSecrets
	SetLekkoUsername(username string)
	SetLekkoToken(token string)
	SetLekkoTeam(team string)
	SetLekkoRepoPath(repoPath string)
	SetGithubToken(token string)
	SetGithubUser(user string)
	SetLekkoAPIKey(apikey string)
	SetGithubOwner(githubOwner string)
	SetGithubRepo(githubRepo 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