K8s: Improve identity mapping setup (#89450)

This commit is contained in:
Ryan McKinley
2024-06-20 17:53:07 +03:00
committed by GitHub
parent fc4a9904c9
commit 27e800768e
30 changed files with 205 additions and 142 deletions
+2 -2
View File
@@ -8,7 +8,7 @@ import (
"fmt"
"text/template"
"github.com/grafana/grafana/pkg/infra/appcontext"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/services/store/entity/db"
"github.com/grafana/grafana/pkg/services/store/entity/sqlstash/sqltemplate"
)
@@ -27,7 +27,7 @@ func createETag(body []byte, meta []byte, status []byte) string {
// getCurrentUser returns a string identifying the user making a request with
// the given context.
func getCurrentUser(ctx context.Context) (string, error) {
user, err := appcontext.User(ctx)
user, err := identity.GetRequester(ctx)
if err != nil || user == nil {
return "", fmt.Errorf("%w: %w", ErrUserNotFoundInContext, err)
}