}
-namespace rgw {
-namespace auth {
-namespace s3 {
+namespace rgw::auth::s3 {
bool is_time_skew_ok(time_t t)
{
return std::make_shared<AWSv4ComplSingle>(s);
}
-} /* namespace s3 */
-} /* namespace auth */
-} /* namespace rgw */
+} // namespace rgw::auth::s3
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_CR_REST_H
-#define CEPH_RGW_CR_REST_H
+#pragma once
#include <boost/intrusive_ptr.hpp>
#include <mutex>
int operate() override;
};
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_H
-#define CEPH_RGW_REST_H
+#pragma once
#define TIME_BUF_SIZE 128
class RGWHandler_REST : public RGWHandler {
protected:
- virtual bool is_obj_update_op() { return false; }
+ virtual bool is_obj_update_op() const { return false; }
virtual RGWOp *op_get() { return NULL; }
virtual RGWOp *op_put() { return NULL; }
virtual RGWOp *op_delete() { return NULL; }
class RGWHandler_SWIFT_Auth;
class RGWHandler_REST_S3;
-namespace rgw {
-namespace auth {
+namespace rgw::auth {
class StrategyRegistry;
-}
}
class RGWRESTMgr {
extern int dump_body(struct req_state* s, /* const */ ceph::buffer::list& bl);
extern int dump_body(struct req_state* s, const std::string& str);
extern int recv_body(struct req_state* s, char* buf, size_t max);
-
-#endif /* CEPH_RGW_REST_H */
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_ADMIN_H
-#define CEPH_RGW_REST_ADMIN_H
+#pragma once
class RGWRESTMgr_Admin : public RGWRESTMgr {
RGWRESTMgr_Admin() {}
~RGWRESTMgr_Admin() override {}
};
-
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_BUCKET_H
-#define CEPH_RGW_REST_BUCKET_H
+#pragma once
#include "rgw_rest.h"
#include "rgw_rest_s3.h"
return new RGWHandler_Bucket(auth_registry);
}
};
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_CLIENT_H
-#define CEPH_RGW_REST_CLIENT_H
+#pragma once
#include "rgw_http_client.h"
RGWGetDataCB *get_out_cb() { return out_cb; }
};
-
-#endif
-
*
*/
-#ifndef RGW_REST_CONFIG_H
-#define RGW_REST_CONFIG_H
+#pragma once
#include "rgw_zone.h"
return new RGWHandler_Config(auth_registry);
}
};
-
-#endif /* RGW_REST_CONFIG_H */
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_CONN_H
-#define CEPH_RGW_REST_CONN_H
+#pragma once
#include "rgw_rados.h"
#include "rgw_rest_client.h"
params, extra_headers, _mgr) {}
};
-
-
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_IAM_H
-#define CEPH_RGW_REST_IAM_H
+#pragma once
#include "rgw_auth.h"
#include "rgw_auth_filters.h"
const rgw::auth::StrategyRegistry&,
const std::string&) override;
};
-
-#endif /* CEPH_RGW_REST_STS_H */
-
*
*/
-#ifndef RGW_REST_LOG_H
-#define RGW_REST_LOG_H
+#pragma once
#include "rgw_metadata.h"
#include "rgw_mdlog.h"
return new RGWHandler_Log(auth_registry);
}
};
-
-#endif /* RGW_REST_LOG_H */
*
*/
-#ifndef RGW_REST_METADATA_H
-#define RGW_REST_METADATA_H
+#pragma once
class RGWOp_Metadata_List : public RGWRESTOp {
public:
return new RGWHandler_Metadata(auth_registry);
}
};
-
-#endif /* RGW_REST_METADATA_H */
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_REALM_H
-#define CEPH_RGW_REST_REALM_H
+#pragma once
#include "rgw_rest.h"
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override;
};
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_ROLE_H
-#define CEPH_RGW_REST_ROLE_H
+#pragma once
#include "rgw_role.h"
RGWOpType get_type() override { return RGW_OP_DELETE_ROLE_POLICY; }
uint64_t get_op() { return rgw::IAM::iamDeleteRolePolicy; }
};
-#endif /* CEPH_RGW_REST_ROLE_H */
-
return nullptr;
}
-RGWOp *RGWHandler_REST_Bucket_S3::get_obj_op(bool get_data)
+RGWOp *RGWHandler_REST_Bucket_S3::get_obj_op(bool get_data) const
{
// Non-website mode
if (get_data) {
}
-namespace rgw {
-namespace auth {
-namespace s3 {
+namespace rgw::auth::s3 {
static rgw::auth::Completer::cmplptr_t
null_completer_factory(const boost::optional<std::string>& secret_key)
}
}
-} /* namespace s3 */
-} /* namespace auth */
-} /* namespace rgw */
+} // namespace rgw::auth::s3
rgw::LDAPHelper* rgw::auth::s3::LDAPEngine::ldh = nullptr;
std::mutex rgw::auth::s3::LDAPEngine::mtx;
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_S3_H
+#pragma once
-#define CEPH_RGW_REST_S3_H
#define TIME_BUF_SIZE 128
#include <mutex>
class RGWHandler_REST_Service_S3 : public RGWHandler_REST_S3 {
protected:
- const bool isSTSEnabled;
- const bool isIAMEnabled;
- const bool isPSEnabled;
- bool is_usage_op() {
+ const bool isSTSEnabled;
+ const bool isIAMEnabled;
+ const bool isPSEnabled;
+ bool is_usage_op() const {
return s->info.args.exists("usage");
}
RGWOp *op_get() override;
class RGWHandler_REST_Bucket_S3 : public RGWHandler_REST_S3 {
const bool enable_pubsub;
protected:
- bool is_acl_op() {
+ bool is_acl_op() const {
return s->info.args.exists("acl");
}
- bool is_cors_op() {
+ bool is_cors_op() const {
return s->info.args.exists("cors");
}
- bool is_lc_op() {
+ bool is_lc_op() const {
return s->info.args.exists("lifecycle");
}
- bool is_obj_update_op() override {
+ bool is_obj_update_op() const override {
return is_acl_op() || is_cors_op();
}
-
- bool is_tagging_op() {
+ bool is_tagging_op() const {
return s->info.args.exists("tagging");
}
-
- bool is_request_payment_op() {
+ bool is_request_payment_op() const {
return s->info.args.exists("requestPayment");
}
- bool is_policy_op() {
+ bool is_policy_op() const {
return s->info.args.exists("policy");
}
-
- bool is_object_lock_op() {
+ bool is_object_lock_op() const {
return s->info.args.exists("object-lock");
}
bool is_notification_op() const {
}
return false;
}
- RGWOp *get_obj_op(bool get_data);
+
+ RGWOp *get_obj_op(bool get_data) const;
RGWOp *op_get() override;
RGWOp *op_head() override;
class RGWHandler_REST_Obj_S3 : public RGWHandler_REST_S3 {
protected:
- bool is_acl_op() {
+ bool is_acl_op() const {
return s->info.args.exists("acl");
}
- bool is_tagging_op() {
+ bool is_tagging_op() const {
return s->info.args.exists("tagging");
}
- bool is_obj_retention_op() {
+ bool is_obj_retention_op() const {
return s->info.args.exists("retention");
}
- bool is_obj_legal_hold_op() {
+ bool is_obj_legal_hold_op() const {
return s->info.args.exists("legal-hold");
}
- bool is_obj_update_op() override {
+ bool is_obj_update_op() const override {
return is_acl_op() || is_tagging_op() || is_obj_retention_op() || is_obj_legal_hold_op();
}
RGWOp *get_obj_op(bool get_data);
}
-namespace rgw {
-namespace auth {
-namespace s3 {
+namespace rgw::auth::s3 {
class AWSEngine : public rgw::auth::Engine {
public:
};
-} /* namespace s3 */
-} /* namespace auth */
-} /* namespace rgw */
-
-
-#endif /* CEPH_RGW_REST_S3_H */
+} // namespace rgw::auth::s3
*
*/
-#ifndef CEPH_RGW_REST_S3WEBSITE_H
-#define CEPH_RGW_REST_S3WEBSITE_H
+#pragma once
#include "rgw_rest_s3.h"
}
}
};
-
-#endif
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_rgw
-namespace rgw {
-namespace auth {
-namespace sts {
+namespace rgw::auth::sts {
bool
WebTokenEngine::is_applicable(const std::string& token) const noexcept
return result_t::deny(-EACCES);
}
-}; /* namespace sts */
-}; /* namespace auth */
-}; /* namespace rgw */
+} // namespace rgw::auth::s3
int RGWREST_STS::verify_permission()
{
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_STS_H
-#define CEPH_RGW_REST_STS_H
+#pragma once
#include "rgw_auth.h"
#include "rgw_auth_filters.h"
#include "rgw_sts.h"
#include "rgw_web_idp.h"
-namespace rgw {
-namespace auth {
-namespace sts {
+namespace rgw::auth::sts {
class WebTokenEngine : public rgw::auth::Engine {
CephContext* const cct;
}
};
-}; /* namespace sts */
-}; /* namespace auth */
-};
+} // namespace rgw::auth::sts
class RGWREST_STS : public RGWRESTOp {
protected:
const rgw::auth::StrategyRegistry&,
const std::string&) override;
};
-
-#endif /* CEPH_RGW_REST_STS_H */
-
return subdir_marker == content_type && state->size <= 1;
}
-bool RGWSwiftWebsiteHandler::is_index_present(const std::string& index)
+bool RGWSwiftWebsiteHandler::is_index_present(const std::string& index) const
{
rgw_obj obj(s->bucket, index);
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_SWIFT_H
-#define CEPH_RGW_REST_SWIFT_H
+#pragma once
#define TIME_BUF_SIZE 128
#include <boost/optional.hpp>
bool is_web_mode() const;
bool can_be_website_req() const;
bool is_web_dir() const;
- bool is_index_present(const std::string& index);
+ bool is_index_present(const std::string& index) const;
int serve_errordoc(int http_ret, std::string error_doc);
protected:
const rgw::auth::Strategy& auth_strategy;
- virtual bool is_acl_op() {
+ virtual bool is_acl_op() const {
return false;
}
* initialization (see the init() method). */
boost::optional<RGWSwiftWebsiteHandler> website_handler;
protected:
- bool is_obj_update_op() override {
+ bool is_obj_update_op() const override {
return s->op == OP_POST;
}
* initialization (see the init() method). */
boost::optional<RGWSwiftWebsiteHandler> website_handler;
protected:
- bool is_obj_update_op() override {
+ bool is_obj_update_op() const override {
return s->op == OP_POST;
}
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_USAGE_H
-#define CEPH_RGW_REST_USAGE_H
+#pragma once
#include "rgw_rest.h"
#include "rgw_rest_s3.h"
return new RGWHandler_Usage(auth_registry);
}
};
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_USER_H
-#define CEPH_RGW_REST_USER_H
+#pragma once
#include "rgw_rest.h"
#include "rgw_rest_s3.h"
return new RGWHandler_User(auth_registry);
}
};
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_REST_USER_POLICY_H
-#define CEPH_RGW_REST_USER_POLICY_H
+#pragma once
class RGWRestUserPolicy : public RGWRESTOp {
protected:
uint64_t get_op() override;
RGWOpType get_type() override { return RGW_OP_DELETE_USER_POLICY; }
};
-
-#endif /* CEPH_RGW_REST_USER_POLICY_H */
-
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_SYNC_MODULE_ES_REST_H
-#define CEPH_RGW_SYNC_MODULE_ES_REST_H
+#pragma once
#include "rgw_rest.h"
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
-
-#endif
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
// vim: ts=8 sw=2 smarttab ft=cpp
-#ifndef CEPH_RGW_SYNC_MODULE_PUBSUB_REST_H
-#define CEPH_RGW_SYNC_MODULE_PUBSUB_REST_H
+#pragma once
#include "rgw_rest.h"
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
-
-#endif