mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Encryption: Add support for multiple data keys per day (#47765)
* Add database migrations * Use short uids as data key ids * Add support for manual data key rotation * Fix duplicated mutex unlocks * Fix migration * Manage current data keys per name * Adjust key re-encryption and test * Modify rename column migration for MySQL compatibility * Refactor secrets manager and data keys cache * Multiple o11y adjustments * Fix stats query * Apply suggestions from code review Co-authored-by: Tania <yalyna.ts@gmail.com> * Fix linter * Docs: Rotate data encryption keys API endpoint Co-authored-by: Tania <yalyna.ts@gmail.com>
This commit is contained in:
committed by
GitHub
parent
ae8c11bfa4
commit
e43879e55d
16
pkg/api/admin_encryption.go
Normal file
16
pkg/api/admin_encryption.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/grafana/grafana/pkg/api/response"
|
||||
"github.com/grafana/grafana/pkg/models"
|
||||
)
|
||||
|
||||
func (hs *HTTPServer) AdminRotateDataEncryptionKeys(c *models.ReqContext) response.Response {
|
||||
if err := hs.SecretsService.RotateDataKeys(c.Req.Context()); err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to rotate data key", err)
|
||||
}
|
||||
|
||||
return response.Respond(http.StatusNoContent, "")
|
||||
}
|
||||
Reference in New Issue
Block a user