Documentation ¶
Overview ¶
Package connection provides utilities for working with connection details.
Index ¶
- func SecretToDeleteMustBeOwnedBy(so metav1.Object) store.DeleteOption
- func SecretToWriteMustBeOwnedBy(so metav1.Object) store.WriteOption
- type DetailsManager
- func (m *DetailsManager) FetchConnection(ctx context.Context, so resource.ConnectionSecretOwner) (managed.ConnectionDetails, error)
- func (m *DetailsManager) PropagateConnection(ctx context.Context, to resource.LocalConnectionSecretOwner, ...) (propagated bool, err error)
- func (m *DetailsManager) PublishConnection(ctx context.Context, so resource.ConnectionSecretOwner, ...) (bool, error)
- func (m *DetailsManager) UnpublishConnection(ctx context.Context, so resource.ConnectionSecretOwner, ...) error
- type DetailsManagerOption
- type Store
- type StoreBuilderFn
- type StoreConfig
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 ¶
func NewDetailsManager(c client.Client, of schema.GroupVersionKind, o ...DetailsManagerOption) *DetailsManager
NewDetailsManager returns a new connection DetailsManager.
func (*DetailsManager) FetchConnection ¶
func (m *DetailsManager) FetchConnection(ctx context.Context, so resource.ConnectionSecretOwner) (managed.ConnectionDetails, error)
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 ¶
func (m *DetailsManager) PublishConnection(ctx context.Context, so resource.ConnectionSecretOwner, conn managed.ConnectionDetails) (bool, error)
PublishConnection publishes the supplied ConnectionDetails to a secret on the configured connection Store.
func (*DetailsManager) UnpublishConnection ¶
func (m *DetailsManager) UnpublishConnection(ctx context.Context, so resource.ConnectionSecretOwner, conn managed.ConnectionDetails) error
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. |