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

Question: How to get MethodOptions from an RPC request? #1938

Closed
nate-meta opened this issue Mar 22, 2018 · 1 comment
Closed

Question: How to get MethodOptions from an RPC request? #1938

nate-meta opened this issue Mar 22, 2018 · 1 comment

Comments

@nate-meta
Copy link

nate-meta commented Mar 22, 2018

I am using interceptors to perform additional validation based on the optional extensions set on an RPC on incoming and out going RPCs. Given the following gRPC schema:

extend google.protobuf.MethodOptions {
  string my_option = 50006;
}

service MyService {
  rpc Foo (FooRequest) returns (FooResponse) {
    option (my_option) = "foo"
  }
}

How do I go about getting the value of my_option? At first I had thought to get it from the request using this. However, as this is a MethodOptions it doesn't seem that its part of the descriptor. Thoughts?

@jhump
Copy link
Member

jhump commented Mar 22, 2018

@nate-meta: see the code example in #1526.

@dfawley dfawley closed this as completed Mar 29, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Sep 26, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants