merge main

This commit is contained in:
Ryan McKinley
2024-12-16 19:09:19 +03:00
parent e4837d452e
commit de22a2ca71
2 changed files with 6 additions and 5 deletions
@@ -5,11 +5,12 @@ import (
"fmt"
"strconv"
"k8s.io/apiserver/pkg/authorization/authorizer"
"github.com/grafana/authlib/claims"
"github.com/grafana/grafana/pkg/apimachinery/identity"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/setting"
"k8s.io/apiserver/pkg/authorization/authorizer"
)
var _ authorizer.Authorizer = &stackIDAuthorizer{}
@@ -45,9 +46,9 @@ func (auth stackIDAuthorizer) Authorize(ctx context.Context, a authorizer.Attrib
if info.Value == "" {
return authorizer.DecisionNoOpinion, "", nil
}
if info.StackID != auth.stackID {
return authorizer.DecisionDeny, "wrong stack id is selected", nil
msg := fmt.Sprintf("wrong stack id is selected (expected: %d, found %d)", auth.stackID, info.StackID)
return authorizer.DecisionDeny, msg, nil
}
if info.OrgID != 1 {
return authorizer.DecisionDeny, "cloud instance requires org 1", nil
+2 -2
View File
@@ -193,7 +193,7 @@ func SetupConfig(
w := csv.NewWriter(f)
if isNew {
w.Write([]string{
_ = w.Write([]string{
"#Path",
"Method",
"action",
@@ -205,7 +205,7 @@ func SetupConfig(
"metadata",
})
}
w.Write([]string{
_ = w.Write([]string{
r.Path(),
r.Method(),
action,