mirror of
https://github.com/grafana/grafana.git
synced 2024-11-25 02:10:45 -06:00
GRPC/Authn: Remove org name header (#93780)
This commit is contained in:
parent
536edee7bf
commit
cdbc04ab2b
@ -5,11 +5,12 @@ import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
|
||||
"github.com/grafana/authlib/authn"
|
||||
authClaims "github.com/grafana/authlib/claims"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/metadata"
|
||||
|
||||
"github.com/grafana/authlib/authn"
|
||||
authClaims "github.com/grafana/authlib/claims"
|
||||
|
||||
"github.com/grafana/grafana/pkg/apimachinery/identity"
|
||||
)
|
||||
|
||||
@ -18,7 +19,6 @@ const (
|
||||
mdLogin = "grafana-login"
|
||||
mdUserID = "grafana-user-id"
|
||||
mdUserUID = "grafana-user-uid"
|
||||
mdOrgName = "grafana-org-name"
|
||||
mdOrgID = "grafana-org-id"
|
||||
mdOrgRole = "grafana-org-role"
|
||||
)
|
||||
@ -105,7 +105,6 @@ func (f *Authenticator) decodeMetadata(ctx context.Context, meta metadata.MD) (i
|
||||
}
|
||||
user.UserUID = id
|
||||
|
||||
user.OrgName = getter(mdOrgName)
|
||||
user.OrgID, err = strconv.ParseInt(getter(mdOrgID), 10, 64)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("invalid org id: %w", err)
|
||||
@ -154,7 +153,6 @@ func encodeIdentityInMetadata(user identity.Requester) metadata.MD {
|
||||
// Or we can create it directly
|
||||
mdUserID, user.GetID(),
|
||||
mdUserUID, user.GetUID(),
|
||||
mdOrgName, user.GetOrgName(),
|
||||
mdOrgID, strconv.FormatInt(user.GetOrgID(), 10),
|
||||
mdOrgRole, string(user.GetOrgRole()),
|
||||
mdLogin, user.GetLogin(),
|
||||
|
@ -17,7 +17,6 @@ func TestBasicEncodeDecode(t *testing.T) {
|
||||
Login: "test",
|
||||
Type: claims.TypeUser,
|
||||
OrgID: 456,
|
||||
OrgName: "org",
|
||||
OrgRole: identity.RoleAdmin,
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user