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

Allow configuring how Stork-based REST clients are mapped to requests #25423

Closed
knutwannheden opened this issue May 6, 2022 · 3 comments · Fixed by #27629
Closed

Allow configuring how Stork-based REST clients are mapped to requests #25423

knutwannheden opened this issue May 6, 2022 · 3 comments · Fixed by #27629

Comments

@knutwannheden
Copy link
Contributor

Description

Currently, a REST client can be configured to use Stork by using a base URL with the stork scheme. As a result the REST client will replace the URL scheme and hostname with whatever is returned by the Stork.getInstance().getService() call. For some use cases it may however be necessary to further "rewrite" the request. E.g.

  • modify the URL path
  • add a query parameter
  • add a HTTP header

Some details regarding our use case: We use Azure API Management (an "API gateway"), which supports multiple versions for the registered APIs. To allow the API gateway to select the backend, the version needs to be included in the request. The version can be supplied as part of the URL path, a query parameter, or an HTTP header.

Implementation ideas

Possibly a dedicated SPI could be provided, using which clients can construct or modify a RequestOptions object.

@quarkus-bot
Copy link

quarkus-bot bot commented May 6, 2022

/cc @michalszynkiewicz

@michalszynkiewicz
Copy link
Member

CC @aureamunoz @cescoffier @Sgitario

@cescoffier
Copy link
Member

@aureamunoz @michalszynkiewicz discussed this issue.
The plan is to move the Stork management code into an HTTP request filter. Then, you can implement another filter (executed after the one from stork) to configure what you need.

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

Successfully merging a pull request may close this issue.

3 participants