-
Notifications
You must be signed in to change notification settings - Fork 281
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
Migrate to Apache HttpClient / Core 5.x #2166
Migrate to Apache HttpClient / Core 5.x #2166
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
…s needed by OpenSAML Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
…sedSSLConfiguratorTest to v4 Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
requestConfig = RequestConfig.copy(requestConfig).setLocalAddress(inetAddress).build(); | ||
} | ||
} | ||
// TODO Can this be removed? |
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.
If this is unused, yes remove it.
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.
And we can do this for any unused public members under src/integrationTest
build.gradle
Outdated
@@ -394,7 +398,7 @@ dependencies { | |||
testImplementation 'org.springframework:spring-beans:5.3.20' | |||
testImplementation 'org.junit.jupiter:junit-jupiter:5.8.2' | |||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.2' | |||
testImplementation "org.opensearch:common-utils:${common_utils_version}" | |||
testImplementation "org.opensearch:common-utils:${opensearch_version}" |
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.
Could not resolve org.opensearch:common-utils:3.0.0-SNAPSHOT
We need this for the integration test dependenices? It seems like we might need to hold off on this change until we can update common-utils first :/
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.
When new artifacts are available I will re-trigger the CI
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.
org.opensearch.commons.rest.SecureRestClientBuilder
fails as it is not compatible with v5. Common-utils has a open PR: opensearch-project/common-utils#281 out to address this
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Update remaining tests to use http client 5
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider); | ||
httpClientBuilder.setConnectionManager(cm); | ||
// Attempt to resolve org.apache.hc.core5.http.ParseException: Invalid protocol version | ||
httpClientBuilder.setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_1); |
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.
@cwperks I will look at this one, we should good with HTTP/2 at this point
src/main/java/com/amazon/dlic/util/SettingsBasedSSLConfigurator.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/auditlog/sink/WebhookSink.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/auditlog/sink/WebhookSink.java
Outdated
Show resolved
Hide resolved
src/main/java/org/opensearch/security/auditlog/sink/WebhookSink.java
Outdated
Show resolved
Hide resolved
Yes, unless this PR missed the mark on the migration somewhere. I was looking at your PR in core (opensearch-project/OpenSearch#4459) and the migration guide provided by apache to find the right analogs in v5 to migrate to. Please push directly on this branch with any changes you think are appropriate. I was not able to resolve the |
…bhookSink Signed-off-by: Craig Perkins <[email protected]>
I will take a look at it, could you please add me as collaborator to your branch (I think I do not have permissions to push there), thank you. |
@reta I just added you as a collaborator - you should have received an invite. |
There are some follow-ups but I'd rather do that with a building main - great work @cwperks |
@peternied fix on the way, hold on please |
…rsion Signed-off-by: Andriy Redko <[email protected]>
Signed-off-by: Andriy Redko <[email protected]>
@peternied all set. @cwperks great work! |
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.
Thank you for the help @reta! |
This PR contains changes related to migration to Apache HttpClient and Core 5.x from 4.x with changes that fix build failures. The security plugin needs to retain support for v4 http client for SAML because of the class SamlHTTPMetadataResolver which extends OpenSAML and OpenSAML has a dependency on v4. Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Darshit Chanpura <[email protected]> Signed-off-by: Andriy Redko <[email protected]> Signed-off-by: Stephen Crawford <[email protected]>
Signed-off-by: Craig Perkins [email protected]
Description
This PR contains changes related to migration to Apache HttpClient and Core 5.x from 4.x with changes that fix build failures. The security plugin needs to retain support for v4 http client for SAML because of the class
SamlHTTPMetadataResolver
which extends OpenSAML and OpenSAML has a dependency on v4.CI will fail until new artifacts for common-utils are available after this PR is merged - opensearch-project/common-utils#281
I updated
build.gradle
to keep opensearch and common-utils in sync, this can be changed back if needed but to get CI working for this PR it needs to reference the latest distribution build.Enhancement
Issues Resolved
Related to opensearch-project/OpenSearch#4256, security plugin needs to upgrade as well
Addresses: 2165
Testing
CI
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.