2024-10-11 14:58:36: merge [master:7f99b95ceaaed865d2833070a0397cf191949b8e];
This commit is contained in:
1 parent
6db18c1495
commit
97c44fb3bd
26 files changed
+235
-266
No files matched your search
+6
-6
@@ -11,12 +11,12 @@ import (
|
||||
"isp-gate-service/httperrors"
|
||||
"isp-gate-service/request"
|
||||
|
||||
"github.com/integration-system/isp-kit/grpc"
|
||||
"github.com/integration-system/isp-kit/grpc/client"
|
||||
"github.com/integration-system/isp-kit/grpc/isp"
|
||||
"github.com/integration-system/isp-kit/json"
|
||||
"github.com/integration-system/isp-kit/requestid"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/txix-open/isp-kit/grpc"
|
||||
"github.com/txix-open/isp-kit/grpc/client"
|
||||
"github.com/txix-open/isp-kit/grpc/isp"
|
||||
"github.com/txix-open/isp-kit/json"
|
||||
"github.com/txix-open/isp-kit/requestid"
|
||||
_ "google.golang.org/genproto/googleapis/rpc/errdetails"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/metadata"
|
||||
@@ -70,7 +70,7 @@ func (p Grpc) Handle(ctx *request.Context) error {
|
||||
|
||||
md := metadata.MD{
|
||||
grpc.ProxyMethodNameHeader: {ctx.Endpoint()},
|
||||
grpc.RequestIdHeader: {requestid.FromContext(ctx.Context())},
|
||||
requestid.RequestIdHeader: {requestid.FromContext(ctx.Context())},
|
||||
}
|
||||
if !p.skipAuth {
|
||||
authData, err := ctx.GetAuthData()
|
||||
|
||||
+5
-5
@@ -12,9 +12,9 @@ import (
|
||||
"isp-gate-service/httperrors"
|
||||
"isp-gate-service/request"
|
||||
|
||||
"github.com/integration-system/isp-kit/grpc"
|
||||
"github.com/integration-system/isp-kit/requestid"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/txix-open/isp-kit/grpc"
|
||||
"github.com/txix-open/isp-kit/requestid"
|
||||
"golang.org/x/net/context"
|
||||
)
|
||||
|
||||
@@ -91,7 +91,7 @@ func (p Http) Handle(ctx *request.Context) error {
|
||||
}
|
||||
|
||||
func setHttpHeaders(ctx *request.Context, header http.Header, skipAuth bool) error {
|
||||
header.Set(grpc.RequestIdHeader, requestid.FromContext(ctx.Context()))
|
||||
header.Set(requestid.RequestIdHeader, requestid.FromContext(ctx.Context()))
|
||||
if !skipAuth {
|
||||
authData, err := ctx.GetAuthData()
|
||||
if err != nil {
|
||||
@@ -102,9 +102,9 @@ func setHttpHeaders(ctx *request.Context, header http.Header, skipAuth bool) err
|
||||
header.Set(grpc.ServiceIdHeader, strconv.Itoa(authData.ServiceId))
|
||||
header.Set(grpc.ApplicationIdHeader, strconv.Itoa(authData.ApplicationId))
|
||||
if ctx.IsAdminAuthenticated() {
|
||||
header.Set(xAdminIdHeader, strconv.Itoa(ctx.AdminId()))
|
||||
header.Set(xAdminIdHeader, strconv.Itoa(ctx.AdminId())) //nolint:canonicalheader
|
||||
} else {
|
||||
header.Del(xAdminIdHeader)
|
||||
header.Del(xAdminIdHeader) //nolint:canonicalheader
|
||||
}
|
||||
}
|
||||
return nil
|
||||
|
||||
Reference in new issue
Block a user