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

bwcPluginMode and extensionDistinguishedNames to ext settings #8040

Conversation

samuelcostae
Copy link

@samuelcostae samuelcostae commented Jun 13, 2023

Description

Draft PR to trigger checks
Added bwcPluginMode and extensionDistinguishedNames settings to extension settings.

Related Issues

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

samuelcostae and others added 2 commits June 13, 2023 15:02
…ion settings.

Signed-off-by: scosta <samuel.costa@eliatra.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Copy link
Member

@cwperks cwperks left a comment

Choose a reason for hiding this comment

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

Hi @samuelcostae, it should be possible now to define security settings for extensions from the security plugin by making the security plugin an ExtensionAwarePlugin. These settings can be defined from the security plugin.

This extension point is similar to Plugin.getSettings() which allow plugins to extend the default settings inside opensearch.yml and add settings and define defaults.

See how the security plugin overrides getSettings() to add settings that should be placed in opensearch.yml here: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java#L898-L1095

@samuelcostae
Copy link
Author

samuelcostae commented Jun 15, 2023

Hi @samuelcostae, it should be possible now to define security settings for extensions from the security plugin by making the security plugin an ExtensionAwarePlugin. These settings can be defined from the security plugin.

This extension point is similar to Plugin.getSettings() which allow plugins to extend the default settings inside opensearch.yml and add settings and define defaults.

See how the security plugin overrides getSettings() to add settings that should be placed in opensearch.yml here: https://github.com/opensearch-project/security/blob/main/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java#L898-L1095

Thanks @cwperks

So both extensionDistiguishedNames and bwcPluginMode are relevant to the security plugin only, and core's codebase doesn't need to be aware of it , is that correct?

Initially I had started by modifying the SecurityPlugin to read from extensions.yml, but then thought it would be better to define all extension settings in the same place as they seemed generic enough to not be security only, but if that is not the case, makes sense to have these two separate in the SecurityPlugin.


I have one question about the override getExtensionSettings() Does it automatically have access to all setting files loaded by Core during bootstrap? Or do I need to specify the files similarly to the Dynamic Configs?

@cwperks
Copy link
Member

cwperks commented Jun 15, 2023

Hi @samuelcostae, ExtensionAwarePlugin.getExtensionSettings() is intended to be used to define settings that should be placed in extensions.yml from a plugin aware of extensions. In this case, I created that extension point in this PR to give the security plugin flexibility to define settings that should be placed in extensions.yml and organized to make it clear that they are settings defined and used for security purposes.

One of the benefits of being able to define and use settings that the security plugin needs from the security plugin is that they would only be defined and utilized in a single repository which decouples core and the security plugin. Since extensions would be released experimental at first, it would allow the security plugin the flexibility to change settings if needed from a single place instead of requiring PRs in multiple repositories.

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.

None yet

2 participants