Skip to content
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

feat(presto-client): allow basic authentication #19

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

alonsovb
Copy link
Contributor

Changes

Resolves #15
Resolves #16

  • Add basic and custom authentication params. The custom authorization param takes precedence over the basicAuthentication object.
  • Add ability to send custom headers on all requests.

@alonsovb alonsovb added the feature New feature or request label Jan 18, 2024
@alonsovb alonsovb self-assigned this Jan 18, 2024
presto-client/src/client.ts Outdated Show resolved Hide resolved
Copy link
Member

@yhwang yhwang left a comment

Choose a reason for hiding this comment

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

LGTM! nice!

Copy link
Contributor

@jorgeramirezamora jorgeramirezamora left a comment

Choose a reason for hiding this comment

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

🚀

@@ -46,6 +46,9 @@ The Presto client can be configured with the following parameters:
- `schema`: The default schema to use for queries. (Default: `undefined`)
- `source`: The name of the source you want to use for reporting purposes (Default: `presto-js-client`)
- `timezone`: The timezone to use for queries. (Default: `undefined`)
- `authorizationToken`: The value to send as-is in the Authorization header. (Default: `undefined`)
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use the same order that we have in the client's constructor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in this case I think I rather have params in order of relevance for anyone using the client 🤔

@jorgeramirezamora jorgeramirezamora changed the title feat(client): allow basic authentication feat(presto-client): allow basic authentication Jan 23, 2024
@alonsovb alonsovb merged commit 582c857 into main Jan 23, 2024
4 checks passed
@alonsovb alonsovb deleted the feature/auth-and-headers branch January 23, 2024 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow authentication Allow passing any custom headers to the request
3 participants