mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
AuthN: Make client params part of the identity (#61050)
* AuthN: Change client params to be a return value of authenticate * AuthN: move client params to be part of the identity
This commit is contained in:
@@ -38,9 +38,10 @@ func (c *Render) Authenticate(ctx context.Context, r *authn.Request) (*authn.Ide
|
||||
|
||||
if renderUsr.UserID <= 0 {
|
||||
return &authn.Identity{
|
||||
ID: authn.NamespacedID(authn.NamespaceUser, 0),
|
||||
OrgID: renderUsr.OrgID,
|
||||
OrgRoles: map[int64]org.RoleType{renderUsr.OrgID: org.RoleType(renderUsr.OrgRole)},
|
||||
ID: authn.NamespacedID(authn.NamespaceUser, 0),
|
||||
OrgID: renderUsr.OrgID,
|
||||
OrgRoles: map[int64]org.RoleType{renderUsr.OrgID: org.RoleType(renderUsr.OrgRole)},
|
||||
ClientParams: authn.ClientParams{},
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -48,11 +49,7 @@ func (c *Render) Authenticate(ctx context.Context, r *authn.Request) (*authn.Ide
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return authn.IdentityFromSignedInUser(authn.NamespacedID(authn.NamespaceUser, usr.UserID), usr), nil
|
||||
}
|
||||
|
||||
func (c *Render) ClientParams() *authn.ClientParams {
|
||||
return &authn.ClientParams{}
|
||||
return authn.IdentityFromSignedInUser(authn.NamespacedID(authn.NamespaceUser, usr.UserID), usr, authn.ClientParams{}), nil
|
||||
}
|
||||
|
||||
func (c *Render) Test(ctx context.Context, r *authn.Request) bool {
|
||||
|
Reference in New Issue
Block a user