grafana/pkg/services/encryption/provider/provider.go
Joan López de la Franca Beltran 28e27e1365
Encryption: De-duplicate encryption code with extensible service (#52472)
* Encryption: De-duplicate encryption code with extensible service

* Fix Wire injections

* Fix tests

* Register reload handler
2022-08-02 15:08:09 +02:00

25 lines
564 B
Go

package provider
import (
"github.com/grafana/grafana/pkg/services/encryption"
)
type Provider struct{}
func ProvideEncryptionProvider() Provider {
return Provider{}
}
func (p Provider) ProvideCiphers() map[string]encryption.Cipher {
return map[string]encryption.Cipher{
encryption.AesCfb: aesCfbCipher{},
}
}
func (p Provider) ProvideDeciphers() map[string]encryption.Decipher {
return map[string]encryption.Decipher{
encryption.AesCfb: aesDecipher{algorithm: encryption.AesCfb},
encryption.AesGcm: aesDecipher{algorithm: encryption.AesGcm},
}
}