Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authz: add additional logs to sdk authz #5094

Merged
merged 8 commits into from Feb 18, 2022
2 changes: 2 additions & 0 deletions authz/sdk_server_interceptors.go
Expand Up @@ -62,6 +62,7 @@ func (i *StaticInterceptor) UnaryInterceptor(ctx context.Context, req interface{
err := i.engines.IsAuthorized(ctx)
if err != nil {
if status.Code(err) == codes.PermissionDenied {
logger.Infof("%v", err)
ashithasantosh marked this conversation as resolved.
Show resolved Hide resolved
return nil, status.Errorf(codes.PermissionDenied, "unauthorized RPC request rejected")
}
return nil, err
Expand All @@ -76,6 +77,7 @@ func (i *StaticInterceptor) StreamInterceptor(srv interface{}, ss grpc.ServerStr
err := i.engines.IsAuthorized(ss.Context())
if err != nil {
if status.Code(err) == codes.PermissionDenied {
logger.Infof("%v", err)
return status.Errorf(codes.PermissionDenied, "unauthorized RPC request rejected")
}
return err
Expand Down