Chore: Add user service method SetUsingOrg and GetSignedInUserWithCacheCtx (#53343)
* Chore: Add user service method SetUsingOrg * Chore: Add user service method GetSignedInUserWithCacheCtx * Use method GetSignedInUserWithCacheCtx from user service * Fix lint after rebase * Fix lint * Fix lint error * roll back some changes * Roll back changes in api and middleware * Add xorm tags to SignedInUser ID fields
This commit is contained in:
@@ -88,8 +88,8 @@ func (proxy *DataSourceProxy) HandleRequest() {
|
||||
|
||||
traceID := tracing.TraceIDFromContext(proxy.ctx.Req.Context(), false)
|
||||
proxyErrorLogger := logger.New(
|
||||
"userId", proxy.ctx.UserId,
|
||||
"orgId", proxy.ctx.OrgId,
|
||||
"userId", proxy.ctx.UserID,
|
||||
"orgId", proxy.ctx.OrgID,
|
||||
"uname", proxy.ctx.Login,
|
||||
"path", proxy.ctx.Req.URL.Path,
|
||||
"remote_addr", proxy.ctx.RemoteAddr(),
|
||||
@@ -142,7 +142,7 @@ func (proxy *DataSourceProxy) HandleRequest() {
|
||||
span.SetAttributes("datasource_name", proxy.ds.Name, attribute.Key("datasource_name").String(proxy.ds.Name))
|
||||
span.SetAttributes("datasource_type", proxy.ds.Type, attribute.Key("datasource_type").String(proxy.ds.Type))
|
||||
span.SetAttributes("user", proxy.ctx.SignedInUser.Login, attribute.Key("user").String(proxy.ctx.SignedInUser.Login))
|
||||
span.SetAttributes("org_id", proxy.ctx.SignedInUser.OrgId, attribute.Key("org_id").Int64(proxy.ctx.SignedInUser.OrgId))
|
||||
span.SetAttributes("org_id", proxy.ctx.SignedInUser.OrgID, attribute.Key("org_id").Int64(proxy.ctx.SignedInUser.OrgID))
|
||||
|
||||
proxy.addTraceFromHeaderValue(span, "X-Panel-Id", "panel_id")
|
||||
proxy.addTraceFromHeaderValue(span, "X-Dashboard-Id", "dashboard_id")
|
||||
@@ -332,8 +332,8 @@ func (proxy *DataSourceProxy) logRequest() {
|
||||
}
|
||||
|
||||
logger.Info("Proxying incoming request",
|
||||
"userid", proxy.ctx.UserId,
|
||||
"orgid", proxy.ctx.OrgId,
|
||||
"userid", proxy.ctx.UserID,
|
||||
"orgid", proxy.ctx.OrgID,
|
||||
"username", proxy.ctx.Login,
|
||||
"datasource", proxy.ds.Type,
|
||||
"uri", proxy.ctx.Req.RequestURI,
|
||||
|
||||
Reference in New Issue
Block a user