-
Notifications
You must be signed in to change notification settings - Fork 348
[HTTP/2] Functional Test cases #2367
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,7 +125,8 @@ public void testCcs() throws Exception { | |
| Assert.assertTrue(ccs.getBody().contains("salary1")); | ||
| Assert.assertFalse(ccs.getBody().contains("secret1")); | ||
| Assert.assertFalse(ccs.getBody().contains("AnotherSecredField")); | ||
| Assert.assertFalse(ccs.getBody().contains("xxx1")); Assert.assertEquals(ccs.getHeaders().toString(), 1, ccs.getHeaders().size()); | ||
| Assert.assertFalse(ccs.getBody().contains("xxx1")); | ||
| Assert.assertEquals(ccs.getHeaders().toString(), 2, ccs.getHeaders().size()); | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There are 2 headers now: content type and content length |
||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -183,7 +184,7 @@ public void testCcsDifferentConfig() throws Exception { | |
| Assert.assertTrue(ccs.getBody().contains("__fn__crl2")); | ||
| Assert.assertFalse(ccs.getBody().contains("secret1")); | ||
| Assert.assertFalse(ccs.getBody().contains("AnotherSecredField")); | ||
| Assert.assertEquals(ccs.getHeaders().toString(), 1, ccs.getHeaders().size()); | ||
| Assert.assertEquals(ccs.getHeaders().toString(), 2, ccs.getHeaders().size()); | ||
| } | ||
|
|
||
| @Test | ||
|
|
@@ -265,6 +266,6 @@ public void testCcsDifferentConfigBoth() throws Exception { | |
| Assert.assertFalse(ccs.getBody().contains("secret1")); | ||
| Assert.assertFalse(ccs.getBody().contains("AnotherSecredField")); | ||
| Assert.assertTrue(ccs.getBody().contains("someoneelse")); | ||
| Assert.assertEquals(ccs.getHeaders().toString(), 1, ccs.getHeaders().size()); | ||
| Assert.assertEquals(ccs.getHeaders().toString(), 2, ccs.getHeaders().size()); | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,14 +77,20 @@ protected RestClient buildClient(Settings settings, HttpHost[] hosts) throws IOE | |
| // create adminDN (super-admin) client | ||
| File file = new File(getClass().getClassLoader().getResource(CERT_FILE_DIRECTORY).getFile()); | ||
| Path configPath = PathUtils.get(file.toURI()).getParent().toAbsolutePath(); | ||
| return new SecureRestClientBuilder(settings, configPath).setSocketTimeout(60000).build(); | ||
| return new SecureRestClientBuilder(settings, configPath) | ||
| .setSocketTimeout(60000) | ||
| .setConnectionRequestTimeout(180000) | ||
|
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be fixed by opensearch-project/common-utils#287 but needs manual setting now
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we wait until that issue has been published? or we can create a tracker issue that reverts this change once common-utils publishes an artifact with that change
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No action is needed: this change is good, it may just be redundant after opensearch-project/common-utils#287 but keeping it is fine, thanks. |
||
| .build(); | ||
| } | ||
|
|
||
| // create client with passed user | ||
| String userName = System.getProperty("user"); | ||
| String password = System.getProperty("password"); | ||
|
|
||
| return new SecureRestClientBuilder(hosts, isHttps(), userName, password).setSocketTimeout(60000).build(); | ||
| return new SecureRestClientBuilder(hosts, isHttps(), userName, password) | ||
| .setSocketTimeout(60000) | ||
| .setConnectionRequestTimeout(180000) | ||
| .build(); | ||
| } | ||
| else { | ||
| RestClientBuilder builder = RestClient.builder(hosts); | ||
|
|
||
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.
Curious, is there a way for a cluster admin to force HTTP/1? Would that ever be valid or desired as a config setting?
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.
Hm ... this is a good question, I don't see why one would do that intentionally, but the
RestClientBuildercould force HTTP/1.1, see please [1] fe[1] https://github.com/opensearch-project/security/pull/2367/files#diff-25d921c48bb0ef8fb56806d0d9cbed23e72f8e9b275a9ec606bc6be78cecb37eR192