Documentation ¶
Index ¶
- Constants
- func AllSecrets(cid string) []entity.Secret
- func DecryptValue(value string) (string, error)
- func DeleteSecret(secret entity.SecretStored)
- func EncryptValue(value string) (string, error)
- func Initialize()
- func ReadSecret(cid string, key string) (*entity.SecretStored, error)
- func SetAgeKey(k string)
- func UpsertSecret(secret entity.SecretStored, appendValue bool)
- type AegisInternalCommand
- type Status
Constants ¶
const BlankAgeKeyValue = "{}"
const InitialSecretValue = `{"empty":true}`
Variables ¶
This section is empty.
Functions ¶
func AllSecrets ¶
AllSecrets returns a slice of entity.Secret containing all secrets currently stored. If no secrets are found, an empty slice is returned.
func DecryptValue ¶ added in v0.15.7
DecryptValue takes a base64-encoded and encrypted string value and returns the original, decrypted string. If the decryption process encounters any error, it will return an empty string and the corresponding error.
func DeleteSecret ¶ added in v0.15.7
func DeleteSecret(secret entity.SecretStored)
func EncryptValue ¶ added in v0.15.7
EncryptValue takes a string value and returns an encrypted and base64-encoded representation of the input value. If the encryption process encounters any error, it will return an empty string and the corresponding error.
func Initialize ¶ added in v0.15.7
func Initialize()
Initialize starts two goroutines: one to process the secret queue and another to process the Kubernetes secret queue. These goroutines are responsible for handling queued secrets and persisting them to disk.
func ReadSecret ¶
func ReadSecret(cid string, key string) (*entity.SecretStored, error)
ReadSecret takes a key string and returns a pointer to an entity.SecretStored object if the secret exists in the in-memory store. If the secret is not found in memory, it attempts to read it from disk, store it in memory, and return it. If the secret is not found on disk, it returns nil.
func SetAgeKey ¶
func SetAgeKey(k string)
SetAgeKey sets the age key to be used for encryption and decryption. This function is not thread-safe and should only be called once during initialization.
func UpsertSecret ¶
func UpsertSecret(secret entity.SecretStored, appendValue bool)
UpsertSecret takes an entity.SecretStored object and inserts it into the in-memory store if it doesn't exist, or updates it if it does. It also handles updating the backing store and Kubernetes secrets if necessary. If appendValue is true, the new value will be appended to the existing values, otherwise it will replace the existing values.
Types ¶
type AegisInternalCommand ¶
type AegisInternalCommand struct {
LogLevel int `json:"logLevel"`
}
type Status ¶ added in v0.15.7
type Status struct { SecretQueueLen int SecretQueueCap int K8sQueueLen int K8sQueueCap int NumSecrets int // contains filtered or unexported fields }
Status is a struct representing the current state of the secret manager, including the lengths and capacities of the secret queues and the total number of secrets stored.
func Stats ¶
func Stats() Status
Stats returns a copy of the currentState Status object, providing a snapshot of the current status of the secret manager.