-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Add new OAuth2RequestInterceptor to remove deprecated open feign classes #16011
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
Add new OAuth2RequestInterceptor to remove deprecated open feign classes #16011
Conversation
@wing328 don't understand the changes for ./bin/generate-samples.sh with the FakeApi.cs. |
Thanks for the PR. Is it correct to say that you added Why not add it as an option in the spring generator? (for example, I don't think the Groovy client generator supports this new option) |
No strong opinion on that can move it, if you want. I just see that some generator have hardcoded resource folder. So I thought maybe they also want to use in future this resource folder option, but also fine for me to move it. How can I change the doc for spring.md? If I change the spring.md all mds are changed after the export docs? |
spring.md is autogenerated. you will need to update the code (e.g. option description) in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/SpringCodegen.java#L194 |
Your intention is good 👍 We want to avoid escalations saying certain option is not working in the generators so we will instead add the option to the supported generators one by one. |
@wing328 fixed |
Fix #8561 and #16023
The project
spring-cloud-starter-oauth2
is EOL and there is no replacement see issue spring-cloud/spring-cloud-openfeign#417One approach to replace the classes is described here: https://stackoverflow.com/questions/63283022/feign-and-spring-security-5-client-credentials
This PR implements the idea for the open feign client for open api generator.
This PR BREAKS the current implementation and the clients need to be migrated
Migration guide:
Solution 1:
Replace the old properties and set the new properties:
Solution 2:
From the open api some properties are generated. So there is a new property file
oauth2-client.properties
.In this property file the same information are generated as before so
authorization-grant-type
,token-uri
,authorizationUrl
are used directly from the yaml file.If you would like to reuse this information, just import the Configuration file into you application
@Import( { ClientPropertiesConfiguration.class} )
or use directly
@PropertySource( "classpath:/oauth2-client.properties" )
Then replace all old properties to this new properties:
With this PR, the resource folder for the property file can now also be changed in the maven plugin. Default is
src/main/resources/
Open points: Where should the migration guide be added?
PR checklist
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*
.For Windows users, please run the script in Git BASH.
7.0.x
(breaking changes without fallbacks)@cachescrubber (2022/02) @welshm (2022/02) @MelleD (2022/02) @atextor (2022/02) @manedev79 (2022/02) @javisst (2022/02) @borsch (2022/02) @banlevente (2022/02) @Zomzog (2022/09)