secrets

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout        = 30 * time.Second
	DefaultPageSize       = 100
	AnnotationContentType = "content_type"
)
View Source
const (
	PEMFile         = "application/x-pem-file"
	X509Certificate = "application/x-x509-user-cert"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type GCP

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

func NewGCP

func NewGCP() (sm *GCP, err error)

func (*GCP) Close

func (g *GCP) Close() error

func (*GCP) CreateSecret

func (g *GCP) CreateSecret(ctx context.Context, secret *Secret) (err error)

func (*GCP) DeleteSecret

func (g *GCP) DeleteSecret(ctx context.Context, secret *Secret) (err error)

func (*GCP) ListSecrets

func (g *GCP) ListSecrets(ctx context.Context, namespace string) (Iterator, error)

func (*GCP) RetrieveSecret

func (g *GCP) RetrieveSecret(ctx context.Context, secret *Secret) (err error)

func (*GCP) SecretName

func (g *GCP) SecretName(secret *Secret) string

func (*GCP) SecretParent

func (g *GCP) SecretParent(secret *Secret) string

type GoogleSecretIterator

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

func (*GoogleSecretIterator) Close

func (i *GoogleSecretIterator) Close() error

func (*GoogleSecretIterator) Err

func (i *GoogleSecretIterator) Err() error

func (*GoogleSecretIterator) Next

func (i *GoogleSecretIterator) Next() bool

func (*GoogleSecretIterator) Secret

func (i *GoogleSecretIterator) Secret() *Secret

type Iterator

type Iterator interface {
	io.Closer
	Next() bool
	Err() error
	Secret() *Secret
}

Iterator allows listing secrets from the key management store or database.

type NamespaceFactory

type NamespaceFactory func(name, contentType string, data []byte) *Secret

func WithNamespace

func WithNamespace(namespace string) NamespaceFactory

type Secret

type Secret struct {
	Namespace   string    `json:"namespace,omitempty"`
	Name        string    `json:"name"`
	ContentType string    `json:"content_type"`
	Data        []byte    `json:"data"`
	Created     time.Time `json:"created,omitempty"`
}

Secret represents a generic blob of data that can be stored in a secrets manager such as Hashicorp Vault or Google Secret Manager. The name and optional namespace are used to uniquely identify the secret and the content type is used to parse the secret data blob.

Jump to

Keyboard shortcuts

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