Skip to content

pat_user impersonation#4

Merged
AbhishekGedela merged 1 commit intomasterfrom
fix_impersonation
Apr 14, 2026
Merged

pat_user impersonation#4
AbhishekGedela merged 1 commit intomasterfrom
fix_impersonation

Conversation

@AbhishekGedela
Copy link
Copy Markdown
Collaborator

No description provided.

@AbhishekGedela AbhishekGedela merged commit 3c98769 into master Apr 14, 2026
5 of 7 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Starburst driver to handle impersonation differently when requests are authenticated via PAT, and adjusts a DDL module dependency to use the query compilation namespace directly.

Changes:

  • Set Trino sessionUser to a fixed "pat_user" when impersonation is enabled and the current auth type is :pat.
  • Update DDL code to require metabase.query-processor.compile (and remove an unused HoneySQL require).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
drivers/starburst/src/metabase/driver/implementation/execute.clj Adds PAT-specific impersonation behavior by setting sessionUser to "pat_user" under :pat.
drivers/starburst/src/metabase/driver/implementation/ddl.clj Switches query compilation dependency to metabase.query-processor.compile and drops an unused require.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +167 to +170
(let [session-user (if (= api/*current-auth-type* :pat)
"pat_user"
(get (deref api/*current-user*) :email))]
(.setSessionUser (.unwrap conn TrinoConnection) session-user))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants