Hi Laurent, Thanks! I will do a pass on the PR :)
About Prashant's questions, I agree with you on both: 1. the SPI should not know whether a view is a definer or an invoker view. It's a policy decision, and each authorizer (built-in, OPA, Ranger, ...) has its own model. Polaris forwards the chain, the authorizer decides what to do with it. For the built-in authorizer, explicit binding vs ownership (like PostgreSQL) is a fair question, but imho ownership would be a change to the built-in RBAC model as a whole (not only for views), so it deserves its own discussion as part of part 2. It should not block part 1. 2. not all authorizers are principal-based, so I don't think the SPI should return an "effective principal". On the audit side, the PR already adds the chain to the load events (REFERENCED_BY attribute), so an event listener can record which views a load went through. Propagating authorization context to the storage layer (STS session tags, ...) is a broader credential vending topic, I would start a separate thread for it. About the catalog-level switch you asked about on the PR: I would add it in this PR rather than in part 2. Even if no authorizer reads the chain yet, the 400 is the user-visible change of this PR: a request with a chain that Polaris ignored until now can fail after the upgrade (malformed chain, more than 10 entries, repeated entry, chain containing the target). Also, as we parse the raw query string (because of the Quarkus issue), we depend on how each client encodes the parameter. Your wire test with the 1.12 client is great, but clients still in progress (Trino) may behave differently. Operators should be able to turn it off for a catalog without downgrading Polaris. As I said earlier: enabled by default, overridable at catalog level, and when disabled Polaris behaves like today (no parsing, no validation, no chain in the events, empty referencedBy()). Once part 1 is in, I'm still happy to help on OPA as first consumer (adding the chain to the OPA input). Regards JB On Wed, Dec 2, 2026 at 11:04 PM Laurent Goujon via dev <[email protected]> wrote: > > So I moved the PR out of draft and it's ready for review. > > To answer your questions, Prasanth: > > 1/ Regarding how to detect if a view is using the definer mode: is this in > the context of the SPI or in the context of the implementation? In the > context of the SPI, I don't think the catalog needs to know the mechanism > used. In the context of an implementation, this is the recurring question > about how we should model permissions/authorizations and tbh i don't have a > good answer. One thing I know is that even if multiple systems have > something named "owner," they are modeled differently and the devil is in > the details. > > 2/ I'm not sure it makes sense to return an "effective" principal from > authz except as an opaque string to be logged/audited as nothing says the > authorizer has to follow a principal-based model when evaluating object > access with reference chains? The STS use case might be an interesting > discussion but I feel like it goes beyond just this proposal and should be > a core discussion about the authorization spi and if/how can an > authorization implementation propagate some identity/authorization > information to other layers (like the storage one for example) so those > layers could also perform their own audit/authorization > > Laurent > > On Mon, Nov 16, 2026 at 10:05 AM Prashant Singh <[email protected]> > wrote: > > > Hey Laurent, > > > > Thanks for sharing the doc ! This was really helpful in collaborating and > > I appreciate your responses in the thread ! > > > > Regarding defining view as DEFINER / INVOKER in the view security > > property, it was intentional in my design in IRC to leave it open ended, it > > really nice to see that it's well received [1] > > Now talking of detecting cycles, i believe this should be ideally done in > > the engine, at least the spark implementation we do cycle detection before > > we send the referenced by ... [2], trino would do the same is my hope, i am > > already following up there. > > > > > interpret it as a signal that the SPI PR [1] can be moved out of draft? > > > > +1 on making the pr ready for review so that folks can add further comments > > > > Couple of questions which i would love to get other folks thoughts on as > > well : > > > > 1. How do we detect a view is DEFINER view in catalog .. presently if the > > view is required to be binded to role with explicitly, why not have > > ownership model defined as PG / other engines does [3], so this becomes > > more implicit, i understand the counter argument to that was not all > > platform does it this way > > where ownership is not a privilege, but before we go into introducing a > > entirely new way to mark view as definer, love to hear from more folks in > > this context (existing thread here [4]) > > 2. I wonder if we should return an effective Principal too from authZ ? for > > example we took in the caller Principal and we authorized against views > > binded roles .. this would be helpful in potentially solving the > > difference in audit one could see in STS calls [5] > > > > > > > > [1] > > https://docs.google.com/document/d/15zgmACxue8jH8SIBAJNzZ64Mx6RTRmDv2IoH3Clc2uQ/edit?tab=t.0 > > [2] https://github.com/apache/iceberg/pull/13979/changes > > [3] > > https://www.postgresql.org/docs/current/rules-privileges.html#RULES-PRIVILEGES > > [4] > > https://docs.google.com/document/d/1B4K7iQvnRYHBnOrP6pXnw48keflZcBkM5l1-ooAOCZg/edit?disco=doco.mNymgmR2gOoIrhNxWBPlkg > > [5] > > https://docs.google.com/document/d/1B4K7iQvnRYHBnOrP6pXnw48keflZcBkM5l1-ooAOCZg/edit?disco=doco.beRMshNVaWEW1D77ttypPQ > > > > > > Best, > > Prashant Singh > > > > On Thu, Nov 12, 2026 at 4:43 PM Yufei Gu <[email protected]> wrote: > > > >> Hi Laurent, thanks for working on it, +1 on moving this out of the draft > >> so > >> people can start the review. > >> > >> Yufei > >> > >> > >> On Thu, Nov 12, 2026 at 12:01 PM Laurent Goujon via dev < > >> [email protected]> wrote: > >> > >> > Just checking on this proposal. > >> > > >> > I got a few comments (thanks Yufei, JB and Prashant), a couple (minor > >> > ones?) on the SPI but most of them on the builtin authorizer part? > >> Should I > >> > interpret it as a signal that the SPI PR [1] can be moved out of draft? > >> > > >> > Laurent > >> > > >> > [1] https://github.com/apache/polaris/pull/5980 > >> > > >> > On Wed, Nov 4, 2026 at 12:18 PM Laurent Goujon <[email protected]> > >> wrote: > >> > > >> > > 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 > >> > > > >> > > >> > >
