--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/41222d23-9b8e-4fad-a068-d0ce0cfd6484%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You need to use a ServerInterceptor. Typically the interceptor will do any necessary decoding, and then put the result in a io.grpc.Context (using also io.grpc.Contexts.interceptorCall) for the handler to access.Consider the case of Authentication: the interceptor would verify the user's identity and then put the verified identity on the Context. This greatly reduces the chances that a method may fail to verify the user's identity and instead just blindly trusted the client to be who they said they were.
On Thu, Jun 29, 2017 at 8:04 AM, <wbvre...@gmail.com> wrote:
Hi All,I'm a newbie with regards to gRPC and have been reading and searching a lot the last couple of days, but I can't seem to find the right answer. I have a service definition in my proto that looks like this:/// Requests a function to be executed as specified in the header.rpc ExecuteFunction (stream BundledRows) returns (stream BundledRows) {}So in the generated code I get:public io.grpc.stub.StreamObserver<net.reeuwijk.qlik.aai.regexp.BundledRows> executeFunction(io.grpc.stub.StreamObserver<net.reeuwijk.qlik.aai.regexp.BundledRows> responseObserver) {Which is expected. However in the code of this method I need access to header information. In the Python implementation I can get this from the context. I have looked at adding an HeaderInterceptor, but this looks way to complicated :-)So my question. In order to get the metadata out of the headers do I need to use the HeaderInterceptor? or is there another way?Any hints, tips or trips are highly appreciated.Regards,Bas van Reeuwijk
--
You received this message because you are subscribed to the Google Groups "grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+u...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscribe@googlegroups.com.
To post to this group, send email to grp...@googlegroups.com.
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/6a817f04-8d15-41ae-86f4-4093ef9489d7%40googlegroups.com.