mirror of
https://github.com/grafana/grafana.git
synced 2025-01-09 23:53:25 -06:00
cc65b4d46a
* [Chore] Remove setting provider from secret service Co-authored-by: Tania B <yalyna.ts@gmail.com> Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com> * Add a ShouldBeRedacted func Co-authored-by: Tania B <yalyna.ts@gmail.com> Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com> * Secrets: Make Migrator extensible Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> Co-authored-by: Tania B <yalyna.ts@gmail.com> * Alerting: Fix tests after refactor Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com> Co-authored-by: Tania B <yalyna.ts@gmail.com> * Remove commented code no longer used * Fix Wire bindings Co-authored-by: Tania B <yalyna.ts@gmail.com> * Add constructors to secrets * Linting * Undo undesired change --------- Co-authored-by: gamab <gabi.mabs@gmail.com> Co-authored-by: Tania B <yalyna.ts@gmail.com> Co-authored-by: Gabriel MABILLE <gamab@users.noreply.github.com>
31 lines
867 B
Go
31 lines
867 B
Go
package osskmsproviders
|
|
|
|
import (
|
|
"github.com/grafana/grafana/pkg/services/encryption"
|
|
"github.com/grafana/grafana/pkg/services/featuremgmt"
|
|
"github.com/grafana/grafana/pkg/services/kmsproviders"
|
|
grafana "github.com/grafana/grafana/pkg/services/kmsproviders/defaultprovider"
|
|
"github.com/grafana/grafana/pkg/services/secrets"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
)
|
|
|
|
type Service struct {
|
|
enc encryption.Internal
|
|
cfg *setting.Cfg
|
|
features featuremgmt.FeatureToggles
|
|
}
|
|
|
|
func ProvideService(enc encryption.Internal, cfg *setting.Cfg, features featuremgmt.FeatureToggles) Service {
|
|
return Service{
|
|
enc: enc,
|
|
cfg: cfg,
|
|
features: features,
|
|
}
|
|
}
|
|
|
|
func (s Service) Provide() (map[secrets.ProviderID]secrets.Provider, error) {
|
|
return map[secrets.ProviderID]secrets.Provider{
|
|
kmsproviders.Default: grafana.New(s.cfg, s.enc),
|
|
}, nil
|
|
}
|