This repository was archived by the owner on Sep 16, 2022. It is now read-only.
Expose current service/method in the Context#129
Open
danjacques wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
Open
Expose current service/method in the Context#129danjacques wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
danjacques wants to merge 1 commit intoGoogleCloudPlatform:masterfrom
Conversation
Add EndpointInfo() method to pull the ServiceInfo and MethodInfo of the current endpoint out of the Context. Defer generation of the context to after the service/method have been identified. This prevents unnecessary setup operations (including AppEngine binding), until after the request is verified to be referencing a valid endpoint.
Contributor
|
Wondering if there's any intent to pull this? It would be super-handy for centralizing more advanced authorization logic (like fine-grained group membership/ACL checks). In fact, if there was a way to get the validated/decoded request body too, that would be fantastic. I'd like to have a static mapping of endpoint->authorization_functions and be able to ensure that it is applied consistently to all endpoint handlers within a given service. Right now I have to copypasta boilerplate (with duplicated method names to do map lookups) at the top of each endpoint handler... always nervous that we'll add/modify a handler and the boilerplate will have a bug (point at the wrong method, handle the error improperly, omit the boilerplate entirely, etc.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add EndpointInfo() method to pull the ServiceInfo and MethodInfo of the
current endpoint out of the Context.
Defer generation of the context to after the service/method have been
identified. This prevents unnecessary setup operations (including
AppEngine binding), until after the request is verified to be
referencing a valid endpoint.
This is a focused landing of the embedding portion of #125 built on top of #126 as requested.