Closed cliu123 closed 2 years ago
Security plugin has to downgrade to OpenSearch 2.0.0 because of this issue: https://github.com/opensearch-project/security/pull/1882
@tlfeng I think you know what it is :), could be related to https://github.com/opensearch-project/OpenSearch/commit/ab478ba5f33d45b98a3dd2b12038680d443cc1e1 ?
could be related to https://github.com/opensearch-project/OpenSearch/commit/ab478ba5f33d45b98a3dd2b12038680d443cc1e1
@reta 😄 It's not likely related to the parsing change in Node Sniffer, because the change is limited to the Sniffer, and Sniffer is a separate library based on Rest Client, which is not used by security plugin. All json format data is parsed by fasterxml.jackson
in the code.
@reta @tlfeng Thanks for checking the issue! Security plugin has downgraded to OpenSearch 2.1.0 where this issue doesn't exist. Please let us know when the root cause gets identified and the issue gets fixed. We're happy to verify the fix.
👀
In my point of view, the error JsonParseException
is not the fail reason because there is the same error in 2.0.0.
The actual cause for the test failure is PR#3524, commit https://github.com/opensearch-project/OpenSearch/commit/fc8803fe5f34b948a888365851cc46e320b40f81.
In create document API:
In version 2.0.1 and above, "type" parameter is accepted, but will be ignored.
In version 2.0.0, "type" parmater is not accepted.
The failure occurs in this test case, and maybe it should be adjusted for OpenSearch 2.0.1 and 2.1.0 .
https://github.com/opensearch-project/security/blob/2.0.0.0/src/test/java/org/opensearch/security/dlic/rest/api/RolesMappingApiTest.java#L344-L345
The error message for the actual test failure is:
java.lang.AssertionError: expected:<400> but was:<200>
at org.junit.Assert.fail(Assert.java:89)
at org.junit.Assert.failNotEquals(Assert.java:835)
at org.junit.Assert.assertEquals(Assert.java:647)
at org.junit.Assert.assertEquals(Assert.java:633)
at org.opensearch.security.dlic.rest.api.AbstractRestApiUnitTest.checkWriteAccess(AbstractRestApiUnitTest.java:226)
at org.opensearch.security.dlic.rest.api.RolesMappingApiTest.checkAllSfAllowed(RolesMappingApiTest.java:345)
at org.opensearch.security.dlic.rest.api.RolesMappingApiTest.testRolesMappingApi(RolesMappingApiTest.java:308)
...
Thanks @xuezhou25 @dreamer-89 @tlfeng for helping with this issue!
Draw a conclusion here, looks like security plugin have to do nothing with the test, since the behavior of "type" parameter in the REST API is changed back to the same as 2.0.0 in the commit https://github.com/opensearch-project/OpenSearch/commit/6462a546240f6d7a158519499729bce12dc1058b, "type" is not allowed as a parameter.
Draw a conclusion here, looks like security plugin have to do nothing with the test, since the behavior of "type" parameter in the REST API is changed back to the same as 2.0.0 in the commit 6462a54, "type" is not allowed as a parameter.
A quick clarification on the conclusion: The fix in security plugin tests is a part of the version bump PR.
Describe the bug JSON is not parsed properly by Jackson.
To Reproduce
The failing GHA: https://github.com/opensearch-project/security/runs/6807080046?check_suite_focus=true
One of the failing tests: https://github.com/opensearch-project/security/blob/f431ec2201e1466b7c12528347a1f54cf64387c9/src/test/java/org/opensearch/security/dlic/rest/api/RolesMappingApiTest.java#L51
Running the test reproduces the issue.
Plugins Security plugin
Additional context Stacktrace: