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

When using google.api.http annotations, some paths are reserved for internal use #11

Open
rjhuijsman opened this issue Nov 27, 2024 · 0 comments

Comments

@rjhuijsman
Copy link

rjhuijsman commented Nov 27, 2024

What is the limitation?

In Reboot, legacy gRPC service methods can specify google.api.http annotations that permit that gRPC method to be called as a JSON API. For example:

service MyService {
  rpc MyWebhook(MyWebhookRequest) returns (MyWebhookResponse) {
    option (google.api.http) = {
      post: "/my/webhook/path"
    };
  }

However, Reboot reserves some paths for internal use. Specifically, the following paths cannot be used by an application:

  • / (but more-specific sub-paths like /foo are OK).
  • /__/** (where ** means "whatever follows")

Reboot applications must avoid using reserved paths in their google.api.http annotations.

How do I know if I've hit this limitation?

If an application attempts to use a reserved path, an error will be output before the application starts:

Error parsing `google.api.http` options for `myapp.v1.MyService.MyMethod`.
  - Path `/__/is/reserved` is reserved for internal use by Reboot and cannot be used by the application. 
    See https://github.com/reboot-dev/reboot/issues/11 for more information, and to provide feedback.

What do I do if I've hit this limitation?

1. Send feedback!

Please comment below, and share your use-case! We prioritize work based on user feedback, so letting us know that this limitation is affecting you, and why, helps us get the most important issues dealt with first!

2. Consider solutions or workarounds

Using an alternative path

Consider whether there is an alternative path that could work for the method. For example, instead of using /__/my/path, would it be possible to use /__internal__/my/path?

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

No branches or pull requests

1 participant