tagomoris / presto-client-node

Distributed query engine Presto client library for node.js
MIT License
126 stars 57 forks source link

Discussion: support kerberos authentication #47

Closed johnson-liang closed 3 years ago

johnson-liang commented 3 years ago

I am trying to connect to a Trino server guarded with Kerberos authentication.

Currently the authorization header is designated here, in HTTP basic auth: https://github.com/tagomoris/presto-client-node/blob/master/lib/presto-client/index.js#L98

I think there are 2 ways to implement Kerberos support:

  1. Introduce a new option custom_auth in Client constructor opts for a custom authorization header string. When present, it will set authorization header as specified somewhere near here in the code. Developers must find their own way to generate the authorization header (for Kerberos it means using other libraries like kerberos or krb5.)
  2. Introduce an optional dependency kerberos and support kerberos authentication similar to PyHive's.

Personally I prefer 1 because it introduces less code change on the library. If this is preferred, I can submit a pull request on this :)

tagomoris commented 3 years ago

@johnson-liang That idea sounds nice to me too :D