eclipse-vertx / eclipse-vertx/vertx-grpc

Support generation/configuration of more google api protos

Open
#127 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Java
Stars
53
Forks
36
Avg merge
7h 37m
Merged PRs (30d)
64

Description

#### Feature Description

Vertx-grpc users could benefit from Google API protos. The Google common protos provide not only google.api.http (currently used for transcoding) but also [google.api.auth](https://github.com/googleapis/googleapis/blob/master/google/api/auth.proto), [google.api.context](https://github.com/googleapis/googleapis/blob/master/google/api/context.proto), and [google.api.resource](https://github.com/googleapis/googleapis/blob/master/google/api/resource.proto).

#### Use Cases

##### google.api.auth
The google.api.auth is essentially JWT configuration. If implemented, it would likely depend on this PR: https://github.com/eclipse-vertx/vertx-grpc/pull/75, though additional work might be needed to allow method level configuration. This feature would be particularly useful now that HTTP/1 support enables calling gRPC methods from browsers, where JWTs are commonly used.

##### google.api.context and google.api.resource
When implementing resource based authorization (e.g., project/{projectId}/resource/{resourceId}) with fine grained access control (such as project admin, project member roles), I wanted to avoid implementing checks in each method by passing arguments from the request. While I used GrpcServerInterceptor as a workaround, I had to deserialize requests and perform various operations to make it work. This process could be simplified by passing resources defined by these annotations (or defining them by hand) to the Vert.x context. This should be executed before AuthenticationHandlers (implemented in the JWT PR) are called so they can make use of this. Also, this feature heavily depends if we would want to implement only resource context or other types of context like for example defined [here](https://github.com/googleapis/googleapis/blob/master/google/rpc/context/attribute_context.proto). This feature should probably work in the way where it would collect values based on the configuration and pass them to vert.x context.

##### openapiv2.proto

Also with the addition of grpc transcoding it might be nice to give a thought if we would like to support openapi specification generation or not https://github.com/grpc-ecosystem/grpc-gateway/blob/main/protoc-gen-openapiv2/options/openapiv2.proto

##### google.api.method_signature

This might be particularly useful for clients as it would allow client to generate sort of helper methods so that user is not required to create new object but the method would create and send the object instead. More information can be found in [google aips](https://google.aip.dev/client-libraries/4232)

#### Contribution

I am willing to contribute time to this project. However, there is a question about whether the JWT PR will be completed. If not, either I or another contributor would need to take over, finish it, and potentially implement google.api.auth in the gRPC protoc generator.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.