-
Notifications
You must be signed in to change notification settings - Fork 22
Allows override X-Trino-User from extraHeaders #914
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
base: main
Are you sure you want to change the base?
Conversation
Thank you for your pull request and welcome to the Trino community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. Continue to work with us on the review and improvements in this PR, and submit the signed CLA to [email protected]. Photos, scans, or digitally-signed PDF files are all suitable. Processing may take a few days. The CLA needs to be on file before we merge your changes. For more information, see https://github.com/trinodb/cla |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThe pull request updates the header assignment logic in Client to allow the X-Trino-User header to be overridden via extraHeaders, falling back to the basic.username only when no override is provided. Sequence diagram for X-Trino-User header assignment in Client.connectsequenceDiagram
participant Client
participant "extraHeaders"
participant "basic.username"
Client->>"extraHeaders": Check for X-Trino-User
alt X-Trino-User in extraHeaders
Client->>Client: Set X-Trino-User from extraHeaders
else X-Trino-User not in extraHeaders
Client->>"basic.username": Use basic.username for X-Trino-User
end
Class diagram for updated Client header logicclassDiagram
class Client {
+connect(options)
-basic: object
-clientConfig: object
}
Client : +connect(options)
Client : -headers: object
Client : -TRINO_USER_HEADER: string
Client : "X-Trino-User header set from extraHeaders or basic.username"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Problem
Currently, TRINO_USER_HEADER (X-Trino-User) is always set to basic.username and cannot be overridden via extraHeaders. This prevents using Trino's impersonation feature.
Solution
Change the priority order for setting the X-Trino-User header:
Use value from extraHeaders if provided
Fall back to basic.username
Summary by Sourcery
Enhancements: