Identity: extend k8s user.Info (#90937)
This commit is contained in:
@@ -140,7 +140,8 @@ func (hs *HTTPServer) PostAnnotation(c *contextmodel.ReqContext) response.Respon
|
||||
return response.Error(http.StatusBadRequest, "Failed to save annotation", err)
|
||||
}
|
||||
|
||||
userID, err := c.SignedInUser.GetID().UserID()
|
||||
// nolint:staticcheck
|
||||
userID, err := c.SignedInUser.GetInternalID()
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to save annotation", err)
|
||||
}
|
||||
@@ -227,7 +228,8 @@ func (hs *HTTPServer) PostGraphiteAnnotation(c *contextmodel.ReqContext) respons
|
||||
return response.Error(http.StatusBadRequest, "Failed to save Graphite annotation", err)
|
||||
}
|
||||
|
||||
userID, err := c.SignedInUser.GetID().UserID()
|
||||
// nolint:staticcheck
|
||||
userID, err := c.SignedInUser.GetInternalID()
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to save Graphite annotation", err)
|
||||
}
|
||||
@@ -284,7 +286,8 @@ func (hs *HTTPServer) UpdateAnnotation(c *contextmodel.ReqContext) response.Resp
|
||||
}
|
||||
}
|
||||
|
||||
userID, err := c.SignedInUser.GetID().UserID()
|
||||
// nolint:staticcheck
|
||||
userID, err := c.SignedInUser.GetInternalID()
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update annotation", err)
|
||||
}
|
||||
@@ -346,7 +349,8 @@ func (hs *HTTPServer) PatchAnnotation(c *contextmodel.ReqContext) response.Respo
|
||||
}
|
||||
}
|
||||
|
||||
userID, err := c.SignedInUser.GetID().UserID()
|
||||
// nolint:staticcheck
|
||||
userID, err := c.SignedInUser.GetInternalID()
|
||||
if err != nil {
|
||||
return response.Error(http.StatusInternalServerError, "Failed to update annotation", err)
|
||||
}
|
||||
|
||||
@@ -586,7 +586,8 @@ func TestDataSourceProxy_routeRule(t *testing.T) {
|
||||
&contextmodel.ReqContext{
|
||||
SignedInUser: &user.SignedInUser{
|
||||
Login: "test_user",
|
||||
NamespacedID: identity.MustParseTypedID("user:1"),
|
||||
FallbackType: identity.TypeUser,
|
||||
UserID: 1,
|
||||
},
|
||||
},
|
||||
&setting.Cfg{SendUserHeader: true},
|
||||
|
||||
@@ -79,7 +79,8 @@ func TestPluginProxy(t *testing.T) {
|
||||
&contextmodel.ReqContext{
|
||||
SignedInUser: &user.SignedInUser{
|
||||
Login: "test_user",
|
||||
NamespacedID: identity.MustParseTypedID("user:1"),
|
||||
FallbackType: identity.TypeUser,
|
||||
UserID: 1,
|
||||
},
|
||||
Context: &web.Context{
|
||||
Req: httpReq,
|
||||
|
||||
Reference in New Issue
Block a user