Alerting: Support secrets in contact points nested fields (#92035)

Back-end:
* update alerting module
* update GetSecretKeysForContactPointType to extract secret fields from nested options
* Update RemoveSecretsForContactPoint to support complex settings
* update PostableGrafanaReceiverToEmbeddedContactPoint to support nested secrets
* update Integration to support nested settings in models.Integration
* make sigv4 fields optional

Front-end:
* add UI support for encrypted subform fields
* allow emptying nested secure fields
* Omit non touched secure fields in POST payload when saving a contact point
* Use SecretInput from grafana-ui instead of the new EncryptedInput
* use produce from immer
* rename mapClone
* rename sliceClone
* Don't use produce from immer as we need to delete the fileds afterwards

---------

Co-authored-by: Gilles De Mey <gilles.de.mey@gmail.com>
Co-authored-by: Sonia Aguilar <soniaaguilarpeiron@gmail.com>
Co-authored-by: Matt Jacobson <matthew.jacobson@grafana.com>
This commit is contained in:
Yuri Tseretyan
2024-09-10 22:26:23 -04:00
committed by GitHub
co-authored by Gilles De Mey Sonia Aguilar Matt Jacobson
parent 78ce9b8f39
commit cb372d3fa8
20 changed files with 839 additions and 246 deletions
@@ -183,11 +183,11 @@ type SensugoIntegration struct {
}
type SigV4Config struct {
Region string `json:"region,omitempty" yaml:"region,omitempty" hcl:"region"`
AccessKey string `json:"access_key,omitempty" yaml:"access_key,omitempty" hcl:"access_key"`
SecretKey string `json:"secret_key,omitempty" yaml:"secret_key,omitempty" hcl:"secret_key"`
Profile string `json:"profile,omitempty" yaml:"profile,omitempty" hcl:"profile"`
RoleARN string `json:"role_arn,omitempty" yaml:"role_arn,omitempty" hcl:"role_arn"`
Region *string `json:"region,omitempty" yaml:"region,omitempty" hcl:"region"`
AccessKey *Secret `json:"access_key,omitempty" yaml:"access_key,omitempty" hcl:"access_key"`
SecretKey *Secret `json:"secret_key,omitempty" yaml:"secret_key,omitempty" hcl:"secret_key"`
Profile *string `json:"profile,omitempty" yaml:"profile,omitempty" hcl:"profile"`
RoleARN *string `json:"role_arn,omitempty" yaml:"role_arn,omitempty" hcl:"role_arn"`
}
type SnsIntegration struct {