Repository navigation
Scope materialized views to a tenant - #25
Merged
Merged
Conversation
venkat1701
force-pushed
the
feat/tenant-scoped-views
branch
2 times, most recently
from
October 4, 2026 06:42
d9441b3 to
16c242e
Compare
A view now records the tenant of the admin who created it. Builds and feed deltas only cover that tenant's atoms, names and listings are per tenant, and continuous refreshes run inside the view's tenant. Creating and refreshing a view used to write as the internal system principal; both now take the caller's principal, and the executor passes the session's through.
venkat1701
force-pushed
the
feat/tenant-scoped-views
branch
from
October 4, 2026 08:23
16c242e to
5eed17d
Compare
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.
Closes #11
Views now belong to the tenant of the admin who created them.
Descriptorgained atenantfield, and:SHOW VIEWS,VIEWandREFRESH VIEWonly see your own tenant.systeminside the view's tenant, so the tenant checks in the computation (Reader.edgeand friends) still hold.While doing this I noticed
createandrefreshalways wrote as the internalsystemprincipal. The executor's admin check was the only guard. Both now take the caller's principal, and the executor passes the session's through.Behaviour change worth knowing: a view created by the default-tenant admin now only covers default-tenant data instead of everything. That matches how every other read in HStore is scoped.
The descriptor encoding gained the tenant field. Nothing is released yet, so I didn't add a migration for existing view descriptors.
materializedViewsStayInsideTheirTenantinSecurityTestcovers a tenant admin and the default admin each building a view over their own data, refreshes after new commits, a continuous view, and an admin trying to read another tenant's view by name. Full./mvnw installpasses locally.