mirror of
https://github.com/scylladb/scylladb.git
synced 2026-05-12 19:02:12 +00:00
auth: Convert sstring variables in common.hh to constexpr std::string_view
This converts the following variables: DEFAULT_SUPERUSER_NAME AUTH_KS USERS_CF AUTH_PACKAGE_NAME Since they are now constexpr they will not be part of any initialization order problems. Signed-off-by: Rafael Ávila de Espíndola <espindola@scylladb.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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.");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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");
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ static const std::unordered_set<sstring> 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
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user