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:
co-authored by
PoorlyDefinedBehaviour
Dana Axinte
Leandro Deveikis
Mariell Hoversholm
Michael Mandrus
parent
7900a53e05
commit
c90e2e8e5e
@@ -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
|
||||
}
|
||||
Reference in New Issue
Block a user