15 #ifndef IMPALA_RPC_AUTH_PROVIDER_H
16 #define IMPALA_RPC_AUTH_PROVIDER_H
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/thread/mutex.hpp>
21 #include <sasl/sasl.h>
44 boost::shared_ptr<apache::thrift::transport::TTransportFactory>* factory) = 0;
49 boost::shared_ptr<apache::thrift::transport::TTransport> raw_transport,
50 const std::string& service_name,
51 boost::shared_ptr<apache::thrift::transport::TTransport>* wrapped_transport) = 0;
75 boost::shared_ptr<apache::thrift::transport::TTransport> raw_transport,
77 boost::shared_ptr<apache::thrift::transport::TTransport>* wrapped_transport);
84 boost::shared_ptr<apache::thrift::transport::TTransportFactory>* factory);
164 boost::shared_ptr<apache::thrift::transport::TTransportFactory>* factory);
167 boost::shared_ptr<apache::thrift::transport::TTransport> raw_transport,
168 const std::string& service_name,
169 boost::shared_ptr<apache::thrift::transport::TTransport>* wrapped_transport);
177 Status
InitAuth(
const std::string& appname);
Status InitKerberosEnv()
One-time kerberos-specific environment variable setup. Called by InitKerberos().
virtual Status GetServerTransportFactory(boost::shared_ptr< apache::thrift::transport::TTransportFactory > *factory)
bool is_internal_
True if internal, false if external.
virtual Status WrapClientTransport(const std::string &hostname, boost::shared_ptr< apache::thrift::transport::TTransport > raw_transport, const std::string &service_name, boost::shared_ptr< apache::thrift::transport::TTransport > *wrapped_transport)=0
const std::string & principal() const
Used for testing.
virtual Status GetServerTransportFactory(boost::shared_ptr< apache::thrift::transport::TTransportFactory > *factory)=0
bool has_ldap_
Do we (the server side only) support ldap for this connnection?
const std::string & hostname() const
Status InitKerberos(const std::string &principal, const std::string &keytab_path)
std::string principal_
All the rest of these private items are Kerberos-specific.
static bool env_setup_complete_
We use this to ensure that we only set up environment variables one time.
virtual bool is_sasl()
Returns true if this provider uses Sasl at the transport layer.
std::string service_name_
virtual bool is_sasl()
Returns true if this provider uses Sasl at the transport layer.
std::string keytab_file_
The full path to the keytab where the above principal can be found.
void RunKinit(Promise< Status > *first_kinit)
SaslAuthProvider(bool is_internal)
virtual Status Start()
Initialises any state required to perform authentication using this provider.
virtual Status Start()=0
Initialises any state required to perform authentication using this provider.
boost::scoped_ptr< Thread > kinit_thread_
Runs "RunKinit" below if needs_kinit_ is true.
virtual Status WrapClientTransport(const std::string &hostname, boost::shared_ptr< apache::thrift::transport::TTransport > raw_transport, const std::string &service_name, boost::shared_ptr< apache::thrift::transport::TTransport > *wrapped_transport)
const std::string & service_name() const
const std::string & realm() const
std::string realm_
Principal's realm, again derived from principal.
virtual Status WrapClientTransport(const std::string &hostname, boost::shared_ptr< apache::thrift::transport::TTransport > raw_transport, const std::string &service_name, boost::shared_ptr< apache::thrift::transport::TTransport > *wrapped_transport)
virtual Status GetServerTransportFactory(boost::shared_ptr< apache::thrift::transport::TTransportFactory > *factory)
virtual bool is_sasl()=0
Returns true if this provider uses Sasl at the transport layer.
Status InitAuth(const std::string &appname)