Thread ResolvedIntent through findMissingPrivileges - #5493
Merged
flyrain merged 1 commit intoSep 11, 2026
Merged
Conversation
Follow-up to apache#5486: pass the ResolvedIntent object down through authorizeRbacOrThrow into findMissingPrivileges instead of destructuring it into separate targets/secondaries arguments, so the resolved structure can evolve without churning these signatures. The public isAuthorized overloads keep their existing signatures and construct a ResolvedIntent internally, so there is no public API change. Behavior-preserving. Related to apache#5491
flyingImer
approved these changes
Sep 11, 2026
Contributor
Author
|
Thanks @flyingImer for the review and approval! Since @flyrain originally proposed this refactoring, tagging you here for a final review and sign off. |
flyrain
approved these changes
Sep 11, 2026
flyrain
left a comment
Contributor
There was a problem hiding this comment.
+1 thanks @ZephyrYWZhou !
dimas-b
approved these changes
Sep 11, 2026
Contributor
|
Thanks @ZephyrYWZhou for the refactor. Thanks @flyingImer @dimas-b for the review! |
Contributor
Author
|
Thanks @flyrain! |
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
Follow-up to #5486, addressing @flyrain's review suggestion: thread the
ResolvedIntentobject down intofindMissingPrivileges()instead of destructuring it into separatetargets/secondariesarguments, so the resolved structure can evolve in the future without churning the intermediate signatures.Tracked in #5491. That issue lists a second, larger follow-up (having each
AuthorizationIntentexpose its own securables to remove the resolver's per-type dispatch); this PR intentionally does only thefindMissingPrivilegesthreading and leaves the other item for a separate PR.Changes
PolarisAuthorizerImpl.authorizeRbacOrThrowandfindMissingPrivilegesnow take a singleAuthorizationIntentResolver.ResolvedIntentinstead of separate@Nullable List<PolarisResolvedPathWrapper> targets, secondaries.authorizeIntentpasses theResolvedIntentstraight through instead of destructuring it at the call site.findMissingPrivilegesreadstargets/secondariesfrom the object at the top; the rest of its logic is unchanged.isAuthorized(...)overloads keep their existing signatures and construct aResolvedIntentinternally, so there is no public API change.Behavior
No behavioral change. The same resolved targets/secondaries are evaluated; only the parameter shape changed. Nullability is preserved — the carrier is
@NonNull, while itstargets/secondariesremain@Nullableand are still guarded by the existingPreconditions.checkStateinfindMissingPrivileges.Testing
PolarisAuthorizerImplTestupdated to the new signature (stubs, verifies, and one direct call); theisAuthorizedstubs are unchanged../gradlew :polaris-core:checkpasses, along with the Ranger unit tests +intTest, the OPA tests, and the runtime-service catalog handler authz suites (IcebergCatalogHandlerAuthzTest,IcebergCatalogHandlerFineGrainedDisabledTest,PolicyCatalogHandlerAuthzTest,PolarisGenericTableCatalogHandlerAuthzTest).Checklist