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 #15035

Closed
wants to merge 1 commit into from

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 597747d from #15016.

… perform the method (#15016)

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

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* private

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Surround with doPrivileged

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create ThreadContextAccess

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create notion of ThreadContextPermission

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add to test-framework.policy file

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Mark as internal

Signed-off-by: Craig Perkins <cwperx@amazon.com>

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 597747d)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
*/
public void markAsSystemContext() {
SecurityManager sm = System.getSecurityManager();
Copy link
Collaborator

@reta reta Jul 31, 2024

Choose a reason for hiding this comment

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

As we discussed (#15016 (comment)), we need to make this change backward compatible

Copy link
Contributor

✅ Gradle check result for aa182af: SUCCESS

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 78.26087% with 5 lines in your changes missing coverage. Please review.

Project coverage is 71.55%. Comparing base (e5e1bad) to head (aa182af).
Report is 6 commits behind head on 2.x.

Files Patch % Lines
.../opensearch/secure_sm/ThreadContextPermission.java 50.00% 2 Missing ⚠️
...ch/common/util/concurrent/ThreadContextAccess.java 71.42% 2 Missing ⚠️
...ensearch/common/util/concurrent/ThreadContext.java 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #15035      +/-   ##
============================================
+ Coverage     71.48%   71.55%   +0.06%     
- Complexity    62677    62733      +56     
============================================
  Files          5123     5125       +2     
  Lines        294480   294538      +58     
  Branches      42912    42921       +9     
============================================
+ Hits         210518   210747     +229     
+ Misses        66286    66147     -139     
+ Partials      17676    17644      -32     

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

@cwperks
Copy link
Member

cwperks commented Jul 31, 2024

@reta opened a manual backport with the deprecation logger change here: #15038

@reta
Copy link
Collaborator

reta commented Jul 31, 2024

Closing in favour of #15038

@reta reta closed this Jul 31, 2024
@andrross andrross deleted the backport/backport-15016-to-2.x branch October 17, 2024 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants