connection

package
v0.19.2 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2023 License: Apache-2.0 Imports: 12 Imported by: 211

Documentation

Overview

Package connection provides utilities for working with connection details.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SecretToDeleteMustBeOwnedBy

func SecretToDeleteMustBeOwnedBy(so metav1.Object) store.DeleteOption

SecretToDeleteMustBeOwnedBy requires that the current secret is owned by an object with the supplied UID.

func SecretToWriteMustBeOwnedBy

func SecretToWriteMustBeOwnedBy(so metav1.Object) store.WriteOption

SecretToWriteMustBeOwnedBy requires that the current object is a connection secret that is owned by an object with the supplied UID.

Types

type DetailsManager

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

DetailsManager is a connection details manager that satisfies the required interfaces to work with connection details by managing interaction with different store implementations.

func NewDetailsManager

NewDetailsManager returns a new connection DetailsManager.

func (*DetailsManager) FetchConnection

FetchConnection fetches connection details of a given ConnectionSecretOwner.

func (*DetailsManager) PropagateConnection

func (m *DetailsManager) PropagateConnection(ctx context.Context, to resource.LocalConnectionSecretOwner, from resource.ConnectionSecretOwner) (propagated bool, err error)

PropagateConnection propagate connection details from one resource to another.

func (*DetailsManager) PublishConnection

PublishConnection publishes the supplied ConnectionDetails to a secret on the configured connection Store.

func (*DetailsManager) UnpublishConnection

UnpublishConnection deletes connection details secret to the configured connection Store.

type DetailsManagerOption

type DetailsManagerOption func(*DetailsManager)

A DetailsManagerOption configures a DetailsManager.

func WithStoreBuilder

func WithStoreBuilder(sb StoreBuilderFn) DetailsManagerOption

WithStoreBuilder configures the StoreBuilder to use.

type Store

type Store interface {
	ReadKeyValues(ctx context.Context, n store.ScopedName, s *store.Secret) error
	WriteKeyValues(ctx context.Context, s *store.Secret, wo ...store.WriteOption) (changed bool, err error)
	DeleteKeyValues(ctx context.Context, s *store.Secret, do ...store.DeleteOption) error
}

A Store stores sensitive key values in Secret.

func RuntimeStoreBuilder

func RuntimeStoreBuilder(ctx context.Context, local client.Client, cfg v1.SecretStoreConfig) (Store, error)

RuntimeStoreBuilder builds and returns a Store for any supported Store type in a given config.

All in-tree connection Store implementations needs to be registered here.

type StoreBuilderFn

type StoreBuilderFn func(ctx context.Context, local client.Client, cfg v1.SecretStoreConfig) (Store, error)

StoreBuilderFn is a function that builds and returns a Store with a given store config.

type StoreConfig

type StoreConfig interface {
	resource.Object

	GetStoreConfig() v1.SecretStoreConfig
}

A StoreConfig configures a connection store.

Directories

Path Synopsis
Package fake implements a fake secret store.
Package fake implements a fake secret store.
Package store implements secret stores.
Package store implements secret stores.
kubernetes
Package kubernetes implements a secret store backed by Kubernetes Secrets.
Package kubernetes implements a secret store backed by Kubernetes Secrets.
vault
Package vault implements a secret store backed by HashiCorp Vault.
Package vault implements a secret store backed by HashiCorp Vault.
vault/fake
Package fake is a fake Vault KVClient.
Package fake is a fake Vault KVClient.
vault/kv
Package kv represents Vault key-value pairs.
Package kv represents Vault key-value pairs.
vault/kv/fake
Package fake is a fake Vault LogicalClient.
Package fake is a fake Vault LogicalClient.

Jump to

Keyboard shortcuts

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