secrets

package
v1.13.9 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JSONFileManager added in v1.13.6

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

JSONFileManager holds a local copy of all secrets (settings & S2S tokens).

func CreateNewJSONFileManager added in v1.13.6

func CreateNewJSONFileManager(path string) (*JSONFileManager, error)

CreateNewJSONFileManager creates a new secret manager hooked up to Viper.

func (JSONFileManager) DoesTokenExist added in v1.13.6

func (s JSONFileManager) DoesTokenExist(reqToken string) bool

DoesTokenExist checks if a token is present in the secret manager.

func (JSONFileManager) GetSetting added in v1.13.6

func (s JSONFileManager) GetSetting(key string) (string, error)

GetSetting gets a setting from the secret manager.

func (*JSONFileManager) SyncSecrets added in v1.13.6

func (s *JSONFileManager) SyncSecrets() error

SyncSecrets syncs all the available tokens from env and saves them to local state.

type LocalSecretManager

type LocalSecretManager struct{}

LocalSecretManager is just a struct.

func CreateNewLocalSecretManager

func CreateNewLocalSecretManager() *LocalSecretManager

CreateNewLocalSecretManager creates a new secret manager hooked up to Viper.

func (LocalSecretManager) DoesTokenExist added in v1.10.0

func (s LocalSecretManager) DoesTokenExist(reqToken string) bool

DoesTokenExist checks if a token is present in the secret manager.

func (LocalSecretManager) GetSetting

func (s LocalSecretManager) GetSetting(key string) (string, error)

GetSetting gets a setting from Viper.

type SecretManager

type SecretManager interface {
	DoesTokenExist(string) bool
	GetSetting(string) (string, error)
}

SecretManager is a interface that describes how we want to use secrets.

type Secrets added in v1.13.6

type Secrets struct {
	Settings map[string]string            `json:"settings"`
	TokenMap map[string]map[string]string `json:"tokens"`
}

Secrets represents the JSON file structure.

Jump to

Keyboard shortcuts

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