/* * Copyright (C) 2017-present ScyllaDB */ /* * SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.0 */ #pragma once #include #include "auth/authenticated_user.hh" #include "auth/authenticator.hh" #include "auth/cache.hh" #include "auth/common.hh" #include "utils/alien_worker.hh" namespace cql3 { class query_processor; } namespace service { class migration_manager; } namespace auth { extern const std::string_view allow_all_authenticator_name; class allow_all_authenticator final : public authenticator { public: allow_all_authenticator(cql3::query_processor&, ::service::raft_group0_client&, ::service::migration_manager&, cache&, utils::alien_worker&) { } virtual future<> start() override { return make_ready_future<>(); } virtual future<> stop() override { return make_ready_future<>(); } virtual std::string_view qualified_java_name() const override { return allow_all_authenticator_name; } virtual bool require_authentication() const override { return false; } virtual authentication_option_set supported_options() const override { return authentication_option_set(); } virtual authentication_option_set alterable_options() const override { return authentication_option_set(); } future authenticate(const credentials_map& credentials) const override { return make_ready_future(anonymous_user()); } virtual future<> create(std::string_view, const authentication_options& options, ::service::group0_batch&) override { return make_ready_future(); } virtual future<> alter(std::string_view, const authentication_options& options, ::service::group0_batch&) override { return make_ready_future(); } virtual future<> drop(std::string_view, ::service::group0_batch&) override { return make_ready_future(); } virtual future query_custom_options(std::string_view role_name) const override { return make_ready_future(); } virtual const resource_set& protected_resources() const override { static const resource_set resources; return resources; } virtual ::shared_ptr new_sasl_challenge() const override { throw std::runtime_error("Should not reach"); } virtual future<> ensure_superuser_is_created() const override { return make_ready_future<>(); } }; }