-
-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Jersey2: Move setting of authentication parameters before generating target URL to consider API keys in URL parameters #20688
base: master
Are you sure you want to change the base?
Conversation
3c4d925
to
790bc5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @jheyens, thanks for the PR!
modules/openapi-generator/src/main/resources/Java/libraries/jersey2/ApiClient.mustache
Show resolved
Hide resolved
…L to consider API keys in URL parameters
790bc5e
to
39c24d0
Compare
@martin-mfg Could you rerun the CirceCI-Checks? node0 failed due to something that looks like a connection error? |
I reran the pipelines in martin-mfg#69, and they are all green. I can't trigger a rerun here because only maintainers can do this. But the confirmation from the rerun in my fork should be enough. |
Hi @martin-mfg, I am not entirely sure if I did everything required to merge this PR and #20687. Github shows me both " ✔️ 1 approval" but also "7 workflows awaiting approval". Do I need to do anything else or are we waiting for a maintainer to approve and merge this? |
There's nothing for you to do. We just need to wait for a maintainer to merge your PRs. |
A bug in ApiClient.musache causes API-keys to be ignored when generating from an OpenAPI-specification file with an ApiKey securityScheme:
The generated code applies the query parameters to the WebTarget at ApiClient.mustache:1235, but the query parameters do not yet contain the API-key parameter, which is only added afterwards in ApiClient.mustache:1271.
The fix proposed in this PR is to apply all authentication settings before adding query parameters, resulting in query-parameter-based authentication schemes being added to the target URL.
PR checklist
Commit all changed files.
This is important, as CI jobs will verify all generator outputs of your HEAD commit as it would merge with master.
These must match the expectations made by your contribution.
You may regenerate an individual generator by passing the relevant config(s) as an argument to the script, for example
./bin/generate-samples.sh bin/configs/java*
.IMPORTANT: Do NOT purge/delete any folders/files (e.g. tests) when regenerating the samples as manually written tests may be removed.
master
(upcoming7.x.0
minor release - breaking changes with fallbacks),8.0.x
(breaking changes without fallbacks)@bbdouglas @sreeshas @jfiala @lukoyanov @cbornet @jeff9finger @karismann @Zomzog @lwlee2608 @martin-mfg