-
Notifications
You must be signed in to change notification settings - Fork 53
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
Adding service address and auth info #20
Comments
Yeah, I think that's a good idea - strip the scheme, any path segments included, and include just the host name. Since there can be multiple server objects and we have no way of automatically picking "the right one", we'd probably want to set up a "sane default" like "the first server object is used" (which produces the generated proto you shared). We could have a plugin parameter to override this with a raw value. Also, since there can be variables anywhere in the value, we will need to resolve those with the defaults... As far as auth...I'm not sure how to handle this. The Service config is not for client consumption, but rather the surrounding API management systems. The proto |
This is an interesting long-term goal. As @noahdietz noted, gRPC HTTP/JSON transcoding doesn't include auth information, but it's true that service.proto supports at least some of the schemes that can be specified. This seems pretty strongly associated with API management systems and the OpenAPI spec is probably the only thing they have in common. So maybe it's best to leave this information in the OpenAPI spec. (Ideally, if it's possible for gnostic-grpc to generate the right protos, gRPC HTTP/JSON transcoding would produce an API that matches the original OpenAPI spec, so that spec would still be valid) |
@timburks you mentioned here that we should add additional information to the generated output.
Service address:
An example input file might look like this:
input.yaml: (OpenAPI spec)
An example output file generated by gnostic-grpc might look like this:
output.proto: (Proto Buf file)
We can use the
default_host
service option for that.Auth info:
Essentially, we want the information of a security scheme object reflected inside the generated proto file.
How should this object be represented inside the generated output file?
As far as I understand, for Google Cloud, one could define a service configuration where additional information (i.e.: authentication) can be provided. This config maps to the service.proto where also the mentioned auth.proto is defined.
We see that for HTTP rules it does not matter whether we define them inside the service config or inside the proto file, however this does not seem to be possible for other configurations.
@timburks and @noahdietz additional input would be helpful.
The text was updated successfully, but these errors were encountered: