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:
@@ -27,8 +27,8 @@ func NewApiPluginProxy(ctx *models.ReqContext, proxyPath string, route *plugins.
|
||||
appID string, cfg *setting.Cfg, pluginSettingsService pluginsettings.Service,
|
||||
secretsService secrets.Service) *httputil.ReverseProxy {
|
||||
appProxyLogger := logger.New(
|
||||
"userId", ctx.UserId,
|
||||
"orgId", ctx.OrgId,
|
||||
"userId", ctx.UserID,
|
||||
"orgId", ctx.OrgID,
|
||||
"uname", ctx.Login,
|
||||
"app", appID,
|
||||
"path", ctx.Req.URL.Path,
|
||||
@@ -37,7 +37,7 @@ func NewApiPluginProxy(ctx *models.ReqContext, proxyPath string, route *plugins.
|
||||
)
|
||||
|
||||
director := func(req *http.Request) {
|
||||
query := pluginsettings.GetByPluginIDArgs{OrgID: ctx.OrgId, PluginID: appID}
|
||||
query := pluginsettings.GetByPluginIDArgs{OrgID: ctx.OrgID, PluginID: appID}
|
||||
ps, err := pluginSettingsService.GetPluginSettingByPluginID(ctx.Req.Context(), &query)
|
||||
if err != nil {
|
||||
ctx.JsonApiErr(500, "Failed to fetch plugin settings", err)
|
||||
@@ -115,8 +115,8 @@ func logAppPluginProxyRequest(appID string, cfg *setting.Cfg, c *models.ReqConte
|
||||
}
|
||||
|
||||
logger.Info("Proxying incoming request",
|
||||
"userid", c.UserId,
|
||||
"orgid", c.OrgId,
|
||||
"userid", c.UserID,
|
||||
"orgid", c.OrgID,
|
||||
"username", c.Login,
|
||||
"app", appID,
|
||||
"uri", c.Req.RequestURI,
|
||||
|
||||
Reference in New Issue
Block a user