Skip to content

Commit

Permalink
make our rest_authenticator accepted by some clients
Browse files Browse the repository at this point in the history
authenticator_name is checked by some clients (go, rust) and connections
are rejected if not in an allowed list on client side.
We spoof cassandra authenticator name as scylla is doing for
password authenticator.
  • Loading branch information
Peter Goron authored and pgoron committed Aug 25, 2023
1 parent f5c3482 commit 73d02b1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions auth/rest_authenticator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ namespace roles_valid_table {
}
}

constexpr std::string_view
rest_authenticator_name("com.criteo.scylladb.auth.RestAuthenticator");
constexpr std::string_view cassandra_authenticator_name("org.apache.cassandra.auth.PasswordAuthenticator");
constexpr std::string_view rest_authenticator_name("com.criteo.scylladb.auth.RestAuthenticator");

// name of the hash column.
static constexpr std::string_view SALTED_HASH = "salted_hash";
Expand Down Expand Up @@ -208,7 +208,7 @@ db::consistency_level rest_authenticator::consistency_for_user(std::string_view
}

std::string_view rest_authenticator::qualified_java_name() const {
return rest_authenticator_name;
return cassandra_authenticator_name;
}

bool rest_authenticator::require_authentication() const {
Expand Down
2 changes: 1 addition & 1 deletion test/boost/rest_authenticator_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ static future<> create_superuser_role(cql3::query_processor &qp) {
SEASTAR_TEST_CASE(rest_authenticator_conf) {
return with_dummy_authentication_server([] (cql_test_env &env) {
auto &a = env.local_auth_service().underlying_authenticator();
BOOST_REQUIRE_EQUAL(a.qualified_java_name(), "com.criteo.scylladb.auth.RestAuthenticator");
BOOST_REQUIRE_EQUAL(a.qualified_java_name(), "org.apache.cassandra.auth.PasswordAuthenticator");
BOOST_REQUIRE(a.require_authentication());

auto &authenticator_config = a.get_authenticator_config();
Expand Down

0 comments on commit 73d02b1

Please sign in to comment.