Ranger 5730: Restrict role import createNonExist flag to roles only - #1142
Open
eoinmcdonnell113 wants to merge 2 commits into
Open
Ranger 5730: Restrict role import createNonExist flag to roles only#1142eoinmcdonnell113 wants to merge 2 commits into
eoinmcdonnell113 wants to merge 2 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
RANGER-5730: Restrict createNonExistUserGroupRole during role import so it creates missing nested roles only, and does not create missing users or groups.
Previously, importRolesFromFile with createNonExistUserGroupRole=true treated users, groups, and nested roles the same way. That forced creation of missing users/groups during role import, which is undesirable for large synced environments.
This change:
Splits create-missing behavior in RoleRefUpdater into separate controls for users/groups vs nested roles
Updates RoleREST.importRolesFromFile so createNonExistUserGroupRole=true means create missing nested roles only (createNonExistUserGroup=false)
Leaves existing create/update role API behavior (createNonExistUserGroup) unchanged
How was this patch tested?
Unit tests:
TestRoleRefUpdater — verifies missing users are not created when only role creation is enabled, and missing nested roles are scheduled for creation
TestRoleREST — verifies import passes (createNonExistUserGroup=false, createNonExistRole=true) when the import flag is true
TestRoleDBStore — existing create/update role coverage
Focused run result: TestRoleRefUpdater, TestRoleDBStore, and TestRoleREST — 102 tests passed (0 failures)