* to RADOS may be safely skipped in this case. */
user_info = this->user_info;
}
+
+
+rgw::auth::Engine::result_t
+rgw::auth::AnonymousEngine::authenticate(const req_state* const s) const
+{
+ if (! is_applicable()) {
+ return std::make_pair(nullptr, nullptr);
+ } else {
+ RGWUserInfo user_info;
+ rgw_get_anon_user(user_info);
+
+ // FIXME: over 80 columns
+ auto apl = apl_factory->create_apl_local(cct, user_info,
+ rgw::auth::LocalApplier::NO_SUBUSER);
+ return std::make_pair(std::move(apl), nullptr);
+ }
+}
};
};
+
+/* The anonymous abstract engine. */
+class AnonymousEngine : public Engine {
+ CephContext* const cct;
+ const rgw::auth::LocalApplier::Factory* const apl_factory;
+
+public:
+ AnonymousEngine(CephContext* const cct,
+ const rgw::auth::LocalApplier::Factory* const apl_factory)
+ : cct(cct),
+ apl_factory(apl_factory) {
+ }
+
+ const char* get_name() const noexcept override {
+ return "rgw::auth::AnonymousEngine";
+ }
+
+ Engine::result_t authenticate(const req_state* s) const override final;
+
+protected:
+ virtual bool is_applicable() const noexcept {
+ return true;
+ }
+};
+
} /* namespace auth */
} /* namespace rgw */