Documentation
¶
Index ¶
- func CleansePath(path string) string
- func GetFinalizer(instance client.Object) string
- func GetJWTToken(context context.Context, serviceAccountName string, kubeNamespace string) (string, error)
- func GetJWTTokenWithDuration(context context.Context, serviceAccountName string, kubeNamespace string, ...) (string, error)
- func ReadSecret(context context.Context, path string) (*vault.Secret, bool, error)
- func ReadSecretWithPayload(context context.Context, path string, payload map[string]string) (*vault.Secret, bool, error)
- func ToString(name interface{}) string
- type KubeAuthConfiguration
- func (in *KubeAuthConfiguration) DeepCopy() *KubeAuthConfiguration
- func (in *KubeAuthConfiguration) DeepCopyInto(out *KubeAuthConfiguration)
- func (kc *KubeAuthConfiguration) GetKubeAuthPath() string
- func (kc *KubeAuthConfiguration) GetNamespace() string
- func (kc *KubeAuthConfiguration) GetRole() string
- func (kc *KubeAuthConfiguration) GetServiceAccountName() string
- func (kc *KubeAuthConfiguration) GetVaultClient(context context.Context, kubeNamespace string) (*vault.Client, error)
- type Path
- type RabbitMQEngineConfigVaultEndpoint
- type RabbitMQEngineConfigVaultObject
- type RootCredentialConfig
- func (in *RootCredentialConfig) DeepCopy() *RootCredentialConfig
- func (in *RootCredentialConfig) DeepCopyInto(out *RootCredentialConfig)
- func (credentials *RootCredentialConfig) ValidateEitherFromVaultSecretOrFromSecret() error
- func (credentials *RootCredentialConfig) ValidateEitherFromVaultSecretOrFromSecretOrFromRandomSecret() error
- type TargetNamespaceConfig
- type VaultEndpoint
- type VaultEngineEndpoint
- type VaultEngineObject
- type VaultObject
- type VaultPKIEngineEndpoint
- func (ve *VaultPKIEngineEndpoint) CreateExported(context context.Context, secret *vault.Secret) (bool, error)
- func (ve *VaultPKIEngineEndpoint) CreateIntermediate(context context.Context) error
- func (ve *VaultPKIEngineEndpoint) CreateOrUpdateConfig(context context.Context, configPath string, payload map[string]interface{}) error
- func (ve *VaultPKIEngineEndpoint) CreateOrUpdateConfigCrl(context context.Context) error
- func (ve *VaultPKIEngineEndpoint) CreateOrUpdateConfigUrls(context context.Context) error
- func (ve *VaultPKIEngineEndpoint) DeleteIfExists(context context.Context) error
- func (ve *VaultPKIEngineEndpoint) Exists(context context.Context) (bool, error)
- func (ve *VaultPKIEngineEndpoint) Generate(context context.Context) (*vault.Secret, error)
- type VaultPKIEngineObject
- type VaultSecretEndpoint
- type VaultSecretObject
- type VaultSecretReference
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleansePath ¶ added in v0.6.3
func CleansePath(path string) string
func GetFinalizer ¶ added in v0.6.3
func GetFinalizer(instance client.Object) string
func GetJWTToken ¶ added in v0.6.3
func GetJWTToken(context context.Context, serviceAccountName string, kubeNamespace string) (string, error)
func GetJWTTokenWithDuration ¶ added in v0.6.4
func GetJWTTokenWithDuration(context context.Context, serviceAccountName string, kubeNamespace string, duration int64) (string, error)
func ReadSecret ¶
func ReadSecret(context context.Context, path string) (*vault.Secret, bool, error)
func ReadSecretWithPayload ¶ added in v0.6.0
func ReadSecretWithPayload(context context.Context, path string, payload map[string]string) (*vault.Secret, bool, error)
Types ¶
type KubeAuthConfiguration ¶ added in v0.6.3
type KubeAuthConfiguration struct {
// ServiceAccount is the service account used for the kube auth authentication
// +kubebuilder:validation:Required
// +kubebuilder:default={"name": "default"}
ServiceAccount *corev1.LocalObjectReference `json:"serviceAccount,omitempty"`
// Path is the path of the role used for this kube auth authentication. The operator will try to authenticate at {[namespace/]}auth/{spec.path}
// +kubebuilder:validation:Required
// +kubebuilder:default=kubernetes
Path Path `json:"path,omitempty"`
// Role the role to be used during authentication
// +kubebuilder:validation:Required
Role string `json:"role,omitempty"`
//Namespace is the Vault namespace to be used in all the operations withing this connection/authentication. Only available in Vault Enterprise.
// +kubebuilder:validation:Optional
Namespace string `json:"namespace,omitempty"`
}
+kubebuilder:object:generate=true
func (*KubeAuthConfiguration) DeepCopy ¶ added in v0.6.3
func (in *KubeAuthConfiguration) DeepCopy() *KubeAuthConfiguration
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeAuthConfiguration.
func (*KubeAuthConfiguration) DeepCopyInto ¶ added in v0.6.3
func (in *KubeAuthConfiguration) DeepCopyInto(out *KubeAuthConfiguration)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*KubeAuthConfiguration) GetKubeAuthPath ¶ added in v0.6.3
func (kc *KubeAuthConfiguration) GetKubeAuthPath() string
func (*KubeAuthConfiguration) GetNamespace ¶ added in v0.6.3
func (kc *KubeAuthConfiguration) GetNamespace() string
func (*KubeAuthConfiguration) GetRole ¶ added in v0.6.3
func (kc *KubeAuthConfiguration) GetRole() string
func (*KubeAuthConfiguration) GetServiceAccountName ¶ added in v0.6.3
func (kc *KubeAuthConfiguration) GetServiceAccountName() string
func (*KubeAuthConfiguration) GetVaultClient ¶ added in v0.6.3
func (kc *KubeAuthConfiguration) GetVaultClient(context context.Context, kubeNamespace string) (*vault.Client, error)
type Path ¶ added in v0.6.3
type Path string
+kubebuilder:object:generate=true +kubebuilder:validation:Pattern:=`^(?:/?[\w;:@&=\$-\.\+]*)+/?`
type RabbitMQEngineConfigVaultEndpoint ¶
type RabbitMQEngineConfigVaultEndpoint struct {
// contains filtered or unexported fields
}
func NewRabbitMQEngineConfigVaultEndpoint ¶
func NewRabbitMQEngineConfigVaultEndpoint(obj client.Object) *RabbitMQEngineConfigVaultEndpoint
func (*RabbitMQEngineConfigVaultEndpoint) Create ¶
func (ve *RabbitMQEngineConfigVaultEndpoint) Create(context context.Context) error
func (*RabbitMQEngineConfigVaultEndpoint) CreateOrUpdateLease ¶
func (ve *RabbitMQEngineConfigVaultEndpoint) CreateOrUpdateLease(context context.Context) error
type RabbitMQEngineConfigVaultObject ¶
type RabbitMQEngineConfigVaultObject interface {
VaultObject
GetLeasePath() string
GetLeasePayload() map[string]interface{}
CheckTTLValuesProvided() bool
}
type RootCredentialConfig ¶ added in v0.6.3
type RootCredentialConfig struct {
// VaultSecret retrieves the credentials from a Vault secret. This will map the "username" and "password" keys of the secret to the username and password of this config. All other keys will be ignored. Only one of RootCredentialsFromVaultSecret or RootCredentialsFromSecret or RootCredentialsFromRandomSecret can be specified.
// username: Specifies the name of the user to use as the "root" user when connecting to the database. This "root" user is used to create/update/delete users managed by these plugins, so you will need to ensure that this user has permissions to manipulate users appropriate to the database. This is typically used in the connection_url field via the templating directive "{{"username"}}" or "{{"name"}}".
// password: Specifies the password to use when connecting with the username. This value will not be returned by Vault when performing a read upon the configuration. This is typically used in the connection_url field via the templating directive "{{"password"}}".
// If username is provided as spec.username, it takes precedence over the username retrieved from the referenced secret
// +kubebuilder:validation:Optional
VaultSecret *VaultSecretReference `json:"vaultSecret,omitempty"`
// Secret retrieves the credentials from a Kubernetes secret. The secret must be of basicauth type (https://kubernetes.io/docs/concepts/configuration/secret/#basic-authentication-secret). This will map the "username" and "password" keys of the secret to the username and password of this config. If the kubernetes secret is updated, this configuration will also be updated. All other keys will be ignored. Only one of RootCredentialsFromVaultSecret or RootCredentialsFromSecret or RootCredentialsFromRandomSecret can be specified.
// username: Specifies the name of the user to use as the "root" user when connecting to the database. This "root" user is used to create/update/delete users managed by these plugins, so you will need to ensure that this user has permissions to manipulate users appropriate to the database. This is typically used in the connection_url field via the templating directive "{{"username"}}" or "{{"name"}}".
// password: Specifies the password to use when connecting with the username. This value will not be returned by Vault when performing a read upon the configuration. This is typically used in the connection_url field via the templating directive "{{"password"}}".
// If username is provided as spec.username, it takes precedence over the username retrieved from the referenced secret
// +kubebuilder:validation:Optional
Secret *corev1.LocalObjectReference `json:"secret,omitempty"`
// RandomSecret retrieves the credentials from the Vault secret corresponding to this RandomSecret. This will map the "username" and "password" keys of the secret to the username and password of this config. All other keys will be ignored. If the RandomSecret is refreshed the operator retrieves the new secret from Vault and updates this configuration. Only one of RootCredentialsFromVaultSecret or RootCredentialsFromSecret or RootCredentialsFromRandomSecret can be specified.
// When using randomSecret a username must be specified in the spec.username
// password: Specifies the password to use when connecting with the username. This value will not be returned by Vault when performing a read upon the configuration. This is typically used in the connection_url field via the templating directive "{{"password"}}"".
// +kubebuilder:validation:Optional
RandomSecret *corev1.LocalObjectReference `json:"randomSecret,omitempty"`
// PasswordKey key to be used when retrieving the password, required with VaultSecrets and Kubernetes secrets, ignored with RandomSecret
// +kubebuilder:validation:Optional
PasswordKey string `json:"passwordKey,omitempty"`
// UsernameKey key to be used when retrieving the username, optional with VaultSecrets and Kubernetes secrets, ignored with RandomSecret
// +kubebuilder:validation:Optional
UsernameKey string `json:"usernameKey,omitempty"`
}
+kubebuilder:object:generate=true
func (*RootCredentialConfig) DeepCopy ¶ added in v0.6.3
func (in *RootCredentialConfig) DeepCopy() *RootCredentialConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RootCredentialConfig.
func (*RootCredentialConfig) DeepCopyInto ¶ added in v0.6.3
func (in *RootCredentialConfig) DeepCopyInto(out *RootCredentialConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*RootCredentialConfig) ValidateEitherFromVaultSecretOrFromSecret ¶ added in v0.6.3
func (credentials *RootCredentialConfig) ValidateEitherFromVaultSecretOrFromSecret() error
func (*RootCredentialConfig) ValidateEitherFromVaultSecretOrFromSecretOrFromRandomSecret ¶ added in v0.6.3
func (credentials *RootCredentialConfig) ValidateEitherFromVaultSecretOrFromSecretOrFromRandomSecret() error
type TargetNamespaceConfig ¶ added in v0.6.3
type TargetNamespaceConfig struct {
// TargetNamespaceSelector is a selector of namespaces from which service accounts will receove this role. Either TargetNamespaceSelector or TargetNamespaces can be specified
// +kubebuilder:validation:Optional
TargetNamespaceSelector *metav1.LabelSelector `json:"targetNamespaceSelector,omitempty"`
// TargetNamespaces is a list of namespace from which service accounts will receive this role. Either TargetNamespaceSelector or TargetNamespaces can be specified.
// +kubebuilder:validation:Optional
// +kubebuilder:validation:MinItems=1
// kubebuilder:validation:UniqueItems=true
// +listType=set
TargetNamespaces []string `json:"targetNamespaces,omitempty"`
}
+kubebuilder:object:generate=true
func (*TargetNamespaceConfig) DeepCopy ¶ added in v0.6.3
func (in *TargetNamespaceConfig) DeepCopy() *TargetNamespaceConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TargetNamespaceConfig.
func (*TargetNamespaceConfig) DeepCopyInto ¶ added in v0.6.3
func (in *TargetNamespaceConfig) DeepCopyInto(out *TargetNamespaceConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VaultEndpoint ¶
type VaultEndpoint struct {
// contains filtered or unexported fields
}
func NewVaultEndpoint ¶
func NewVaultEndpoint(obj client.Object) *VaultEndpoint
func (*VaultEndpoint) CreateOrUpdate ¶
func (ve *VaultEndpoint) CreateOrUpdate(context context.Context) error
func (*VaultEndpoint) DeleteIfExists ¶
func (ve *VaultEndpoint) DeleteIfExists(context context.Context) error
type VaultEngineEndpoint ¶
type VaultEngineEndpoint struct {
*VaultEndpoint
// contains filtered or unexported fields
}
func NewVaultEngineEndpoint ¶
func NewVaultEngineEndpoint(obj client.Object) *VaultEngineEndpoint
func (*VaultEngineEndpoint) CreateOrUpdateTuneConfig ¶
func (ve *VaultEngineEndpoint) CreateOrUpdateTuneConfig(context context.Context) error
func (*VaultEngineEndpoint) Exists ¶
func (ve *VaultEngineEndpoint) Exists(context context.Context) (bool, error)
func (*VaultEngineEndpoint) GetAccessor ¶
func (ve *VaultEngineEndpoint) GetAccessor(context context.Context) (string, error)
type VaultEngineObject ¶
type VaultEngineObject interface {
GetEngineListPath() string
GetEngineTunePath() string
GetTunePayload() map[string]interface{}
SetAccessor(accessor string)
}
type VaultObject ¶
type VaultObject interface {
GetPath() string
GetPayload() map[string]interface{}
// IsEquivalentToDesiredState returns wether the passed payload is equivalent to the payload that the current object would generate. When this is a engine object the tune payload will be compared
IsEquivalentToDesiredState(payload map[string]interface{}) bool
IsInitialized() bool
IsValid() (bool, error)
PrepareInternalValues(context context.Context, object client.Object) error
GetKubeAuthConfiguration() *KubeAuthConfiguration
}
type VaultPKIEngineEndpoint ¶ added in v0.3.0
type VaultPKIEngineEndpoint struct {
*VaultEndpoint
// contains filtered or unexported fields
}
func NewVaultPKIEngineEndpoint ¶ added in v0.3.0
func NewVaultPKIEngineEndpoint(obj client.Object) *VaultPKIEngineEndpoint
func (*VaultPKIEngineEndpoint) CreateExported ¶ added in v0.3.0
func (ve *VaultPKIEngineEndpoint) CreateExported(context context.Context, secret *vault.Secret) (bool, error)
func (*VaultPKIEngineEndpoint) CreateIntermediate ¶ added in v0.3.0
func (ve *VaultPKIEngineEndpoint) CreateIntermediate(context context.Context) error
func (*VaultPKIEngineEndpoint) CreateOrUpdateConfig ¶ added in v0.3.0
func (ve *VaultPKIEngineEndpoint) CreateOrUpdateConfig(context context.Context, configPath string, payload map[string]interface{}) error
func (*VaultPKIEngineEndpoint) CreateOrUpdateConfigCrl ¶ added in v0.3.0
func (ve *VaultPKIEngineEndpoint) CreateOrUpdateConfigCrl(context context.Context) error
func (*VaultPKIEngineEndpoint) CreateOrUpdateConfigUrls ¶ added in v0.3.0
func (ve *VaultPKIEngineEndpoint) CreateOrUpdateConfigUrls(context context.Context) error
func (*VaultPKIEngineEndpoint) DeleteIfExists ¶ added in v0.3.0
func (ve *VaultPKIEngineEndpoint) DeleteIfExists(context context.Context) error
type VaultPKIEngineObject ¶ added in v0.3.0
type VaultPKIEngineObject interface {
GetGeneratePath() string
GetDeletePath() string
GetGeneratedStatus() bool
SetGeneratedStatus(status bool)
GetConfigUrlsPath() string
GetConfigCrlPath() string
GetConfigUrlsPayload() map[string]interface{}
GetConfigCrlPayload() map[string]interface{}
CreateExported(context context.Context, secret *vault.Secret) (bool, error)
SetExportedStatus(status bool)
SetIntermediate(context context.Context) error
GetSignedStatus() bool
SetSignedStatus(status bool)
}
type VaultSecretEndpoint ¶ added in v0.6.0
type VaultSecretEndpoint struct {
// contains filtered or unexported fields
}
func NewVaultSecretEndpoint ¶ added in v0.6.0
func NewVaultSecretEndpoint(obj VaultSecretObject) *VaultSecretEndpoint
type VaultSecretObject ¶ added in v0.6.0
type VaultSecretObject interface {
GetPath() string
GetRequestMethod() string
GetPostRequestPayload() map[string]string
}
type VaultSecretReference ¶ added in v0.6.3
type VaultSecretReference struct {
// Path is the path to the secret
// +kubebuilder:validation:Required
Path string `json:"path,omitempty"`
}
+kubebuilder:object:generate=true
func (*VaultSecretReference) DeepCopy ¶ added in v0.6.3
func (in *VaultSecretReference) DeepCopy() *VaultSecretReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VaultSecretReference.
func (*VaultSecretReference) DeepCopyInto ¶ added in v0.6.3
func (in *VaultSecretReference) DeepCopyInto(out *VaultSecretReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.