Add ThreadContextPermission for markAsSystemContext and allow core to perform the method#15016
Merged
reta merged 10 commits intoopensearch-project:mainfrom Jul 31, 2024
Merged
Conversation
…rm the method Signed-off-by: Craig Perkins <cwperx@amazon.com>
reta
pushed a commit
that referenced
this pull request
Jul 31, 2024
…d allow core to perform the method (#15038) * Add ThreadContextPermission for markAsSystemContext and allow core to 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> * Add deprecationLogger Signed-off-by: Craig Perkins <cwperx@amazon.com> --------- Signed-off-by: Craig Perkins <cwperx@amazon.com>
This was referenced Jul 31, 2024
harshavamsi
pushed a commit
to harshavamsi/OpenSearch
that referenced
this pull request
Aug 20, 2024
… perform the method (opensearch-project#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>
wdongyu
pushed a commit
to wdongyu/OpenSearch
that referenced
this pull request
Aug 22, 2024
… perform the method (opensearch-project#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>
This was referenced Sep 6, 2024
This was referenced Apr 14, 2025
This was referenced Jan 9, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR replaces a previous PR and takes a different approach to protect methods in the ThreadContext class. Instead of changing the access modifier, this PR shows how permissions can be declared to protect methods within the ThreadContext class that should not be accessible outside of the core without explicit permission.
With this change, plugins would be able to utilize the method but permission needs to be granted through an entry in the
plugin-security.policyfile. The permissions would be:Related Issues
Resolves #14931
Check List
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.