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

[Backport 2.x] Add ThreadContextPermission for markAsSystemContext and allow core to perform the method #15038

Merged
merged 2 commits into from
Jul 31, 2024

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jul 31, 2024

Manual backport of #15016 to 2.x that includes a change to add a deprecation logger to the ThreadContext class and log a message for prohibited use of markAsSystemContext as discussed here.

… perform the method (opensearch-project#15016)

* Add RuntimePermission for markAsSystemContext and allow core to perform the method

Signed-off-by: Craig Perkins <[email protected]>

* private

Signed-off-by: Craig Perkins <[email protected]>

* Surround with doPrivileged

Signed-off-by: Craig Perkins <[email protected]>

* Create ThreadContextAccess

Signed-off-by: Craig Perkins <[email protected]>

* Create notion of ThreadContextPermission

Signed-off-by: Craig Perkins <[email protected]>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

* Add javadoc

Signed-off-by: Craig Perkins <[email protected]>

* Add to test-framework.policy file

Signed-off-by: Craig Perkins <[email protected]>

* Mark as internal

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Copy link
Contributor

✅ Gradle check result for 33c87c0: SUCCESS

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 74.07407% with 7 lines in your changes missing coverage. Please review.

Project coverage is 71.62%. Comparing base (e5e1bad) to head (33c87c0).
Report is 6 commits behind head on 2.x.

Files Patch % Lines
...ensearch/common/util/concurrent/ThreadContext.java 62.50% 2 Missing and 1 partial ⚠️
.../opensearch/secure_sm/ThreadContextPermission.java 50.00% 2 Missing ⚠️
...ch/common/util/concurrent/ThreadContextAccess.java 71.42% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #15038      +/-   ##
============================================
+ Coverage     71.48%   71.62%   +0.14%     
- Complexity    62677    62819     +142     
============================================
  Files          5123     5125       +2     
  Lines        294480   294542      +62     
  Branches      42912    42921       +9     
============================================
+ Hits         210518   210978     +460     
+ Misses        66286    65902     -384     
+ Partials      17676    17662      -14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@reta reta added the v2.17.0 label Jul 31, 2024
@reta reta merged commit 04757db into opensearch-project:2.x Jul 31, 2024
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants