Maxim Dounin
July 17, 2019 07:50AM
Hello!

On Tue, Jul 16, 2019 at 04:23:17PM -0400, bmacphee wrote:

> I appreciate the suggestion but it doesn't look like this is possible to
> solve with these modules. The authentication part happens as a sub-request,
> and the response provided by sub request influences how the gRPC part is
> handled at the top level. Unless I can figure out some way to pass
> variables from the sub request and handle things differently... I don't
> know.
>
> If I return 200, the request proceeds as if it were authorized. This is
> bad.

The gRPC protocol fails to follow HTTP status code semantics, and
all responses in gRPC use status code 200. For details see protocol
specification here:

https://github.com/grpc/grpc/blob/master/doc/PROTOCOL-HTTP2.md

How a particular response will be handled by a client depends on
the "grpc-status" response header. You can add one with the
"add_header" nginx configuration directive.

Note that it might be non-trivial to find out which grpc-status
codes should be used, as the "specification" in question fails to
define them. Status codes seems to be listed - and with some
descriptions - here in the grpc sources:

https://github.com/grpc/grpc/blob/master/include/grpc/impl/codegen/status.h

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

request authorization with grpc (failure status code)

bmacphee July 02, 2019 11:19AM

Re: request authorization with grpc (failure status code)

Maxim Dounin July 02, 2019 09:18PM

Re: request authorization with grpc (failure status code)

bmacphee July 16, 2019 04:23PM

Re: request authorization with grpc (failure status code)

Maxim Dounin July 17, 2019 07:50AM

Re: request authorization with grpc (failure status code)

bmacphee July 17, 2019 08:22AM

Re: request authorization with grpc (failure status code)

bmacphee July 17, 2019 08:35AM

Re: request authorization with grpc (failure status code)

bmacphee July 17, 2019 08:32AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 224
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready