[#13251] improvement(authz): Reuse request context during list filtering - #13252
Conversation
Code Coverage Report
Files
|
Drop the derivable authorizer parameter and the redundant active-roles check from AuthorizationRequestScope, bind the principal at bind time, remove the unused nested-scope restore, and keep the read-only bind rule in one helper shared by both interceptors. filterByExpression returns early when authorization is disabled or the list is empty and resolves the principal and authorizer once. Tests no longer swap the filter executor by reflection.
|
Verdict: ship it — no blocking issues found. Findings
TestsCoverage of the new behaviour is good: parallel filtering with a table-level deny plus the short-circuit hit/miss split ( Two gaps:
Verified separately, since it is the crux of whether the optimization fires at all: the identity check at Nits
Generated by Claude Code |
What changes were proposed in this pull request?
Reuse entry authorization state for parent-scope checks and per-object list filtering in read-only REST requests. A scoped binding is opened by the interceptor, bound only for read methods, reused only for the same principal instance and metalake, and cleared when the request completes. Filter workers receive the context explicitly; mutation operations retain independent contexts.
Why are the changes needed?
Separate contexts repeat user and role-version lookups during one list request. Reusing the context lets filtering use state already loaded by entry authorization.
Fix: #13251
Does this PR introduce any user-facing change?
No API or configuration changes. Authorization semantics remain unchanged.
How was this patch tested?
139 targeted unit tests passed across server-common, server, and iceberg-rest-server. Tests cover context reuse through REST interceptors, parallel filtering with table denies, security-context isolation, exception cleanup, and JCasbin SQL-prefetch reuse with revalidation on the next request. Ran Spotless on the changed modules.