Repository navigation
fix 371 trino impersonation - #397
Draft
Bohreromir wants to merge 8 commits into
Draft
Bohreromir wants to merge 8 commits into
Bohreromir wants to merge 8 commits into
Conversation
input: false on user.additionalFields.username also made better-auth drop the field from the OIDC provider profile, so new users had no username and Trino ran their queries as 'anonymous'. Allow the write only from the OIDC callback via database hooks instead, which still rejects rewrites through /update-user (#330).
…ame (#371) Fall back to 'anonymous' only when nobody is signed in (OIDC disabled). A signed-in user without a username now gets a logged error and a 500, so a lost username claim can no longer go unnoticed.
The mock Trino now records X-Trino-User, so the query API test can check the impersonated user matches the signed-in user.
#371) - Set overrideUserInfo on the OIDC provider, so a changed Trino user claim reaches existing users on their next login, not only new ones. - Drop the `|| ''` fallback for the username: better-auth rejects a sign-in without email before creating the user, so an empty username is never stored. - Split findTrinoUser (returns null) from getTrinoUser (fails with 500). The connection-test action now returns a localised form error (trino_user_missing) instead of the error page. - Mock OIDC server: a test can sign in as a fixed user with chosen claims via the mock_oidc_user cookie. - E2E: a later login updates the username from the claim.
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The field holds the Trino user we impersonate, not a login name. Rename the column to trino_user in the initial migration; there is no release yet, so no new migration is needed.
Bohreromir
force-pushed
the
worktree-fix-371-trino-impersonation
branch
from
October 21, 2026 14:54
8b6e575 to
2adba17
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.
No description provided.