diff --git a/jlcaosdb/jlcaosdb.cxx b/jlcaosdb/jlcaosdb.cxx index 96e7b58652800ff887aa63bb40bd45845be2343d..5fed1c2614657d10379299b248f2ce4f8a04bd6a 100644 --- a/jlcaosdb/jlcaosdb.cxx +++ b/jlcaosdb/jlcaosdb.cxx @@ -29,6 +29,15 @@ #include "caosdb/constants.h" #include "caosdb/exceptions.h" +namespace jlcxx +{ + template<> + struct SuperType<caosdb::authentication::PlainPasswordAuthenticator> + { + typedef caosdb::authentication::Authenticator type; + }; +} + JLCXX_MODULE define_julia_module(jlcxx::Module& mod) { // Version info of libcaosdb against which this is built. @@ -37,10 +46,19 @@ JLCXX_MODULE define_julia_module(jlcxx::Module& mod) mod.method("get_libcaosdb_version_patch", []() {return caosdb::LIBCAOSDB_VERSION_PATCH;}); // exceptions inherit from abstract Julia exception types: - mod.add_type<caosdb::exceptions::AuthenticationError>("AuthenticationError", jlcxx::julia_type("AbstractAuthenticationError")) + mod.add_type<caosdb::exceptions::AuthenticationError>("AuthenticationError", + jlcxx::julia_type("AbstractAuthenticationError")) .constructor<const std::string&>() .method("what", &caosdb::exceptions::AuthenticationError::what); - mod.add_type<caosdb::exceptions::ConnectionError>("ConnectionError", jlcxx::julia_type("AbstractConnectionError")) + mod.add_type<caosdb::exceptions::ConnectionError>("ConnectionError", + jlcxx::julia_type("AbstractConnectionError")) .constructor<const std::string&>() .method("what", &caosdb::exceptions::ConnectionError::what); + + // authenticators + mod.add_type<caosdb::authentication::Authenticator>("CaosDBAuthenticator"); + mod.add_type<caosdb::authentication::PlainPasswordAuthenticator>("PlainPasswordAuthenticator", + jlcxx::julia_base_type<caosdb::authentication::Authenticator>()) + .constructor<const std::string&, const std::string&>() + .method("getCallCredentials", &caosdb::authentication::PlainPasswordAuthenticator::getCallCredentials); }