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

add grpc-web gateways for REST access to Journal and Shard APIs #400

Merged
merged 3 commits into from
Sep 23, 2024

Conversation

jgraettinger
Copy link
Contributor

@jgraettinger jgraettinger commented Sep 16, 2024

Use the github.com/grpc-ecosystem/grpc-gateway project to automatically generate REST handlers for portions of the Journals and Shards gRPC services.

Also implement a CORS wrapper with configurable allowed origins. Together these changes allow Gazette brokers and consumers to be directly queried by browsers in cross-origin contexts.

Note that REST handlers automatically forward Authorization: Bearer tokens into their corresponding gRPC handlers, so authorization checks "just work".


This change is Reviewable

Use the `github.com/grpc-ecosystem/grpc-gateway` project to
automatically generate REST handlers for portions of the Journals
and Shards gRPC services.

Also implement a CORS wrapper with configurable allowed origins.
Together these changes allow Gazette brokers and consumers to be
directly queried by browsers in cross-origin contexts.

Note that REST handlers automatically forward `Authorization: Bearer`
tokens into their corresponding gRPC handlers, so authorization checks
"just work".
Allow consumers applications to provide a function which wraps around a
raw net.Listener and a loaded *tls.Config, returning another
net.Listener, in order to customize the manner in which net.Conn
instances are accepted and built.
@jgraettinger jgraettinger marked this pull request as ready for review September 20, 2024 05:32
Copy link
Contributor

@psFried psFried left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jgraettinger jgraettinger merged commit 7392043 into master Sep 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants