envsec

package module
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2024 License: Apache-2.0 Imports: 21 Imported by: 3

README

Envsec: Securely store environment variables in your cloud

Envsec is a tool that securely stores environment variables in the cloud of your choice.

Envsec is designed with developer experience in mind and it's meant to be a pleasure to use. It comes with a command line tool that you can start using right away, and an accompanying go library.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FaultyParamError = errors.New("Faulty Parameter")

Functions

This section is empty.

Types

type Config

type Config interface {
	IsEnvStoreConfig() bool
}

type EnvID

type EnvID struct {
	// A string that uniquely identifies the project to which the environment belongs.
	ProjectID string
	// A string that uniquely identifies the organization to which the environment belongs.
	OrgID string
	// A name that uniquely identifies the environment within the project.
	// Usually one of: 'dev', 'prod'.
	EnvName string
}

Uniquely identifies an environment in which we store environment variables.

func NewEnvID

func NewEnvID(projectID string, orgID string, envName string) (EnvID, error)

type EnvVar

type EnvVar struct {
	Name  string
	Value string
}

type JetpackAPIConfig added in v0.0.7

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

func NewJetpackAPIConfig added in v0.0.7

func NewJetpackAPIConfig(token *session.Token) *JetpackAPIConfig

func (*JetpackAPIConfig) IsEnvStoreConfig added in v0.0.7

func (c *JetpackAPIConfig) IsEnvStoreConfig() bool

type JetpackAPIStore added in v0.0.7

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

func (JetpackAPIStore) Delete added in v0.0.7

func (j JetpackAPIStore) Delete(ctx context.Context, envID EnvID, name string) error

func (JetpackAPIStore) DeleteAll added in v0.0.7

func (j JetpackAPIStore) DeleteAll(ctx context.Context, envID EnvID, names []string) error

func (JetpackAPIStore) Get added in v0.0.7

func (j JetpackAPIStore) Get(ctx context.Context, envID EnvID, name string) (string, error)

func (JetpackAPIStore) GetAll added in v0.0.7

func (j JetpackAPIStore) GetAll(ctx context.Context, envID EnvID, names []string) ([]EnvVar, error)

func (JetpackAPIStore) List added in v0.0.7

func (j JetpackAPIStore) List(ctx context.Context, envID EnvID) ([]EnvVar, error)

func (JetpackAPIStore) Set added in v0.0.7

func (j JetpackAPIStore) Set(ctx context.Context, envID EnvID, name string, value string) error

func (JetpackAPIStore) SetAll added in v0.0.7

func (j JetpackAPIStore) SetAll(ctx context.Context, envID EnvID, values map[string]string) error

type SSMConfig

type SSMConfig struct {
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	SessionToken    string
	KmsKeyID        string

	VarPathFn       func(envId EnvID, varName string) string
	PathNamespaceFn func(envId EnvID) string
}

func (*SSMConfig) IsEnvStoreConfig

func (c *SSMConfig) IsEnvStoreConfig() bool

type SSMStore

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

func (*SSMStore) Delete

func (s *SSMStore) Delete(ctx context.Context, envID EnvID, name string) error

func (*SSMStore) DeleteAll

func (s *SSMStore) DeleteAll(ctx context.Context, envID EnvID, names []string) error

func (*SSMStore) Get

func (s *SSMStore) Get(ctx context.Context, envID EnvID, name string) (string, error)

func (*SSMStore) GetAll

func (s *SSMStore) GetAll(ctx context.Context, envID EnvID, names []string) ([]EnvVar, error)

func (*SSMStore) List

func (s *SSMStore) List(ctx context.Context, envID EnvID) ([]EnvVar, error)

func (*SSMStore) Set

func (s *SSMStore) Set(
	ctx context.Context,
	envID EnvID,
	name string,
	value string,
) error

func (*SSMStore) SetAll

func (s *SSMStore) SetAll(ctx context.Context, envID EnvID, values map[string]string) error

type Store

type Store interface {
	// List all environmnent variables and their values associated with the given envId.
	List(ctx context.Context, envID EnvID) ([]EnvVar, error)
	// Set the value of an environment variable.
	Set(ctx context.Context, envID EnvID, name string, value string) error
	// Set the values of multiple environment variables.
	SetAll(ctx context.Context, envID EnvID, values map[string]string) error
	// Get the value of an environment variable.
	Get(ctx context.Context, envID EnvID, name string) (string, error)
	// Get the values of multiple environment variables.
	GetAll(ctx context.Context, envID EnvID, names []string) ([]EnvVar, error)
	// Delete an environment variable.
	Delete(ctx context.Context, envID EnvID, name string) error
	// Delete multiple environment variables.
	DeleteAll(ctx context.Context, envID EnvID, names []string) error
}

func NewStore

func NewStore(ctx context.Context, config Config) (Store, error)

Directories

Path Synopsis
cmd
internal
git
tux
pkg
envsec
package envsec contains library functions for working with envsec.
package envsec contains library functions for working with envsec.

Jump to

Keyboard shortcuts

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