secretfacade

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const FileSystem string = "filesystem"
View Source
const Kubernetes string = "kubernetes"

Variables

This section is empty.

Functions

func SortSecretsInSchemaOrder added in v0.0.73

func SortSecretsInSchemaOrder(resources []*SecretPair)

SortSecretsInSchemaOrder sorts the secrets in schema order with the entry with a schema with the most properties being first

func SortSecretsInSchemaTemplateOrder added in v0.0.192

func SortSecretsInSchemaTemplateOrder(resources []*SecretPair)

SortSecretsInSchemaTemplateOrder sorts the secrets in schema order with the entry without template functions being first

Types

type EntryError

type EntryError struct {
	// Key the secret key
	Key string

	// Properties property names for the key
	Properties []string
}

EntryError represents the missing entries

type ExternalSecretLocation added in v0.0.202

type ExternalSecretLocation string

type Options

type Options struct {
	Dir                       string
	Namespace                 string
	SecretNamespace           string
	Filter                    string
	SecretClient              extsecrets.Interface
	KubeClient                kubernetes.Interface
	Source                    string
	SecretStoreManagerFactory secretstore.FactoryInterface

	// ExternalSecrets the loaded secrets
	ExternalSecrets []*v1.ExternalSecret

	// EditorCache the optional cache of editors
	EditorCache map[string]editor.Interface
}

Options options for verifying secrets

func (*Options) AddFlags added in v0.0.194

func (o *Options) AddFlags(cmd *cobra.Command)

func (*Options) ExternalSecretByName added in v0.1.0

func (o *Options) ExternalSecretByName(secretName string) (*v1.ExternalSecret, error)

func (*Options) Load

func (o *Options) Load() ([]*SecretPair, error)

Load loads the secret pairs

func (*Options) Validate added in v0.0.202

func (o *Options) Validate() error

func (*Options) Verify

func (o *Options) Verify() ([]*SecretPair, error)

Verify loads the secrets and verifies which are valid to aid the edit/populate operations

func (*Options) VerifyAndFilter added in v0.0.71

func (o *Options) VerifyAndFilter() ([]*SecretPair, error)

VerifyAndFilter loads the secrets and verifies which are valid to aid the edit/populate operations then filters out any duplicate entries which are using the same underlying secret mappings.

e.g. if 2 secrets are populated to the same actual location then we can omit one of them since there's no need to write to the same location twice.

We prefer the secrets which have schemas associated and that have the most entries.

type SchemaOrder added in v0.0.73

type SchemaOrder []*SecretPair

func (SchemaOrder) Len added in v0.0.73

func (a SchemaOrder) Len() int

func (SchemaOrder) Less added in v0.0.73

func (a SchemaOrder) Less(i, j int) bool

func (SchemaOrder) Swap added in v0.0.73

func (a SchemaOrder) Swap(i, j int)

type SchemaTemplateOrder added in v0.0.192

type SchemaTemplateOrder []*SecretPair

func (SchemaTemplateOrder) Len added in v0.0.192

func (a SchemaTemplateOrder) Len() int

func (SchemaTemplateOrder) Less added in v0.0.192

func (a SchemaTemplateOrder) Less(i, j int) bool

func (SchemaTemplateOrder) Swap added in v0.0.192

func (a SchemaTemplateOrder) Swap(i, j int)

type SecretError

type SecretError struct {
	// ExternalSecret the external secret which is not valid
	ExternalSecret v1.ExternalSecret

	// EntryErrors the errors for each secret entry
	EntryErrors []*EntryError
}

SecretError returns an error for a secret

func VerifySecret

func VerifySecret(es *v1.ExternalSecret, secret *corev1.Secret) (*SecretError, error)

VerifySecret verifies the secret

type SecretPair

type SecretPair struct {
	// ExternalSecret the external secret which is not valid
	ExternalSecret v1.ExternalSecret

	// Secret the secret if there is one
	Secret *corev1.Secret

	// Error last validation error at last check
	Error *SecretError
	// contains filtered or unexported fields
}

SecretPair the external secret and the associated Secret an error for a secret

func (*SecretPair) IsInvalid added in v0.0.61

func (p *SecretPair) IsInvalid() bool

IsInvalid returns true if the validation failed

func (*SecretPair) IsMandatory added in v0.0.61

func (p *SecretPair) IsMandatory() bool

IsMandatory returns true if the secret is a mandatory secret

func (*SecretPair) Key added in v0.0.73

func (p *SecretPair) Key() string

Key returns the unique key of the secret

func (*SecretPair) Name added in v0.0.73

func (p *SecretPair) Name() string

Name returns the name of the secret

func (*SecretPair) Namespace added in v0.0.73

func (p *SecretPair) Namespace() string

Namespace returns the namespace of the secret

func (*SecretPair) SchemaObject added in v0.0.69

func (p *SecretPair) SchemaObject() (*schema.Object, error)

SchemaObject returns the optional schema object from the annotation

func (*SecretPair) SetSchemaObject added in v0.0.73

func (p *SecretPair) SetSchemaObject(schemaObject *schema.Object)

SetSchemaObject sets the cached schema object: typically used for testing

Jump to

Keyboard shortcuts

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