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

Extensions interface #1243

Closed
johanbrandhorst opened this issue Apr 27, 2020 · 3 comments
Closed

Extensions interface #1243

johanbrandhorst opened this issue Apr 27, 2020 · 3 comments
Labels

Comments

@johanbrandhorst
Copy link
Collaborator

Starting following discussion in multipart-upload issue #410 (comment).

We'd like to support user extensions to the gateway for issues like these that are unlikely to be added to the gateway itself but could be useful to users. The PoC implementation of a multipart upload extension will serve as a base for understanding what such an interface could look like.

Quoting @majelbstoat:

Extension to protoc-gen-grpc-gateway to support custom annotations, which probably mean pluggability. Similar to go_out=plugins=grpc:lib/golang/src maybe (although the grpc plugin is apparently going away)?

  • A way of adding a plugin to the gateway
  • Some kind of hook/handler sub-system that gives plugins the opportunity to pre-empt standard behaviour. I don't want to go too nuts too early on, but actually wrapping up some things like annotateMetadata, withOutgoingHeaderMatcher, withIncomingHeader matcher into plugins would make a lot of sense too. Meaning, having just one way of customising the gateway – plugins – rather than having to add one-off functions that perhaps have to do multiple jobs. That would be nice for composability.
  • A set of interfaces for capturing which hooks the plugin intends to implement.
    Maybe support for plugins messing with swagger data?
    Given that I understand the 2.0.0 plan is to move to a new pb implementation, anything that touches the proto gen stuff for now seems apt to become outdated. Perhaps the best place to start actually is a PoC for converting some existing points of customisation here to a plugin architecture? And then we can deal with the complexities of annotation stuff etc later on?

I think we should start smaller - see if we can do this without any changes to the generators at all. Imagine a runtime.WithExtension(thing) which would encapsulate all the functionality.

  • Do we require generator changes?
  • If we want to avoid generator plugins, how would the generated files have to change?
@srenatus
Copy link
Contributor

Stuff we'd love to use grpc-gateway for that we right now can't:

For the download bits, I could imagine that httpbody responses are somehow concatenated; but at any rate, I wonder how this could be turned into an extension.

@majelbstoat
Copy link

Some recent life issues mean I can't give this the attention I wanted, for at least the immediate future, sorry :(

@stale
Copy link

stale bot commented Jul 24, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants