diff --git a/auth/allow_all_authenticator.cc b/auth/allow_all_authenticator.cc index c3eae17db3..a8882d47d7 100644 --- a/auth/allow_all_authenticator.cc +++ b/auth/allow_all_authenticator.cc @@ -27,7 +27,7 @@ namespace auth { const sstring& allow_all_authenticator_name() { - static const sstring name = meta::AUTH_PACKAGE_NAME + "AllowAllAuthenticator"; + static const sstring name = make_sstring(meta::AUTH_PACKAGE_NAME, "AllowAllAuthenticator"); return name; } diff --git a/auth/allow_all_authorizer.cc b/auth/allow_all_authorizer.cc index 6cd2ef2aa6..df1a4b95a1 100644 --- a/auth/allow_all_authorizer.cc +++ b/auth/allow_all_authorizer.cc @@ -27,7 +27,7 @@ namespace auth { const sstring& allow_all_authorizer_name() { - static const sstring name = meta::AUTH_PACKAGE_NAME + "AllowAllAuthorizer"; + static const sstring name = make_sstring(meta::AUTH_PACKAGE_NAME, "AllowAllAuthorizer"); return name; } diff --git a/auth/common.cc b/auth/common.cc index 839b1648f4..e1f949b8f0 100644 --- a/auth/common.cc +++ b/auth/common.cc @@ -34,10 +34,10 @@ namespace auth { namespace meta { -const sstring DEFAULT_SUPERUSER_NAME("cassandra"); -const sstring AUTH_KS("system_auth"); -const sstring USERS_CF("users"); -const sstring AUTH_PACKAGE_NAME("org.apache.cassandra.auth."); +constexpr std::string_view DEFAULT_SUPERUSER_NAME("cassandra"); +constexpr std::string_view AUTH_KS("system_auth"); +constexpr std::string_view USERS_CF("users"); +constexpr std::string_view AUTH_PACKAGE_NAME("org.apache.cassandra.auth."); } diff --git a/auth/common.hh b/auth/common.hh index 653ea0e369..aa90e289db 100644 --- a/auth/common.hh +++ b/auth/common.hh @@ -53,10 +53,10 @@ namespace auth { namespace meta { -extern const sstring DEFAULT_SUPERUSER_NAME; -extern const sstring AUTH_KS; -extern const sstring USERS_CF; -extern const sstring AUTH_PACKAGE_NAME; +extern const std::string_view DEFAULT_SUPERUSER_NAME; +extern const std::string_view AUTH_KS; +extern const std::string_view USERS_CF; +extern const std::string_view AUTH_PACKAGE_NAME; } diff --git a/auth/default_authorizer.cc b/auth/default_authorizer.cc index 307df80e35..85a728e3af 100644 --- a/auth/default_authorizer.cc +++ b/auth/default_authorizer.cc @@ -66,7 +66,7 @@ extern "C" { namespace auth { const sstring& default_authorizer_name() { - static const sstring name = meta::AUTH_PACKAGE_NAME + "CassandraAuthorizer"; + static const sstring name = make_sstring(meta::AUTH_PACKAGE_NAME, "CassandraAuthorizer"); return name; } diff --git a/auth/password_authenticator.cc b/auth/password_authenticator.cc index abb7f382c0..48b93a9bae 100644 --- a/auth/password_authenticator.cc +++ b/auth/password_authenticator.cc @@ -63,14 +63,14 @@ namespace auth { const sstring& password_authenticator_name() { - static const sstring name = meta::AUTH_PACKAGE_NAME + "PasswordAuthenticator"; + static const sstring name = make_sstring(meta::AUTH_PACKAGE_NAME, "PasswordAuthenticator"); return name; } // name of the hash column. static const sstring SALTED_HASH = "salted_hash"; -static const sstring DEFAULT_USER_NAME = meta::DEFAULT_SUPERUSER_NAME; -static const sstring DEFAULT_USER_PASSWORD = meta::DEFAULT_SUPERUSER_NAME; +static const sstring DEFAULT_USER_NAME = sstring(meta::DEFAULT_SUPERUSER_NAME); +static const sstring DEFAULT_USER_PASSWORD = sstring(meta::DEFAULT_SUPERUSER_NAME); static logging::logger plogger("password_authenticator"); diff --git a/auth/roles-metadata.cc b/auth/roles-metadata.cc index 960708e4f2..aa39b0dfcd 100644 --- a/auth/roles-metadata.cc +++ b/auth/roles-metadata.cc @@ -52,7 +52,7 @@ std::string_view creation_query() { } std::string_view qualified_name() noexcept { - static const sstring instance = AUTH_KS + "." + sstring(name); + static const sstring instance = make_sstring(meta::AUTH_KS, ".", name); return instance; } diff --git a/auth/standard_role_manager.cc b/auth/standard_role_manager.cc index 5531557609..8db3b26dbb 100644 --- a/auth/standard_role_manager.cc +++ b/auth/standard_role_manager.cc @@ -51,7 +51,7 @@ namespace role_members_table { constexpr std::string_view name{"role_members" , 12}; static std::string_view qualified_name() noexcept { - static const sstring instance = AUTH_KS + "." + sstring(name); + static const sstring instance = make_sstring(meta::AUTH_KS, ".", name); return instance; } @@ -125,7 +125,7 @@ static bool has_can_login(const cql3::untyped_result_set_row& row) { } std::string_view standard_role_manager_name() noexcept { - static const sstring instance = meta::AUTH_PACKAGE_NAME + "CassandraRoleManager"; + static const sstring instance = make_sstring(meta::AUTH_PACKAGE_NAME, "CassandraRoleManager"); return instance; } diff --git a/distributed_loader.cc b/distributed_loader.cc index 5d4355c34a..9c60660a03 100644 --- a/distributed_loader.cc +++ b/distributed_loader.cc @@ -65,7 +65,7 @@ static const std::unordered_set internal_keyspaces = { db::system_distributed_keyspace::NAME, db::system_keyspace::NAME, db::schema_tables::NAME, - auth::meta::AUTH_KS, + sstring(auth::meta::AUTH_KS), tracing::trace_keyspace_helper::KEYSPACE_NAME };