-
Notifications
You must be signed in to change notification settings - Fork 143
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 to hidden model code to use OPENDISTRO_SECURITY_USER instad of ssl principal #1897
Conversation
…f ssl principal Signed-off-by: Bhavana Ramaram <[email protected]>
Signed-off-by: Bhavana Ramaram <[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.
Add a unit test with non-LDAP super admin name and check if it validates using adminUserNames
Object userObject = client.threadPool().getThreadContext().getTransient(OPENDISTRO_SECURITY_USER); | ||
if (userObject == null) | ||
return false; | ||
ObjectMapper objectMapper = new ObjectMapper(); |
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.
Rather than creating an ObjectMapper for every execution can this be part of class variable?
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.
makes sense
boolean isAdmin = adminUsernames.contains(dn); | ||
return isAdmin; |
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.
Nit: can directly adminUsernames.contains(dn);
rather than first assigning to a variable?
@@ -73,7 +77,10 @@ public class RestActionUtils { | |||
public static final String OPENDISTRO_SECURITY_CONFIG_PREFIX = "_opendistro_security_"; | |||
public static final String OPENDISTRO_SECURITY_SSL_PRINCIPAL = OPENDISTRO_SECURITY_CONFIG_PREFIX + "ssl_principal"; |
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.
Can be removed, this is no longer used.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #1897 +/- ##
=========================================
Coverage 82.61% 82.62%
- Complexity 5383 5387 +4
=========================================
Files 521 521
Lines 21715 21719 +4
Branches 2210 2211 +1
=========================================
+ Hits 17940 17945 +5
+ Misses 2878 2877 -1
Partials 897 897
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Bhavana Ramaram <[email protected]>
Signed-off-by: Bhavana Ramaram <[email protected]>
…f ssl principal (#1897) * changes to hidden model code to use OPENDISTRO_SECURITY_USER instad of ssl principal Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit de59efc)
…f ssl principal (opensearch-project#1897) * changes to hidden model code to use OPENDISTRO_SECURITY_USER instad of ssl principal Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit de59efc)
…f ssl principal (#1897) (#1900) * changes to hidden model code to use OPENDISTRO_SECURITY_USER instad of ssl principal Signed-off-by: Bhavana Ramaram <[email protected]> (cherry picked from commit de59efc)
…f ssl principal (opensearch-project#1897) * changes to hidden model code to use OPENDISTRO_SECURITY_USER instad of ssl principal Signed-off-by: Bhavana Ramaram <[email protected]>
Description
changes to hidden model code to use OPENDISTRO_SECURITY_USER instad of ssl principal
Issues Resolved
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.