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

[Backport 2.x] [BUG] Fix roles verification for roles mapping and internal users #3282

Merged
merged 1 commit into from
Sep 1, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 53f64b9 from #3278.

)

The resent refactoring of the REST APIs:
#3123 introduce a
regression in how roles-mapping verification has worked before.
The old solution verified only hidden roles both for internal users and
roles mapping, while new was too strict and forbid to do it for both.

This PR fixes the problem and uses the same logic as it was before.

- In case of roles-mapping it verifies only a role associated with it
that the role is not hidden.
- In case of internal users it verifies that a role is not hidden and
roles-mapping associated with the role is mutable

So verification was split and added to the corresponding ActionApi class
which is more convenient as it was before.

Signed-off-by: Andrey Pleskach <[email protected]>
(cherry picked from commit 53f64b9)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@codecov
Copy link

codecov bot commented Sep 1, 2023

Codecov Report

Merging #3282 (15f9902) into 2.x (1d6b5bf) will increase coverage by 0.02%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##                2.x    #3282      +/-   ##
============================================
+ Coverage     63.08%   63.11%   +0.02%     
- Complexity     3345     3349       +4     
============================================
  Files           256      256              
  Lines         19430    19437       +7     
  Branches       3279     3284       +5     
============================================
+ Hits          12258    12268      +10     
  Misses         5575     5575              
+ Partials       1597     1594       -3     
Files Changed Coverage Δ
...security/dlic/rest/api/InternalUsersApiAction.java 77.45% <100.00%> (+2.45%) ⬆️
.../security/dlic/rest/api/RolesMappingApiAction.java 97.05% <100.00%> (ø)
...curity/dlic/rest/validation/EndpointValidator.java 94.20% <100.00%> (-0.25%) ⬇️

... and 3 files with indirect coverage changes

@cwperks cwperks merged commit b856568 into 2.x Sep 1, 2023
@cwperks cwperks deleted the backport/backport-3278-to-2.x branch September 1, 2023 13:39
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.

1 participant