From df4f1a3bc3f65e9ebafc5fe3a10e96253c9e569b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20=C3=81vila=20de=20Esp=C3=ADndola?= Date: Tue, 25 Feb 2020 12:05:49 -0800 Subject: [PATCH] auth: Return a string_view from authorizer::qualified_java_name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This gives more flexibility to the implementations as they now don't need to construct a sstring. Signed-off-by: Rafael Ávila de Espíndola --- auth/allow_all_authorizer.hh | 2 +- auth/authorizer.hh | 2 +- auth/default_authorizer.hh | 2 +- auth/transitional.cc | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/auth/allow_all_authorizer.hh b/auth/allow_all_authorizer.hh index 9371c0d58e..67de9d287f 100644 --- a/auth/allow_all_authorizer.hh +++ b/auth/allow_all_authorizer.hh @@ -49,7 +49,7 @@ public: return make_ready_future<>(); } - virtual const sstring& qualified_java_name() const override { + virtual std::string_view qualified_java_name() const override { return allow_all_authorizer_name(); } diff --git a/auth/authorizer.hh b/auth/authorizer.hh index 12b12d4e8e..b98215afc1 100644 --- a/auth/authorizer.hh +++ b/auth/authorizer.hh @@ -100,7 +100,7 @@ public: /// /// A fully-qualified (class with package) Java-like name for this implementation. /// - virtual const sstring& qualified_java_name() const = 0; + virtual std::string_view qualified_java_name() const = 0; /// /// Query for the permissions granted directly to a role for a particular \ref resource (and not any of its diff --git a/auth/default_authorizer.hh b/auth/default_authorizer.hh index 373c16e8de..cfb108f6b1 100644 --- a/auth/default_authorizer.hh +++ b/auth/default_authorizer.hh @@ -71,7 +71,7 @@ public: virtual future<> stop() override; - virtual const sstring& qualified_java_name() const override { + virtual std::string_view qualified_java_name() const override { return default_authorizer_name(); } diff --git a/auth/transitional.cc b/auth/transitional.cc index b817cedf44..58a0a461e6 100644 --- a/auth/transitional.cc +++ b/auth/transitional.cc @@ -201,7 +201,7 @@ public: return _authorizer->stop(); } - virtual const sstring& qualified_java_name() const override { + virtual std::string_view qualified_java_name() const override { return transitional_authorizer_name(); }