RANGER-5709: Fix KMS secure download for roles, tags, and userstore - #1114
Merged
Conversation
Use getServiceByNameForDP() for KMS services in RoleREST, TagREST, and XUserREST secure download paths, matching policy download behavior.
Assert RoleREST uses getServiceByNameForDP() for KMS services.
ramackri
requested review from
kumaab,
mneethiraj,
pradeepagrawal8184,
rameeshm and
vikaskr22
July 28, 2026 16:48
rameeshm
approved these changes
Jul 28, 2026
rameeshm
approved these changes
Jul 28, 2026
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.
Summary
KMS plugin users (e.g.
rangerkms) were getting HTTP 400 on secure roles, tags, and userstore download. Those endpoints calledgetServiceByName(), which requires keyadmin to read a KMS service—before the download allowlist is checked.Policy download already uses
getServiceByNameForDP()for KMS. This PR applies the same pattern to:RoleREST.getSecureRangerRolesIfUpdated()policy.download.auth.usersTagREST.getSecureServiceTagsIfUpdated()tag.download.auth.usersXUserREST.getSecureRangerUserStoreIfUpdated()userstore.download.auth.usersTest changes
test52,test54) to expectgetServiceByNameForDP()test17eGetSecureRangerRolesIfUpdatedKmsUsesServiceByNameForDPTest plan
TestTagRESTKMS secure download testsTestRoleREST#test17eKMS secure roles downloadTestRoleREST#test17*regressionTestXUserREST#test142regressionsecurity-adminhttps://issues.apache.org/jira/browse/RANGER-5709