Skip to content

feat: add jwt auth (#524) #855

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

feat: add jwt auth (#524) #855

wants to merge 3 commits into from

Conversation

emmc15
Copy link

@emmc15 emmc15 commented Jul 18, 2025

Issue

Adds a simple Auth for JWT (accessToken in Trino JDBC)

Added very simple test to validate JWT is being passed correctly through the client.

Bumped package.json version for release.

Copy link

cla-bot bot commented Jul 18, 2025

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

@emmc15 emmc15 changed the title feat: add jwt auth [#524](https://github.com/trinodb/trino-js-client/issues/524) feat: add jwt auth (#524) Jul 18, 2025
@cla-bot cla-bot bot added the cla-signed label Jul 25, 2025
@emmc15 emmc15 requested review from mosabua and regadas July 25, 2025 17:28
@emmc15
Copy link
Author

emmc15 commented Jul 25, 2025

Hey @mosabua and @regadas, please let me know if there is anything missing or needed for this PR. Happy to update this. Currently using a local version of this feature but would like to have in the official client. Thank you!

@emmc15 emmc15 requested review from wendigo and nineinchnick and removed request for mosabua and regadas August 15, 2025 17:51
@emmc15
Copy link
Author

emmc15 commented Aug 15, 2025

@wendigo @nineinchnick

Apologizes, I seemed to have requested reviews from incorrect maintainers. Please let me know if I’ve requested the right people if you know.

if there’s anything needed for the PR or changes, also please let me know. Thank you!

@@ -35,6 +35,12 @@ export class BasicAuth implements Auth {
constructor(readonly username: string, readonly password?: string) {}
}

export class JwtAuth implements Auth {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not a correct implementation. It should be closer to the implementation like the one in the python client: https://github.com/trinodb/trino-python-client/blob/df08367b54d7d27c1cd826ca3fa34ca0173f4c63/trino/auth.py#L295

Copy link
Author

Choose a reason for hiding this comment

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

Thank @wendigo for reviewing.

I wasn’t looking to make implement redirect or OAuth but rather the JWT one above from python like here however

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants