-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
cmd/protoc-gen-go-grpc: export consts for full method names #5886
Conversation
f756e1b
to
8971c5e
Compare
We looked at the generated code in other languages, and none of them seem to be export constants for full method names. So, we are inclined towards not making this change in Go alone. I remember you mentioned that you are trying to implement an authz plugin and hence need constants for full method names. gRPC does have an authz implementation. Did you take a look at it? Does it not meet your needs? If so, why and is that something that we can discuss. Thanks. |
Hi @easwars thanks for taking the time to review! I understand the wish to try and keep exported symbols consistent across plugins/languages, although I'd like to first see if we agree on the utility of the proposed symbols. I'm happy to look into the existing authz package and discuss, I was not aware of it. Are you referring to this experimental package (https://pkg.go.dev/google.golang.org/grpc@v1.51.0/authz)? Or someting else? If it is the one above, I've just looked into the code/tests, and focusing on the
What do you think? PS: I've gone ahead and replaced the example to just use the authz package |
a2a75ea
to
344b4a7
Compare
Changing method names in the proto is a breaking API change for the service being exposed and I feel that we shouldn't be trying to solve that problem. As far as typos are concerned, can't these be handled with some unit tests? If the policy is maintained as a file (and version controlled), one could add some pre-submit and post-submit tests to ensure that the policy file is sane. What do you think about this approach? I will bring this topic up with the greater gRPC team in the new year (once we have a quorum) and will provide an update here. |
Hi @easwars happy new year :) thanks for bringing this up with the team. |
@KenxinKun : I have just initiated a discussion with the greater gRPC team about this. Will update when I have something to share. In the meantime, we do have an open issue to add an example for the authz pacakge. See: #5900. Do you mind splitting the example you have here as a separate PR and sending that our for review. We will be happy to review that in the mean time. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the changes!
Thank you very much for your contribution !! |
Thanks for the feedback and the sweet merge! |
Original issue: #5876
Changes:
cmd/protoc-gen-go-grpc/grpc.go
command to export additional symbols for all full method paths. Existing behaviour is untouched beyond the additional symbols.*.pb.go
Remaining questions
All feedback welcome! :)
RELEASE NOTES: N/A