Skip to content
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

Upgrade json-smart from 2.4.2 to 2.4.7 #1299

Merged
merged 9 commits into from
Jun 28, 2021

Conversation

cliu123
Copy link
Member

@cliu123 cliu123 commented Jun 24, 2021

opensearch-security pull request intake form

Please provide as much details as possible to get feedback/acceptance on your PR quickly

  1. Category: (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)
    Maintenance

  2. Github Issue # or road-map entry, if available:

  3. Description of changes:

  4. Why these changes are required?

  5. What is the old behavior before changes and new behavior after changes? (Please add any example/logs/screen-shot if available)

  6. Testing done: (Please provide details of testing done: Unit testing, integration testing and manual testing)

  7. TO-DOs, if any: (Please describe pending items and provide Github issues# for each of them)

  8. Is it backport from main branch? (If yes, please add backport PR # and commits #)

By making a contribution to this project, I certify that:

(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or

(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or

(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.

(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.

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.

@cliu123 cliu123 added the maintenance Project maintenance label Jun 24, 2021
@cliu123 cliu123 requested a review from a team June 24, 2021 16:17
@codecov-commenter
Copy link

codecov-commenter commented Jun 24, 2021

Codecov Report

Merging #1299 (d83faa6) into main (4abbafc) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1299      +/-   ##
============================================
- Coverage     64.73%   64.70%   -0.03%     
  Complexity     3194     3194              
============================================
  Files           247      247              
  Lines         17230    17230              
  Branches       3045     3045              
============================================
- Hits          11153    11149       -4     
- Misses         4528     4532       +4     
  Partials       1549     1549              
Impacted Files Coverage Δ
...org/opensearch/security/rest/TenantInfoAction.java 77.94% <0.00%> (-10.30%) ⬇️
...security/configuration/DlsFlsFilterLeafReader.java 60.47% <0.00%> (+0.70%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4abbafc...d83faa6. Read the comment docs.

pom.xml Outdated
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>accessors-smart</artifactId>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is necessary?

Copy link
Member Author

@cliu123 cliu123 Jun 25, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json-smart-2.4.5 introduces accessors-smart-2.4.3 that is not available in Maven Central. Had to have accessors-smart remain 2.4.2.

Failed to execute goal on project opensearch-security: Could not resolve dependencies for project org.opensearch:opensearch-security:jar:1.0.0.0-rc1: Could not find artifact net.minidev:accessors-smart:jar:2.4.3 in central (https://repo.maven.apache.org/maven2) -> [Help 1]

Failing CI: https://github.com/opensearch-project/security/runs/2906736355?check_suite_focus=true

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

accessors-smart-2.4.3.jar is missing at here. But accessors-smart-2.4.2.jar is available.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Created an issue: netplex/json-smart-v2#76

pom.xml Outdated
@@ -131,6 +131,11 @@
<dependency>
<groupId>net.minidev</groupId>
<artifactId>json-smart</artifactId>
<version>2.4.5</version>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not to upgrade json-smart to 2.4.7 that is more widely used compared to 2.4.5?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, it will be better to remove the dependency on json-smart completely.

Copy link
Member Author

@cliu123 cliu123 Jun 28, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Additionally, it will be better to remove the dependency on json-smart completely.
Tried replacing json-smart with Jackson, but Jackson automatically wraps the values in Json with quotes, which fails the tests currently relying on json-smar. The following is the failure:

org.junit.ComparisonFailure: 
Expected :{"http_certificates_list":"[{issuer_dn=CN=Example Com Inc. Signing CA,OU=Example Com Inc. Signing CA,O=Example Com Inc.,DC=example,DC=com, subject_dn=CN=node-1.example.com,OU=SSL,O=Test,L=Test,C=DE, san=[[2, node-1.example.com], [2, localhost], [7, 127.0.0.1], [8, 1.2.3.4.5.5]], not_before=2020-02-17T16:19:25Z, not_after=2022-02-16T16:19:25Z}]","transport_certificates_list":"[{issuer_dn=CN=Example Com Inc. Signing CA,OU=Example Com Inc. Signing CA,O=Example Com Inc.,DC=example,DC=com, subject_dn=CN=node-1.example.com,OU=SSL,O=Test,L=Test,C=DE, san=[[2, node-1.example.com], [2, localhost], [7, 127.0.0.1], [8, 1.2.3.4.5.5]], not_before=2020-02-17T16:19:25Z, not_after=2022-02-16T16:19:25Z}]"}
Actual   :{"http_certificates_list":[{"issuer_dn":"CN=Example Com Inc. Signing CA,OU=Example Com Inc. Signing CA,O=Example Com Inc.,DC=example,DC=com","subject_dn":"CN=node-1.example.com,OU=SSL,O=Test,L=Test,C=DE","san":"[[2, node-1.example.com], [2, localhost], [7, 127.0.0.1], [8, 1.2.3.4.5.5]]","not_before":"2020-02-17T16:19:25Z","not_after":"2022-02-16T16:19:25Z"}],"transport_certificates_list":[{"issuer_dn":"CN=Example Com Inc. Signing CA,OU=Example Com Inc. Signing CA,O=Example Com Inc.,DC=example,DC=com","subject_dn":"CN=node-1.example.com,OU=SSL,O=Test,L=Test,C=DE","san":"[[2, node-1.example.com], [2, localhost], [7, 127.0.0.1], [8, 1.2.3.4.5.5]]","not_before":"2020-02-17T16:19:25Z","not_after":"2022-02-16T16:19:25Z"}]}

Probably Jackson is not the answer. Will need explore more options.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cliu123 I don't see why jackson is not an option. The expected is not properly constructed.

@cliu123 cliu123 changed the title Upgrade json-smart from 2.4.2 to 2.4.5 Upgrade json-smart from 2.4.2 to 2.4.7 Jun 28, 2021
@andy840314 andy840314 self-requested a review June 28, 2021 22:35
@cliu123 cliu123 merged commit e341bd5 into opensearch-project:main Jun 28, 2021
@cliu123 cliu123 deleted the upgrade_json-smart branch June 28, 2021 22:38
cliu123 added a commit to cliu123/security that referenced this pull request Sep 21, 2021
cliu123 added a commit to cliu123/security that referenced this pull request Sep 21, 2021
cliu123 added a commit to cliu123/security that referenced this pull request Sep 22, 2021
cliu123 pushed a commit to cliu123/security that referenced this pull request Sep 22, 2021
nsri19 pushed a commit to nsri19/security that referenced this pull request Nov 18, 2021
…#1299)

(cherry picked from commit e341bd5)

Signed-off-by: Nidhi Sridhar <srnidhi@amazon.com>
nsri19 pushed a commit to nsri19/security that referenced this pull request Nov 18, 2021
…#1299)

(cherry picked from commit e341bd5)

Signed-off-by: Nidhi Sridhar <srnidhi@amazon.com>
nsri19 added a commit that referenced this pull request Nov 19, 2021
(cherry picked from commit e341bd5)

Signed-off-by: Nidhi Sridhar <srnidhi@amazon.com>

Co-authored-by: Chang Liu <lc12251109@gmail.com>
lbreinig pushed a commit to lbreinig/security that referenced this pull request Dec 23, 2021
wuychn pushed a commit to ochprince/security that referenced this pull request Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintenance Project maintenance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants