Files
grafana/apps/secret/kinds/v1beta1/securevalue.cue
BrunoandMatheus Macabu 0d67442f1a Secrets manager: create secure value using the active keeper (#114039)
* Secrets manager: create secure value using the active keeper

* SecureValueService.Update: fetch secure value from db to get the keeper

* fix keeper_store_test.go

* SecureValueService: fix bug in update where the current version keeper wasn't being passed to the createNewVersion method

* make gofmt

* remove outdated test

* update TestModel

* undo enterprise_imports changes

* use xkube.Namespace

* migrator: set secret_secure_value.keeper to 'system' when the column is null

* indent cue

* fix tests

* fix enterprise imports

* properly fix enterprise imports

* make update-workspace

* go mod tidy

---------

Co-authored-by: Matheus Macabu <macabu.matheus@gmail.com>
2025-11-21 11:20:16 -03:00

53 lines
1.6 KiB
CUE

package v1beta1
import (
"list"
"strings"
)
// ExposedSecureValue contains the raw decrypted secure value.
#ExposedSecureValue: string
SecureValueSpec: {
// Short description that explains the purpose of this SecureValue.
// +k8s:validation:minLength=1
// +k8s:validation:maxLength=25
description: string & strings.MinRunes(1) & strings.MaxRunes(25)
// The raw value is only valid for write. Read/List will always be empty.
// There is no support for mixing `value` and `ref`, you can't create a secret in a third-party keeper with a specified `ref`.
// Minimum and maximum lengths in bytes.
// +k8s:validation:minLength=1
// +k8s:validation:maxLength=24576
// +optional
value?: #ExposedSecureValue
// When using a third-party keeper, the `ref` is used to reference a value inside the remote storage.
// This should not contain sensitive information.
// +k8s:validation:minLength=1
// +k8s:validation:maxLength=1024
// +optional
ref?: string & strings.MinRunes(1) & strings.MaxRunes(1024)
// The Decrypters that are allowed to decrypt this secret.
// An empty list means no service can decrypt it.
// +k8s:validation:maxItems=64
// +k8s:validation:uniqueItems=true
// +listType=atomic
// +optional
decrypters?: [...string] & list.UniqueItems() & list.MaxItems(64)
}
SecureValueStatus: {
// Version of the secure value. Cannot be set.
// +optional
version: int64 & >=0
// External ID where the secret is stored. Cannot be set.
// +optional
externalID: string
// The name of the keeper used to create the secure value. Cannot be set.
keeper: string
}