-
Notifications
You must be signed in to change notification settings - Fork 663
[teams 4/5] SQL authorization #3525
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
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
gefjon
approved these changes
Oct 29, 2025
e1cab37 to
8a3885a
Compare
ba3b3f9 to
a5ec537
Compare
8a3885a to
fdba810
Compare
a5ec537 to
fad1a63
Compare
joshua-spacetime
approved these changes
Nov 5, 2025
fdba810 to
2ef3f78
Compare
73b1012 to
b07c9b2
Compare
2ef3f78 to
693699c
Compare
b07c9b2 to
0ec430c
Compare
693699c to
1d72771
Compare
Update crates/core/src/sql/execute.rs Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io> Signed-off-by: Kim Altintop <kim@eagain.io>
0ec430c to
afcbaab
Compare
Closed
drogus
pushed a commit
that referenced
this pull request
Nov 12, 2025
Introduces a "routes struct" for the `/identity` endpoints, much like the `DatabaseRoutes`. This is useful for overriding individual handlers. See companion for motivation. Depends-on: #3525
4 tasks
egormanga
added a commit
to egormanga/SpacetimeDB
that referenced
this pull request
Nov 22, 2025
egormanga
added a commit
to egormanga/SpacetimeDB
that referenced
this pull request
Nov 22, 2025
egormanga
added a commit
to egormanga/SpacetimeDB
that referenced
this pull request
Nov 22, 2025
egormanga
added a commit
to egormanga/SpacetimeDB
that referenced
this pull request
Dec 11, 2025
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.
Permissions for evaluating SQL/DML are not generally "actions", but more a set of permissions that are checked during evaluation.
To make this work with the teams feature, this patch extends
AuthCtxto allow checking a set of permissions as mandated by the spec. This set is a bit more fine-grained than "is owner", so as to avoid baking in the concept of teams/collaborators, or assumptions about what a role might entail. Both are likely to evolve in the future, so evaluation of permissions / capabilities should be confined to the impl of theAuthorizationtrait.Unlike "actions", the
AuthCtxmust be able to evaluate permission checks quickly and without side-effects, nor can it enter anasynccontext. In that sense, it is precomputed (if you will), and stored as a closure in theAuthCtxfor external authorization.A challenge posed is how to thread through the constructed
AuthCtxfor subscriptions.A tempting approach would have been to equip the
HostControllerwith the ability to summon anAuthCtx. That, however, would have created a gnarly circular dependency, because theHostControlleralso controls the controldb, which itself demands anAuthCtx.Instead, the
AuthCtxis obtained in the endpoint handler and passed to each method call that requires one. That's less pretty, but more effective.