exposebox/node-thrift2-hbase

Support for Kerberos connection

feenst opened this issue · 7 comments

I'm evaluating node-hbase for connecting to an HBase instance, but it's using REST rather than Thrift to connect.

Has Kerberos support for node-thirft2-hbase been discussed?

@moshewe, I'm not sure where to start on swapping out the connection pool. Would that be something here?

Ran-P commented

In client.js line 147 the connection to the thrift server is created.
The createConnection is in the node-thrift package, It just create a stream using net.createConnection.
You can add your function of createKerberosConnection :

thrift.createKerberosConnection = function(host, port, options) {
  var stream = kerberos.connect(port, host, options);
  var connection = new Connection(stream, options);
  connection.host = host;
  connection.port = port;
  return connection;
};

@Ran-P, the Node kerberos packages I've seen (kerberos and node-krb5) both seem to work by generating a token that's used with an Authentication HTTP header.

The thrift connection uses sockets / streams. Any idea how Kerberos authentication works in that scenario?

As @Ran-P pointed out, you should discuss this with the node-thrift people. If you figure something out with them, then you can see exactly where @Ran-P had already directed you to how to use it with our package - it's just a library for us.

Ran-P commented

@feenst you can use httpConnection in the thrift library instead of the RPC connection.
Add(or extend) to the httpConnection to use krb5.