SecretsManager: Add (en/de)cryption packages (#104923)

Merging the code as-is from the feature branch: secret-service/feature-branch

Co-authored-by: PoorlyDefinedBehaviour <brunotj2015@hotmail.com>
Co-authored-by: Dana Axinte <53751979+dana-axinte@users.noreply.github.com>
Co-authored-by: Leandro Deveikis <leandro.deveikis@gmail.com>
Co-authored-by: Mariell Hoversholm <mariell.hoversholm@grafana.com>
Co-authored-by: Michael Mandrus <michael.mandrus@grafana.com>
This commit is contained in:
Matheus Macabu
2025-05-05 15:26:52 +02:00
committed by GitHub
co-authored by PoorlyDefinedBehaviour Dana Axinte Leandro Deveikis Mariell Hoversholm Michael Mandrus
parent 7900a53e05
commit c90e2e8e5e
17 changed files with 906 additions and 0 deletions
@@ -0,0 +1,28 @@
package cipher
import (
"context"
)
const (
AesCfb = "aes-cfb"
AesGcm = "aes-gcm"
)
type Cipher interface {
Encrypter
Decrypter
}
type Encrypter interface {
Encrypt(ctx context.Context, payload []byte, secret string) ([]byte, error)
}
type Decrypter interface {
Decrypt(ctx context.Context, payload []byte, secret string) ([]byte, error)
}
type Provider interface {
ProvideCiphers() map[string]Encrypter
ProvideDeciphers() map[string]Decrypter
}