Skip to content

Thread ResolvedIntent through findMissingPrivileges - #5493

Merged
flyrain merged 1 commit into
apache:mainfrom
ZephyrYWZhou:followup-thread-resolved-intent
Sep 11, 2026
Merged

flyrain merged 1 commit into
apache:mainfrom
ZephyrYWZhou:followup-thread-resolved-intent

Conversation

@ZephyrYWZhou

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #5486, addressing @flyrain's review suggestion: thread the ResolvedIntent object down into findMissingPrivileges() instead of destructuring it into separate targets / secondaries arguments, 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 AuthorizationIntent expose its own securables to remove the resolver's per-type dispatch); this PR intentionally does only the findMissingPrivileges threading and leaves the other item for a separate PR.

Changes

  • PolarisAuthorizerImpl.authorizeRbacOrThrow and findMissingPrivileges now take a single AuthorizationIntentResolver.ResolvedIntent instead of separate @Nullable List<PolarisResolvedPathWrapper> targets, secondaries.
  • authorizeIntent passes the ResolvedIntent straight through instead of destructuring it at the call site.
  • findMissingPrivileges reads targets / secondaries from the object at the top; the rest of its logic is unchanged.
  • The public isAuthorized(...) overloads keep their existing signatures and construct a ResolvedIntent internally, 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 its targets / secondaries remain @Nullable and are still guarded by the existing Preconditions.checkState in findMissingPrivileges.

Testing

  • PolarisAuthorizerImplTest updated to the new signature (stubs, verifies, and one direct call); the isAuthorized stubs are unchanged.
  • ./gradlew :polaris-core:check passes, along with the Ranger unit tests + intTest, the OPA tests, and the runtime-service catalog handler authz suites (IcebergCatalogHandlerAuthzTest, IcebergCatalogHandlerFineGrainedDisabledTest, PolicyCatalogHandlerAuthzTest, PolarisGenericTableCatalogHandlerAuthzTest).

Checklist

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
@ZephyrYWZhou

Copy link
Copy Markdown
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 flyrain left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 thanks @ZephyrYWZhou !

@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Sep 11, 2026
@flyrain
flyrain merged commit ef6e939 into apache:main Sep 11, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Sep 11, 2026
@flyrain

flyrain commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Thanks @ZephyrYWZhou for the refactor. Thanks @flyingImer @dimas-b for the review!

@ZephyrYWZhou

Copy link
Copy Markdown
Contributor Author

Thanks @flyrain!

@ZephyrYWZhou
ZephyrYWZhou deleted the followup-thread-resolved-intent branch September 11, 2026 16:33
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.

4 participants