-
Notifications
You must be signed in to change notification settings - Fork 16
Improve httpclient 4->5 AuthScheme-related migration #85
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
Conversation
src/main/java/org/openrewrite/apache/httpclient5/MigrateBasicSchemeFactory.java
Outdated
Show resolved
Hide resolved
7a97bb4
to
eed273e
Compare
I've converted it all to declarative as we can simply use |
…f `DeleteMethodArgument` now does the maybeRemoveImport.
@@ -61,6 +61,13 @@ recipeList: | |||
- org.openrewrite.apache.httpclient5.UpgradeApacheHttpClient_5_TimeUnit | |||
- org.openrewrite.apache.httpclient5.StatusLine | |||
- org.openrewrite.apache.httpclient5.MigrateAuthScope | |||
- org.openrewrite.java.DeleteMethodArgument: |
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.
Because the first draft of that change was in its own recipe we had to include a description.
description: RFC 7616 mandates the use of UTF-8. This constructor is now deprecated and httpclient v5 ignores any provided charset, ensuring that only UTF-8 is used.
The recipeList:
items doesn't support being documented with a description. Has it ever been considered?
It could be useful for example in this case where the recipe called is very generic, and the recipe name + arguments don't provide enough context to explain why we're doing that transformation.
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.
Great to see how simple this has become with the changes upstream; thanks for the (re)work!
What's changed?
The main
UpgradeApacheHttpClient_5
declarative recipe now:BasicSchemeFactory()
andDigestSchemeFactory()
constructors usage to remove the deprecated argument use.AuthSchemeProvider
andAuthSchemes
with their new names.AuthScheme.getSchemeName()
toAuthScheme.getName()
What's your motivation?
Fix a reported issue with missing auth migrations in http client.
Any additional context
The Apache HttpClient release notes and migration guide are missing many renamed classes, methods, etc. Hence adding more support as required.
Checklist