Hi all, The Iceberg REST spec has an optional `referenced-by` query parameter on loadTable, loadView and loadCredentials (apache/iceberg#13810). When an engine loads a table or view while evaluating a view, it can pass the chain of views it went through, outermost first. It was added to make definer views possible. Polaris accepts the parameter but drops it today, so no authorizer can act on it.
I wrote a proposal and opened a draft PR for the first part: - Proposal: https://github.com/apache/polaris/issues/5979 - Draft PR (part 1): https://github.com/apache/polaris/pull/5980 The proposal has two parts: 1. SPI. Pass the parsed chain to authorizers through a new `SingleTargetAuthorizationIntent#referencedBy()` accessor. A chain that cannot be parsed, is deeper than a configurable limit (10 by default) or repeats an entry is rejected with a 400. The chain is added to the load events. Existing authorizers (built-in, OPA, Ranger) are unchanged, and the PR does not change any decision. 2. Built-in authorizer. An administrator binds a view to a catalog role (a new `CATALOG_ROLE_EXECUTE_AS` privilege, with the view as the grantee), and a new catalog privilege marks the callers that may assert a chain. The built-in authorizer then evaluates the chain, switching to the bound role at each bound view. This part is not in the PR. Since part 1 changes an extension point, I would like to agree on it here before taking the PR out of draft. Re part 2: the proposal includes it so that part 1 comes with a proof of concept for how an authorizer would use the chain. I can also work on a PR for it, or we could focus on a different authorizer instead (I'm open to that). Thanks, Laurent
