-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Extensions] Add ExtensionAwarePlugin extension point to add custom settings for extensions #7526
[Extensions] Add ExtensionAwarePlugin extension point to add custom settings for extensions #7526
Conversation
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Craig Perkins <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Craig Perkins <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Craig Perkins <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since security is a plugin for OpenSearch. This design LGTM! Later, if we decide security to be an extension we can utilize getSettings
extension point from SDK to register the settings coming from security.
server/src/test/java/org/opensearch/extensions/ExtensionsManagerTests.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Craig Perkins <[email protected]>
Gradle Check (Jenkins) Run Completed with:
|
Signed-off-by: Craig Perkins <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thanks @cwperks for the changes!
Gradle Check (Jenkins) Run Completed with:
|
@owaiskazi19 @reta Can this be merged if there are no outstanding questions? This should be backported to 2.x. |
The merge is blocked by unresolved conversations, could you please resolve them? Thank you. |
All comments have now been marked as resolved |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7526-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 277eb3d59fb9edcae8575577ec135032e3563f2e
# Push it to GitHub
git push --set-upstream origin backport/backport-7526-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x Then, create a pull request where the |
@cwperks may need manual backport sadly ... |
On it |
…ettings for extensions (opensearch-project#7526) * WIP on extension settings Signed-off-by: Craig Perkins <[email protected]> * Use getExtensionSettings from the identity service Signed-off-by: Craig Perkins <[email protected]> * Add extension scoped settings and add area for additional settings Signed-off-by: Craig Perkins <[email protected]> * Run spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Change contructor to take list of additionalSettings Signed-off-by: Craig Perkins <[email protected]> * One constructor Signed-off-by: Craig Perkins <[email protected]> * Remove isAuthenticated Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Create ExtensionAwarePlugin extension point Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Compute additionalSettingsKeys outside of loop Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Add comment Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit 277eb3d)
Opened up backport PR: #7756 |
…to add custom settings for extensions (#7526) (#7756) * [Extensions] Add ExtensionAwarePlugin extension point to add custom settings for extensions (#7526) * WIP on extension settings Signed-off-by: Craig Perkins <[email protected]> * Use getExtensionSettings from the identity service Signed-off-by: Craig Perkins <[email protected]> * Add extension scoped settings and add area for additional settings Signed-off-by: Craig Perkins <[email protected]> * Run spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Change contructor to take list of additionalSettings Signed-off-by: Craig Perkins <[email protected]> * One constructor Signed-off-by: Craig Perkins <[email protected]> * Remove isAuthenticated Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Create ExtensionAwarePlugin extension point Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Compute additionalSettingsKeys outside of loop Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Add comment Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> (cherry picked from commit 277eb3d) * Fix conflicts Signed-off-by: Craig Perkins <[email protected]> * Switch versions Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
…ettings for extensions (opensearch-project#7526) * WIP on extension settings Signed-off-by: Craig Perkins <[email protected]> * Use getExtensionSettings from the identity service Signed-off-by: Craig Perkins <[email protected]> * Add extension scoped settings and add area for additional settings Signed-off-by: Craig Perkins <[email protected]> * Run spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Change contructor to take list of additionalSettings Signed-off-by: Craig Perkins <[email protected]> * One constructor Signed-off-by: Craig Perkins <[email protected]> * Remove isAuthenticated Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Create ExtensionAwarePlugin extension point Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Compute additionalSettingsKeys outside of loop Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Add comment Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
…ettings for extensions (opensearch-project#7526) * WIP on extension settings Signed-off-by: Craig Perkins <[email protected]> * Use getExtensionSettings from the identity service Signed-off-by: Craig Perkins <[email protected]> * Add extension scoped settings and add area for additional settings Signed-off-by: Craig Perkins <[email protected]> * Run spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Change contructor to take list of additionalSettings Signed-off-by: Craig Perkins <[email protected]> * One constructor Signed-off-by: Craig Perkins <[email protected]> * Remove isAuthenticated Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Create ExtensionAwarePlugin extension point Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Compute additionalSettingsKeys outside of loop Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Add comment Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
…ettings for extensions (opensearch-project#7526) * WIP on extension settings Signed-off-by: Craig Perkins <[email protected]> * Use getExtensionSettings from the identity service Signed-off-by: Craig Perkins <[email protected]> * Add extension scoped settings and add area for additional settings Signed-off-by: Craig Perkins <[email protected]> * Run spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Change contructor to take list of additionalSettings Signed-off-by: Craig Perkins <[email protected]> * One constructor Signed-off-by: Craig Perkins <[email protected]> * Remove isAuthenticated Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Create ExtensionAwarePlugin extension point Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Compute additionalSettingsKeys outside of loop Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Add comment Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
…ettings for extensions (opensearch-project#7526) * WIP on extension settings Signed-off-by: Craig Perkins <[email protected]> * Use getExtensionSettings from the identity service Signed-off-by: Craig Perkins <[email protected]> * Add extension scoped settings and add area for additional settings Signed-off-by: Craig Perkins <[email protected]> * Run spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Change contructor to take list of additionalSettings Signed-off-by: Craig Perkins <[email protected]> * One constructor Signed-off-by: Craig Perkins <[email protected]> * Remove isAuthenticated Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Create ExtensionAwarePlugin extension point Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Compute additionalSettingsKeys outside of loop Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Add comment Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]>
…ettings for extensions (opensearch-project#7526) * WIP on extension settings Signed-off-by: Craig Perkins <[email protected]> * Use getExtensionSettings from the identity service Signed-off-by: Craig Perkins <[email protected]> * Add extension scoped settings and add area for additional settings Signed-off-by: Craig Perkins <[email protected]> * Run spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * spotlessApply Signed-off-by: Craig Perkins <[email protected]> * Change contructor to take list of additionalSettings Signed-off-by: Craig Perkins <[email protected]> * One constructor Signed-off-by: Craig Perkins <[email protected]> * Remove isAuthenticated Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Re-run CI Signed-off-by: Craig Perkins <[email protected]> * Create ExtensionAwarePlugin extension point Signed-off-by: Craig Perkins <[email protected]> * Update CHANGELOG Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Compute additionalSettingsKeys outside of loop Signed-off-by: Craig Perkins <[email protected]> * Address code review feedback Signed-off-by: Craig Perkins <[email protected]> * Add comment Signed-off-by: Craig Perkins <[email protected]> --------- Signed-off-by: Craig Perkins <[email protected]> Signed-off-by: Shivansh Arora <[email protected]>
Description
This creates a new extension point inside of IdentityPlugin called
getExtensionSettings
that allows this singular plugin to define settings that should be placed inextensions.yml
that are needed for security. This creates a new scope for settings called theExtension
scope that means that these particular settings should be placed inextensions.yml
and pertain to an extension. I first implemented this without using scoped settings, but ultimately chose to use Scoped Settings similar to getPlugin.getSettings()
works. Using ScopeSettings, defaults can be assigned to the settings within the implementation of thegetExtensionSettings()
method.Related Issues
opensearch-project/security#2746
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.