3
0

Fix actionlog filtering, optimize req. origin values

This commit is contained in:
Denis Arh 2020-06-06 16:51:06 +02:00
parent 888d08e9a6
commit ef95660d4b
4 changed files with 11 additions and 11 deletions

View File

@ -8,13 +8,13 @@ import (
type ctxKey int
const (
RequestOrigin_APP_Init = "app/init"
RequestOrigin_APP_Upgrade = "app/upgrade"
RequestOrigin_APP_Activate = "app/activate"
RequestOrigin_APP_Provision = "app/provision"
RequestOrigin_APP_Run = "app/run"
RequestOrigin_HTTPServer_API_REST = "app/http-server/api/rest"
RequestOrigin_HTTPServer_API_GRPC = "app/http-server/api/grpc"
RequestOrigin_APP_Init = "app/init"
RequestOrigin_APP_Upgrade = "app/upgrade"
RequestOrigin_APP_Activate = "app/activate"
RequestOrigin_APP_Provision = "app/provision"
RequestOrigin_APP_Run = "app/run"
RequestOrigin_API_REST = "api/rest"
RequestOrigin_API_GRPC = "api/grpc"
)
// RequestOriginKey is the key that holds th unique request ID in a request context.

View File

@ -5,11 +5,10 @@ import (
"strings"
"github.com/go-chi/chi/middleware"
"go.uber.org/zap"
"github.com/cortezaproject/corteza-server/pkg/api"
"github.com/cortezaproject/corteza-server/pkg/auth"
"go.uber.org/zap"
)
type (

View File

@ -245,7 +245,7 @@ func (r *runner) serve(ctx context.Context) (err error) {
{
wg.Add(1)
go func(ctx context.Context) {
r.httpApiServer.Serve(actionlog.RequestOriginToContext(ctx, actionlog.RequestOrigin_HTTPServer_API_REST))
r.httpApiServer.Serve(actionlog.RequestOriginToContext(ctx, actionlog.RequestOrigin_API_REST))
wg.Done()
}(ctx)
}
@ -253,7 +253,7 @@ func (r *runner) serve(ctx context.Context) (err error) {
if r.grpcServer != nil {
wg.Add(1)
go func(ctx context.Context) {
r.grpcServer.Serve(actionlog.RequestOriginToContext(ctx, actionlog.RequestOrigin_HTTPServer_API_GRPC))
r.grpcServer.Serve(actionlog.RequestOriginToContext(ctx, actionlog.RequestOrigin_API_GRPC))
wg.Done()
}(ctx)

View File

@ -42,6 +42,7 @@ func (ctrl *Actionlog) List(ctx context.Context, r *request.ActionlogList) (inte
To: r.To,
ActorID: payload.ParseUInt64s(r.ActorID),
Resource: r.Resource,
Action: r.Action,
PageFilter: rh.Paging(r),
})