diff --git a/auth/allow_all_authorizer.cc b/auth/allow_all_authorizer.cc index df1a4b95a1..3fcb1abd1d 100644 --- a/auth/allow_all_authorizer.cc +++ b/auth/allow_all_authorizer.cc @@ -26,10 +26,7 @@ namespace auth { -const sstring& allow_all_authorizer_name() { - static const sstring name = make_sstring(meta::AUTH_PACKAGE_NAME, "AllowAllAuthorizer"); - return name; -} +constexpr std::string_view allow_all_authorizer_name("org.apache.cassandra.auth.AllowAllAuthorizer"); // To ensure correct initialization order, we unfortunately need to use a string literal. static const class_registrator< diff --git a/auth/allow_all_authorizer.hh b/auth/allow_all_authorizer.hh index 67de9d287f..718fe4faf5 100644 --- a/auth/allow_all_authorizer.hh +++ b/auth/allow_all_authorizer.hh @@ -34,7 +34,7 @@ class migration_manager; namespace auth { -const sstring& allow_all_authorizer_name(); +extern const std::string_view allow_all_authorizer_name; class allow_all_authorizer final : public authorizer { public: @@ -50,7 +50,7 @@ public: } virtual std::string_view qualified_java_name() const override { - return allow_all_authorizer_name(); + return allow_all_authorizer_name; } virtual future authorize(const role_or_anonymous&, const resource&) const override { diff --git a/auth/service.cc b/auth/service.cc index 66e617844d..9ca1c7b49c 100644 --- a/auth/service.cc +++ b/auth/service.cc @@ -376,7 +376,7 @@ future get_permissions(const service& ser, const authenticated_u } bool is_enforcing(const service& ser) { - const bool enforcing_authorizer = ser.underlying_authorizer().qualified_java_name() != allow_all_authorizer_name(); + const bool enforcing_authorizer = ser.underlying_authorizer().qualified_java_name() != allow_all_authorizer_name; const bool enforcing_authenticator = ser.underlying_authenticator().qualified_java_name() != allow_all_authenticator_name;