Backport: Removing hidden/reserved roles added via rolesmapping#595
Backport: Removing hidden/reserved roles added via rolesmapping#595debjanibnrj wants to merge 1 commit intoopensearch-project:opendistro-1.8from
Conversation
Earlier the InternalUsers API was filtering out all hidden/reserved roles. We will just restrict it to hidden/reserved roles associated via rolesmapping. This will ensure behaviour of rolesmapping and internalusers API is the same. (cherry picked from commit 6c1f002)
Codecov Report
@@ Coverage Diff @@
## opendistro-1.8 #595 +/- ##
====================================================
+ Coverage 62.74% 62.78% +0.03%
- Complexity 2972 2974 +2
====================================================
Files 228 228
Lines 16370 16375 +5
Branches 2971 2972 +1
====================================================
+ Hits 10272 10281 +9
+ Misses 4550 4548 -2
+ Partials 1548 1546 -2
Continue to review full report at Codecov.
|
hardik-k-shah
left a comment
There was a problem hiding this comment.
We should not allow non-superadmin to update user or rolemapping if
(1) role is hidden
(2) if role mapping is hidden
(3) if role mapping is reserved
Any thoughts on #1 --> If role is hidden, that means superadmin doesn't want anyone to see that role and hence we should not allow anyone to update role-mapping or role-mapping field (for a hidden role)
...ava/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/InternalUsersApiAction.java
Show resolved
Hide resolved
...ava/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/InternalUsersApiAction.java
Show resolved
Hide resolved
...ava/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/InternalUsersApiAction.java
Show resolved
Hide resolved
src/test/java/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/UserApiTest.java
Show resolved
Hide resolved
src/test/java/com/amazon/opendistroforelasticsearch/security/dlic/rest/api/UserApiTest.java
Show resolved
Hide resolved
Added #1 as part of the following issue https://github.com/opendistro-for-elasticsearch/security/issues/590. I will need to update both the rolesmapping and internalusers API to accomodate this use case. |
|
I have addressed comments for this review as part of https://github.com/opendistro-for-elasticsearch/security/pull/614 (@hardik-k-shah). Will close this PR and address comments in #614 before backporting. |
Earlier the InternalUsers API was filtering out all hidden/reserved roles. We will just restrict it to hidden/reserved roles associated via rolesmapping. This will ensure behaviour of rolesmapping and internalusers API is the same.
(cherry picked from commit 6c1f002)
Issue #, if available:
Description of changes:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.