-
Notifications
You must be signed in to change notification settings - Fork 348
Feature/extensions bwc setting #3180
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
Changes from all commits
11d70ba
14d243e
1ec0cf0
771513b
8e5d58c
49ca97b
ce96b6a
752dd9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -320,6 +320,11 @@ public enum RolesMappingResolution { | |
| public static final String TENANCY_GLOBAL_TENANT_NAME = "global"; | ||
| public static final String TENANCY_GLOBAL_TENANT_DEFAULT_NAME = ""; | ||
|
|
||
| // CS-SUPPRESS-SINGLE: RegexpSingleline get Extensions Settings | ||
| public static final String EXTENSIONS_BWC_PLUGIN_MODE = "bwcPluginMode"; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
wdyt about calling this setting
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just initiated the run of CI. I doubt the naming including 'EXTENSIONS' gonna pass the lint task, since we do have restrictions of using it.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @samuelcostae You can suppress the enforcement of that check like this: https://github.com/opensearch-project/security/blob/5e8f12ce5afe95f2f510cddf2a5b2cf50c076a66/src/main/java/org/opensearch/security/OpenSearchSecurityPlugin.java#L1931C1-L1935
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've included the supression comments, but shouldn't rename it anyway?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that should be fine since this mode is targeting for the usage of the extension. |
||
| public static final boolean EXTENSIONS_BWC_PLUGIN_MODE_DEFAULT = false; | ||
| // CS-ENFORCE-SINGLE | ||
|
|
||
| public static Set<String> getSettingAsSet( | ||
| final Settings settings, | ||
| final String key, | ||
|
|
||
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.
@DarshitChanpura i wonder if just keeping the format used a few lines above would be ok, or if for the backwards compatibility to work we should keep the exact format currently used when adding to the Context:
StringJoiner joiner = new StringJoiner("|"); joiner.add(user.getName()); joiner.add(String.join(",", user.getRoles())); joiner.add(String.join(",", Sets.union(user.getSecurityRoles(), mappedRoles)));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.
I think the idea behind this is to send backend roles unencrypted if its in backwards compatibility mode. Can you please elaborate on
keep the exact same format?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.
The code snipped above that i pasted in the above post is how the back end roles are added to the context (joinined with " | " symbol and adding the user's name at the begininng ).
My question if we should populate using the same format as the plugins might be expecting/parsing that exact format and could fail if the joiner character is different.
(Im not aware if this is the case or not)
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.
Ah I see, this is only for token parsing so we should be good with the format you have in this PR. @RyanL1997 Can you confirm?