Repository navigation
feat: read the stacklet:rls_access claim for the RLS db role (ENG-9644) - #117
Draft
albertodonato wants to merge 1 commit into
Draft
albertodonato wants to merge 1 commit into
albertodonato wants to merge 1 commit into
Conversation
albertodonato
force-pushed
the
ack/rls-stem-claim
branch
from
November 4, 2026 14:21
3d7649a to
16fb576
Compare
Derive the database role from `stacklet:rls_access`: `sso_` + stem for a valid stem, the data source user for `unrestricted`, and deny `no_visibility` or any malformed value. Tokens minted before the claim existed fall back to `stacklet:db_role`, now also denying `no_visibility` there, since that role can't log in and every query would fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
albertodonato
force-pushed
the
ack/rls-stem-claim
branch
from
November 4, 2026 15:43
16fb576 to
4e1d7d0
Compare
This branch has not been deployed
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.
The JWT request loader now gets the user's database role from the new
stacklet:rls_accessclaim, following the claim table in the ENG-9107 design (step 5):stacklet:rls_accessstacklet:db_roleunrestricteddb_role = None: queries run as the data source user, unfilteredno_visibility[a-z0-9_]+_[0-9a-f]{6}db_role = "sso_" + stemstacklet:rls_accessis present it overridesstacklet:db_role.stacklet:db_role = no_visibility. Before, such a user was let in, but every query failed because that role can't log in.users.db_rolevalues, cached query results and thequery_resultspolicy are unaffected.The ENG-9107 design calls this claim
stacklet:rls_stem; it is renamed tostacklet:rls_accesshere because its value is either a stem or one of the reserved valuesunrestrictedandno_visibility. The platform and Superset changes need to use the same name.This can ship before the platform starts minting
stacklet:rls_access: until then every token takes the fallback path.How is this tested?
New tests in
tests/test_authentication.py::TestJWTAuthentication, one per row of the table, plus: the new claim overridesstacklet:db_role,unrestrictedclears a previously stored role, and the fallback denieslimited_visibilityandno_visibility. All 48 tests intests/test_authentication.pypass against the CI compose stack.Related Tickets & Documents
🤖 Generated with Claude Code