return ret;
} /* process_request */
- static inline void abort_req(struct req_state *s, RGWOp *op, int err_no)
+ static inline void abort_req(req_state *s, RGWOp *op, int err_no)
{
if (!s)
return;
rgw_env.set("HTTP_HOST", "");
/* XXX and -then- bloat up req_state with string copies from it */
- struct req_state rstate(req->cct, &rgw_env, req->id);
- struct req_state *s = &rstate;
+ req_state rstate(req->cct, &rgw_env, req->id);
+ req_state *s = &rstate;
// XXX fix this
s->cio = io;
return -EINVAL;
}
- struct req_state* s = req->get_state();
+ req_state* s = req->get_state();
RGWLibIO& io_ctx = req->get_io();
RGWEnv& rgw_env = io_ctx.get_env();
class RGWCtl;
struct rgw_log_entry;
+struct req_state;
namespace rgw {
namespace auth {
/* Type conversions to work around lack of req_state type hierarchy matching
* (e.g.) REST backends (may be replaced w/dynamic typed req_state). */
-static inline rgw::io::RestfulClient* RESTFUL_IO(struct req_state* s) {
+static inline rgw::io::RestfulClient* RESTFUL_IO(req_state* s) {
ceph_assert(dynamic_cast<rgw::io::RestfulClient*>(s->cio) != nullptr);
return static_cast<rgw::io::RestfulClient*>(s->cio);
}
-static inline rgw::io::Accounter* ACCOUNTING_IO(struct req_state* s) {
+static inline rgw::io::Accounter* ACCOUNTING_IO(req_state* s) {
auto ptr = dynamic_cast<rgw::io::Accounter*>(s->cio);
ceph_assert(ptr != nullptr);
err.err_code = "UnknownError";
}
-void set_req_state_err(struct req_state* s, int err_no, const string& err_msg)
+void set_req_state_err(req_state* s, int err_no, const string& err_msg)
{
if (s) {
set_req_state_err(s, err_no);
}
}
-void set_req_state_err(struct req_state* s, int err_no)
+void set_req_state_err(req_state* s, int err_no)
{
if (s) {
set_req_state_err(s->err, err_no, s->prot_flags);
}
}
-void dump(struct req_state* s)
+void dump(req_state* s)
{
if (s->format != RGW_FORMAT_HTML)
s->formatter->open_object_section("Error");
}
bool verify_user_permission(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
const rgw::ARN& res,
const uint64_t op)
{
}
bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
const int perm)
{
perm_state_from_req_state ps(s);
}
bool verify_bucket_permission(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
const rgw_bucket& bucket,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
return user_acl->verify_permission(dpp, *s->identity, perm, perm);
}
-bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state * const s,
+bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, req_state * const s,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
const int perm)
perm);
}
-bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state * const s, const int perm)
+bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp, req_state * const s, const int perm)
{
perm_state_from_req_state ps(s);
perm);
}
-bool verify_bucket_permission(const DoutPrefixProvider* dpp, struct req_state * const s, const uint64_t op)
+bool verify_bucket_permission(const DoutPrefixProvider* dpp, req_state * const s, const uint64_t op)
{
perm_state_from_req_state ps(s);
// Authorize anyone permitted by the bucket policy, identity policies, session policies and the bucket owner
// unless explicitly denied by the policy.
-int verify_bucket_owner_or_policy(struct req_state* const s,
+int verify_bucket_owner_or_policy(req_state* const s,
const uint64_t op)
{
auto identity_policy_res = eval_identity_or_session_policies(s->iam_user_policies, s->env, op, ARN(s->bucket->get_key()));
return user_acl->verify_permission(dpp, *s->identity, swift_perm, swift_perm);
}
-bool verify_object_permission(const DoutPrefixProvider* dpp, struct req_state * const s,
+bool verify_object_permission(const DoutPrefixProvider* dpp, req_state * const s,
const rgw_obj& obj,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
return user_acl->verify_permission(dpp, *s->identity, swift_perm, swift_perm);
}
-bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state *s, int perm)
+bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, req_state *s, int perm)
{
perm_state_from_req_state ps(s);
perm);
}
-bool verify_object_permission(const DoutPrefixProvider* dpp, struct req_state *s, uint64_t op)
+bool verify_object_permission(const DoutPrefixProvider* dpp, req_state *s, uint64_t op)
{
perm_state_from_req_state ps(s);
#define UINT32_MAX (0xffffffffu)
#endif
-struct req_state;
-
typedef void *RGWAccessHandle;
enum RGWIntentEvent {
unsigned get_subsys() const override { return ceph_subsys_rgw; }
};
-void set_req_state_err(struct req_state*, int);
-void set_req_state_err(struct req_state*, int, const std::string&);
+void set_req_state_err(req_state*, int);
+void set_req_state_err(req_state*, int, const std::string&);
void set_req_state_err(struct rgw_err&, int, const int);
-void dump(struct req_state*);
+void dump(req_state*);
/** Store basic data on bucket */
struct RGWBucketEnt {
const uint64_t op,
const rgw::ARN& arn);
bool verify_user_permission(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
RGWAccessControlPolicy * const user_acl,
const std::vector<rgw::IAM::Policy>& user_policies,
const std::vector<rgw::IAM::Policy>& session_policies,
const rgw::ARN& res,
const uint64_t op);
bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
RGWAccessControlPolicy * const user_acl,
const int perm);
bool verify_user_permission(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
const rgw::ARN& res,
const uint64_t op);
bool verify_user_permission_no_policy(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
int perm);
bool verify_bucket_permission(
const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
const rgw_bucket& bucket,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
const std::vector<rgw::IAM::Policy>& identity_policies,
const std::vector<rgw::IAM::Policy>& session_policies,
const uint64_t op);
-bool verify_bucket_permission(const DoutPrefixProvider* dpp, struct req_state * const s, const uint64_t op);
+bool verify_bucket_permission(const DoutPrefixProvider* dpp, req_state * const s, const uint64_t op);
bool verify_bucket_permission_no_policy(
const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
const int perm);
bool verify_bucket_permission_no_policy(const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
const int perm);
-int verify_bucket_owner_or_policy(struct req_state* const s,
+int verify_bucket_owner_or_policy(req_state* const s,
const uint64_t op);
extern bool verify_object_permission(
const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
const rgw_obj& obj,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
const std::vector<rgw::IAM::Policy>& identity_policies,
const std::vector<rgw::IAM::Policy>& session_policies,
const uint64_t op);
-extern bool verify_object_permission(const DoutPrefixProvider* dpp, struct req_state *s, uint64_t op);
+extern bool verify_object_permission(const DoutPrefixProvider* dpp, req_state *s, uint64_t op);
extern bool verify_object_permission_no_policy(
const DoutPrefixProvider* dpp,
- struct req_state * const s,
+ req_state * const s,
RGWAccessControlPolicy * const user_acl,
RGWAccessControlPolicy * const bucket_acl,
RGWAccessControlPolicy * const object_acl,
int perm);
-extern bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, struct req_state *s,
+extern bool verify_object_permission_no_policy(const DoutPrefixProvider* dpp, req_state *s,
int perm);
extern int verify_object_lock(
const DoutPrefixProvider* dpp,
}
int
-make_canonical_context(struct req_state *s,
+make_canonical_context(req_state *s,
std::string_view &context,
std::string &cooked_context)
{
}
};
-std::string fetch_bucket_key_id(struct req_state *s)
+std::string fetch_bucket_key_id(req_state *s)
{
auto kek_iter = s->bucket_attrs.find(RGW_ATTR_BUCKET_ENCRYPTION_KEY_ID);
if (kek_iter == s->bucket_attrs.end())
}
const std::string cant_expand_key{ "\uFFFD" };
-std::string expand_key_name(struct req_state *s, const std::string_view&t)
+std::string expand_key_name(req_state *s, const std::string_view&t)
{
std::string r;
size_t i, j;
return 0;
}
-int rgw_s3_prepare_encrypt(struct req_state* s,
+int rgw_s3_prepare_encrypt(req_state* s,
std::map<std::string, ceph::bufferlist>& attrs,
std::unique_ptr<BlockCrypt>* block_crypt,
std::map<std::string, std::string>& crypt_http_responses)
}
-int rgw_s3_prepare_decrypt(struct req_state* s,
+int rgw_s3_prepare_decrypt(req_state* s,
map<string, bufferlist>& attrs,
std::unique_ptr<BlockCrypt>* block_crypt,
std::map<std::string, std::string>& crypt_http_responses)
}; /* RGWPutObj_BlockEncrypt */
-int rgw_s3_prepare_encrypt(struct req_state* s,
+int rgw_s3_prepare_encrypt(req_state* s,
std::map<std::string, ceph::bufferlist>& attrs,
std::unique_ptr<BlockCrypt>* block_crypt,
std::map<std::string,
std::string>& crypt_http_responses);
-int rgw_s3_prepare_decrypt(struct req_state* s,
+int rgw_s3_prepare_decrypt(req_state* s,
std::map<std::string, ceph::bufferlist>& attrs,
std::unique_ptr<BlockCrypt>* block_crypt,
std::map<std::string,
}
int RGWWriteRequest::exec_start() {
- struct req_state* state = get_state();
+ req_state* state = get_state();
/* Object needs a bucket from this point */
state->object->set_bucket(state->bucket.get());
int RGWWriteRequest::exec_continue()
{
- struct req_state* state = get_state();
+ req_state* state = get_state();
op_ret = 0;
/* check guards (e.g., contig write) */
map<string, string>::iterator iter;
char calc_md5[CEPH_CRYPTO_MD5_DIGESTSIZE * 2 + 1];
unsigned char m[CEPH_CRYPTO_MD5_DIGESTSIZE];
- struct req_state* state = get_state();
+ req_state* state = get_state();
size_t osize = rgw_fh->get_size();
struct timespec octime = rgw_fh->get_ctime();
}
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
}
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
}
void send_response() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
auto cnow = real_clock::now();
/* enumerate objs and common_prefixes in parallel,
}
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "PUT";
state->op = OP_PUT;
}
int get_params(optional_yield) override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
RGWAccessControlPolicy_S3 s3policy(state->cct);
/* we don't have (any) headers, so just create canned ACLs */
int ret = s3policy.create_canned(state->owner, state->bucket_owner, state->canned_acl);
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "DELETE";
state->op = OP_DELETE;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "PUT";
state->op = OP_PUT;
}
int get_params(optional_yield) override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
RGWAccessControlPolicy_S3 s3policy(state->cct);
/* we don't have (any) headers, so just create canned ACLs */
int ret = s3policy.create_canned(state->owner, state->bucket_owner, state->canned_acl);
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "DELETE";
state->op = OP_DELETE;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
}
void send_response() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
// try objects
for (const auto& iter : objs) {
auto& name = iter.key.name;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "PUT";
state->op = OP_PUT;
}
int get_params(optional_yield) override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
RGWAccessControlPolicy_S3 s3policy(state->cct);
/* we don't have (any) headers, so just create canned ACLs */
int ret = s3policy.create_canned(state->owner, state->bucket_owner, state->canned_acl);
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "PUT"; // XXX check
state->op = OP_PUT;
}
int get_params(optional_yield) override {
- struct req_state* s = get_state();
+ req_state* s = get_state();
RGWAccessControlPolicy_S3 s3policy(s->cct);
/* we don't have (any) headers, so just create canned ACLs */
int ret = s3policy.create_canned(s->owner, s->bucket_owner, s->canned_acl);
virtual int header_init() {
- struct req_state* s = get_state();
+ req_state* s = get_state();
s->info.method = "GET";
s->op = OP_GET;
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "PUT";
state->op = OP_PUT;
virtual int header_init() {
- struct req_state* s = get_state();
+ req_state* s = get_state();
s->info.method = "DELETE";
s->op = OP_PUT;
}
int header_init() override {
- struct req_state* state = get_state();
+ req_state* state = get_state();
state->info.method = "GET";
state->op = OP_GET;
return 0;
RGWHandler_Lib() {}
~RGWHandler_Lib() override {}
static int init_from_header(rgw::sal::Store* store,
- struct req_state *s);
+ req_state *s);
}; /* RGWHandler_Lib */
class RGWLibRequest : public RGWRequest,
CephContext* cct;
/* unambiguiously return req_state */
- inline struct req_state* get_state() { return this->RGWRequest::s; }
+ inline req_state* get_state() { return this->RGWRequest::s; }
RGWLibRequest(CephContext* _cct, std::unique_ptr<rgw::sal::User> _user)
: RGWRequest(rgwlib.get_store()->get_new_req_id()),
using RGWHandler::init;
int init(const RGWEnv& rgw_env, rgw::sal::Store* _store,
- RGWLibIO* io, struct req_state* _s) {
+ RGWLibIO* io, req_state* _s) {
RGWRequest::init_state(_s);
RGWHandler::init(_store, _s, io);
class RGWLibContinuedReq : public RGWLibRequest {
RGWLibIO io_ctx;
- struct req_state rstate;
+ req_state rstate;
public:
RGWLibContinuedReq(CephContext* _cct,
using namespace std;
-static void set_param_str(struct req_state *s, const char *name, string& str)
+static void set_param_str(req_state *s, const char *name, string& str)
{
const char *p = s->info.env->get(name);
if (p)
usage_logger = NULL;
}
-static void log_usage(struct req_state *s, const string& op_name)
+static void log_usage(req_state *s, const string& op_name)
{
if (s->system_request) /* don't log system user operations */
return;
sinks.push_back(sink);
}
-int OpsLogManifold::log(struct req_state* s, struct rgw_log_entry& entry)
+int OpsLogManifold::log(req_state* s, struct rgw_log_entry& entry)
{
int ret = 0;
for (const auto &sink : sinks) {
file.close();
}
-int OpsLogFile::log_json(struct req_state* s, bufferlist& bl)
+int OpsLogFile::log_json(req_state* s, bufferlist& bl)
{
std::unique_lock lock(mutex);
if (data_size + bl.length() >= max_data_size) {
bl.append(s);
}
-int JsonOpsLogSink::log(struct req_state* s, struct rgw_log_entry& entry)
+int JsonOpsLogSink::log(req_state* s, struct rgw_log_entry& entry)
{
bufferlist bl;
delim.append(",\n");
}
-int OpsLogSocket::log_json(struct req_state* s, bufferlist& bl)
+int OpsLogSocket::log_json(req_state* s, bufferlist& bl)
{
append_output(bl);
return 0;
{
}
-int OpsLogRados::log(struct req_state* s, struct rgw_log_entry& entry)
+int OpsLogRados::log(req_state* s, struct rgw_log_entry& entry)
{
if (!s->cct->_conf->rgw_ops_log_rados) {
return 0;
return 0;
}
-int rgw_log_op(RGWREST* const rest, struct req_state *s, const string& op_name, OpsLogSink *olog)
+int rgw_log_op(RGWREST* const rest, req_state *s, const string& op_name, OpsLogSink *olog)
{
struct rgw_log_entry entry;
string bucket_id;
class OpsLogSink {
public:
- virtual int log(struct req_state* s, struct rgw_log_entry& entry) = 0;
+ virtual int log(req_state* s, struct rgw_log_entry& entry) = 0;
virtual ~OpsLogSink() = default;
};
public:
~OpsLogManifold() override;
void add_sink(OpsLogSink* sink);
- int log(struct req_state* s, struct rgw_log_entry& entry) override;
+ int log(req_state* s, struct rgw_log_entry& entry) override;
};
class JsonOpsLogSink : public OpsLogSink {
void formatter_to_bl(bufferlist& bl);
protected:
- virtual int log_json(struct req_state* s, bufferlist& bl) = 0;
+ virtual int log_json(req_state* s, bufferlist& bl) = 0;
public:
JsonOpsLogSink();
~JsonOpsLogSink() override;
- int log(struct req_state* s, struct rgw_log_entry& entry) override;
+ int log(req_state* s, struct rgw_log_entry& entry) override;
};
class OpsLogFile : public JsonOpsLogSink, public Thread, public DoutPrefixProvider {
void flush();
protected:
- int log_json(struct req_state* s, bufferlist& bl) override;
+ int log_json(req_state* s, bufferlist& bl) override;
void *entry() override;
public:
OpsLogFile(CephContext* cct, std::string& path, uint64_t max_data_size);
class OpsLogSocket : public OutputDataSocket, public JsonOpsLogSink {
protected:
- int log_json(struct req_state* s, bufferlist& bl) override;
+ int log_json(req_state* s, bufferlist& bl) override;
void init_connection(bufferlist& bl) override;
public:
public:
OpsLogRados(rgw::sal::Store* const& store);
- int log(struct req_state* s, struct rgw_log_entry& entry) override;
+ int log(req_state* s, struct rgw_log_entry& entry) override;
};
class RGWREST;
-int rgw_log_op(RGWREST* const rest, struct req_state* s,
+int rgw_log_op(RGWREST* const rest, req_state* s,
const std::string& op_name, OpsLogSink* olog);
void rgw_log_usage_init(CephContext* cct, rgw::sal::Store* store);
void rgw_log_usage_finalize();
#include <string>
#include "include/common_fwd.h"
-class req_state;
+struct req_state;
class RGWREST;
class OpsLogSink;
namespace rgw::sal {
static int read_bucket_policy(const DoutPrefixProvider *dpp,
rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
RGWBucketInfo& bucket_info,
map<string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy *policy,
static int read_obj_policy(const DoutPrefixProvider *dpp,
rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
RGWBucketInfo& bucket_info,
map<string, bufferlist>& bucket_attrs,
RGWAccessControlPolicy* acl,
* only_bucket: If true, reads the user and bucket ACLs rather than the object ACL.
* Returns: 0 on success, -ERR# otherwise.
*/
-int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, struct req_state* s, optional_yield y)
+int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store, req_state* s, optional_yield y)
{
int ret = 0;
* Returns: 0 on success, -ERR# otherwise.
*/
int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
- struct req_state *s, bool prefetch_data, optional_yield y)
+ req_state *s, bool prefetch_data, optional_yield y)
{
int ret = 0;
return ret;
}
-static int rgw_iam_remove_objtags(const DoutPrefixProvider *dpp, struct req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) {
+static int rgw_iam_remove_objtags(const DoutPrefixProvider *dpp, req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) {
object->set_atomic();
int op_ret = object->get_obj_attrs(s->yield, dpp);
if (op_ret < 0)
e.emplace(key,val);
}
-static int rgw_iam_add_tags_from_bl(struct req_state* s, bufferlist& bl, bool has_existing_obj_tag=false, bool has_resource_tag=false){
+static int rgw_iam_add_tags_from_bl(req_state* s, bufferlist& bl, bool has_existing_obj_tag=false, bool has_resource_tag=false){
RGWObjTags& tagset = s->tagset;
try {
auto bliter = bl.cbegin();
return 0;
}
-static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, struct req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) {
+static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, req_state* s, rgw::sal::Object* object, bool has_existing_obj_tag, bool has_resource_tag) {
object->set_atomic();
int op_ret = object->get_obj_attrs(s->yield, dpp);
if (op_ret < 0)
return 0;
}
-static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, struct req_state* s, bool has_existing_obj_tag, bool has_resource_tag) {
+static int rgw_iam_add_objtags(const DoutPrefixProvider *dpp, req_state* s, bool has_existing_obj_tag, bool has_resource_tag) {
if (!rgw::sal::Object::empty(s->object.get())) {
return rgw_iam_add_objtags(dpp, s, s->object.get(), has_existing_obj_tag, has_resource_tag);
}
return 0;
}
-static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, struct req_state* s, rgw::sal::Bucket* bucket) {
+static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, req_state* s, rgw::sal::Bucket* bucket) {
rgw::sal::Attrs attrs = bucket->get_attrs();
auto tags = attrs.find(RGW_ATTR_TAGS);
if (tags != attrs.end()) {
return 0;
}
-static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, struct req_state* s) {
+static int rgw_iam_add_buckettags(const DoutPrefixProvider *dpp, req_state* s) {
return rgw_iam_add_buckettags(dpp, s, s->bucket.get());
}
return make_tuple(has_existing_obj_tag, has_resource_tag);
}
-static std::tuple<bool, bool> rgw_check_policy_condition(const DoutPrefixProvider *dpp, struct req_state* s, bool check_obj_exist_tag=true) {
+static std::tuple<bool, bool> rgw_check_policy_condition(const DoutPrefixProvider *dpp, req_state* s, bool check_obj_exist_tag=true) {
return rgw_check_policy_condition(dpp, s->iam_policy, s->iam_user_policies, s->session_policies, check_obj_exist_tag);
}
-static void rgw_add_grant_to_iam_environment(rgw::IAM::Environment& e, struct req_state *s){
+static void rgw_add_grant_to_iam_environment(rgw::IAM::Environment& e, req_state *s){
using header_pair_t = std::pair <const char*, const char*>;
static const std::initializer_list <header_pair_t> acl_header_conditionals {
}
void rgw_build_iam_environment(rgw::sal::Store* store,
- struct req_state* s)
+ req_state* s)
{
const auto& m = s->info.env->get_map();
auto t = ceph::real_clock::now();
}
}
-void rgw_bucket_object_pre_exec(struct req_state *s)
+void rgw_bucket_object_pre_exec(req_state *s)
{
if (s->expect_cont)
dump_continue(s);
}
static inline void rgw_cond_decode_objtags(
- struct req_state *s,
+ req_state *s,
const std::map<std::string, buffer::list> &attrs)
{
const auto& tags = attrs.find(RGW_ATTR_TAGS);
}
std::pair<std::string, std::string>
-RGWBulkUploadOp::handle_upload_path(struct req_state *s)
+RGWBulkUploadOp::handle_upload_path(req_state *s)
{
std::string bucket_path, file_prefix;
if (! s->init_state.url_bucket.empty()) {
}
void RGWBulkUploadOp::init(rgw::sal::Store* const store,
- struct req_state* const s,
+ req_state* const s,
RGWHandler* const h)
{
RGWOp::init(store, s, h);
}
int RGWHandler::init(rgw::sal::Store* _store,
- struct req_state *_s,
+ req_state *_s,
rgw::io::BasicClient *cio)
{
store = _store;
class RGWHandler {
protected:
rgw::sal::Store* store{nullptr};
- struct req_state *s{nullptr};
+ req_state *s{nullptr};
int do_init_permissions(const DoutPrefixProvider *dpp, optional_yield y);
int do_read_permissions(RGWOp* op, bool only_bucket, optional_yield y);
virtual ~RGWHandler();
virtual int init(rgw::sal::Store* store,
- struct req_state* _s,
+ req_state* _s,
rgw::io::BasicClient* cio);
virtual int init_permissions(RGWOp*, optional_yield y) {
-void rgw_bucket_object_pre_exec(struct req_state *s);
+void rgw_bucket_object_pre_exec(req_state *s);
namespace dmc = rgw::dmclock;
-std::tuple<int, bufferlist > rgw_rest_read_all_input(struct req_state *s,
+std::tuple<int, bufferlist > rgw_rest_read_all_input(req_state *s,
const uint64_t max_len,
const bool allow_chunked=true);
*/
class RGWOp : public DoutPrefixProvider {
protected:
- struct req_state *s;
+ req_state *s;
RGWHandler *dialect_handler;
rgw::sal::Store* store;
RGWCORSConfiguration bucket_cors;
virtual int init_quota();
- std::tuple<int, bufferlist> read_all_input(struct req_state *s,
+ std::tuple<int, bufferlist> read_all_input(req_state *s,
const uint64_t max_len,
const bool allow_chunked=true) {
return 0;
}
- virtual void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *dialect_handler) {
+ virtual void init(rgw::sal::Store* store, req_state *s, RGWHandler *dialect_handler) {
this->store = store;
this->s = s;
this->dialect_handler = dialect_handler;
parse_path(const std::string_view& path);
std::pair<std::string, std::string>
- handle_upload_path(struct req_state *s);
+ handle_upload_path(req_state *s);
bool handle_file_verify_permission(RGWBucketInfo& binfo,
const rgw_obj& obj,
}
void init(rgw::sal::Store* const store,
- struct req_state* const s,
+ req_state* const s,
RGWHandler* const h) override;
int verify_permission(optional_yield y) override;
void pre_exec() override;
void execute(optional_yield y) override;
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
}
virtual int get_params(optional_yield y) = 0;
int verify_permission(optional_yield y) override;
void pre_exec() override;
void execute(optional_yield y) override;
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
relaxed_region_enforcement =
delete obj_legal_hold;
}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */
}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
has_policy(false) {
}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
attrs.emplace(std::move(key), std::move(bl)); /* key and bl are r-value refs */
}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
: dlo_manifest(NULL)
{}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
static bool parse_copy_location(const std::string_view& src,
std::string& bucket_name,
rgw_obj_key& object,
- struct req_state *s);
+ req_state *s);
void emplace_attr(std::string&& key, buffer::list&& bl) {
attrs.emplace(std::move(key), std::move(bl));
}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
dest_policy.set_ctx(s->cct);
}
void pre_exec() override;
void execute(optional_yield y) override;
- virtual int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, std::stringstream& ss) { return 0; }
+ virtual int get_policy_from_state(rgw::sal::Store* store, req_state *s, std::stringstream& ss) { return 0; }
virtual int get_params(optional_yield y) = 0;
void send_response() override = 0;
const char* name() const override { return "put_acls"; }
}
~RGWPutLC() override {}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *dialect_handler) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *dialect_handler) override {
#define COOKIE_LEN 16
char buf[COOKIE_LEN + 1];
void pre_exec() override;
void execute(optional_yield y) override;
-// virtual int get_policy_from_state(RGWRados* store, struct req_state *s, std::stringstream& ss) { return 0; }
+// virtual int get_policy_from_state(RGWRados* store, req_state *s, std::stringstream& ss) { return 0; }
virtual int get_params(optional_yield y) = 0;
void send_response() override = 0;
const char* name() const override { return "put_lifecycle"; }
public:
RGWInitMultipart() {}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy.set_ctx(s->cct);
}
truncated = false;
}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
policy = RGWAccessControlPolicy(s->cct);
}
default_max = 0;
}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
max_uploads = default_max;
}
};
extern int rgw_build_bucket_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
- struct req_state* s, optional_yield y);
+ req_state* s, optional_yield y);
extern int rgw_build_object_policies(const DoutPrefixProvider *dpp, rgw::sal::Store* store,
- struct req_state *s, bool prefetch_data, optional_yield y);
+ req_state *s, bool prefetch_data, optional_yield y);
extern void rgw_build_iam_environment(rgw::sal::Store* store,
- struct req_state* s);
+ req_state* s);
extern std::vector<rgw::IAM::Policy> get_iam_user_policy_from_attr(CephContext* cct,
std::map<std::string, bufferlist>& attrs,
const std::string& tenant);
public:
RGWGetClusterStat() {}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWOp::init(store, s, h);
}
int verify_permission(optional_yield) override {return 0;}
/* static */
int RGWHandler_Lib::init_from_header(rgw::sal::Store* store,
- struct req_state *s)
+ req_state *s)
{
string req;
string first;
RGWEnv& rgw_env = client_io->get_env();
- struct req_state rstate(g_ceph_context, &rgw_env, req->id);
- struct req_state *s = &rstate;
+ req_state rstate(g_ceph_context, &rgw_env, req->id);
+ req_state *s = &rstate;
s->ratelimit_data = ratelimit;
std::unique_ptr<rgw::sal::User> u = store->get_user(rgw_user());
ObjectWriteOperation op;
#ifdef WITH_LTTNG
- const struct req_state* s = get_req_state();
+ const req_state* s = get_req_state();
string req_id;
if (!s) {
// fake req_id
struct RGWRequest
{
uint64_t id;
- struct req_state *s;
+ req_state *s;
RGWOp *op;
explicit RGWRequest(uint64_t id) : id(id), s(NULL), op(NULL) {}
return false;
}
-static void dump_status(struct req_state *s, int status,
+static void dump_status(req_state *s, int status,
const char *status_name)
{
s->formatter->set_status(status, status_name);
}
}
-void rgw_flush_formatter_and_reset(struct req_state *s, Formatter *formatter)
+void rgw_flush_formatter_and_reset(req_state *s, Formatter *formatter)
{
std::ostringstream oss;
formatter->output_footer();
s->formatter->reset();
}
-void rgw_flush_formatter(struct req_state *s, Formatter *formatter)
+void rgw_flush_formatter(req_state *s, Formatter *formatter)
{
std::ostringstream oss;
formatter->flush(oss);
dump_errno(err.http_ret, out);
}
-void dump_errno(struct req_state *s)
+void dump_errno(req_state *s)
{
dump_status(s, s->err.http_ret, http_status_names[s->err.http_ret]);
}
-void dump_errno(struct req_state *s, int http_ret)
+void dump_errno(req_state *s, int http_ret)
{
dump_status(s, http_ret, http_status_names[http_ret]);
}
-void dump_header(struct req_state* const s,
+void dump_header(req_state* const s,
const std::string_view& name,
const std::string_view& val)
{
}
}
-void dump_header(struct req_state* const s,
+void dump_header(req_state* const s,
const std::string_view& name,
ceph::buffer::list& bl)
{
return dump_header(s, name, rgw_sanitized_hdrval(bl));
}
-void dump_header(struct req_state* const s,
+void dump_header(req_state* const s,
const std::string_view& name,
const long long val)
{
return dump_header(s, name, std::string_view(buf, len));
}
-void dump_header(struct req_state* const s,
+void dump_header(req_state* const s,
const std::string_view& name,
const utime_t& ut)
{
return dump_header(s, name, std::string_view(buf, len));
}
-void dump_content_length(struct req_state* const s, const uint64_t len)
+void dump_content_length(req_state* const s, const uint64_t len)
{
try {
RESTFUL_IO(s)->send_content_length(len);
dump_header(s, "Accept-Ranges", "bytes");
}
-static void dump_chunked_encoding(struct req_state* const s)
+static void dump_chunked_encoding(req_state* const s)
{
try {
RESTFUL_IO(s)->send_chunked_transfer_encoding();
}
}
-void dump_etag(struct req_state* const s,
+void dump_etag(req_state* const s,
const std::string_view& etag,
const bool quoted)
{
}
}
-void dump_bucket_from_state(struct req_state *s)
+void dump_bucket_from_state(req_state *s)
{
if (g_conf()->rgw_expose_bucket && ! s->bucket_name.empty()) {
if (! s->bucket_tenant.empty()) {
}
}
-void dump_redirect(struct req_state * const s, const std::string& redirect)
+void dump_redirect(req_state * const s, const std::string& redirect)
{
return dump_header_if_nonempty(s, "Location", redirect);
}
"%a, %d %b %Y %H:%M:%S %Z", tmp);
}
-void dump_time_header(struct req_state *s, const char *name, real_time t)
+void dump_time_header(req_state *s, const char *name, real_time t)
{
char timestr[TIME_BUF_SIZE];
}
-void dump_last_modified(struct req_state *s, real_time t)
+void dump_last_modified(req_state *s, real_time t)
{
dump_time_header(s, "Last-Modified", t);
}
-void dump_epoch_header(struct req_state *s, const char *name, real_time t)
+void dump_epoch_header(req_state *s, const char *name, real_time t)
{
utime_t ut(t);
char buf[65];
return dump_header(s, name, std::string_view(buf, len));
}
-void dump_time(struct req_state *s, const char *name, real_time t)
+void dump_time(req_state *s, const char *name, real_time t)
{
char buf[TIME_BUF_SIZE];
rgw_to_iso8601(t, buf, sizeof(buf));
s->formatter->dump_string(name, buf);
}
-void dump_owner(struct req_state *s, const rgw_user& id, const string& name,
+void dump_owner(req_state *s, const rgw_user& id, const string& name,
const char *section)
{
if (!section)
s->formatter->close_section();
}
-void dump_access_control(struct req_state *s, const char *origin,
+void dump_access_control(req_state *s, const char *origin,
const char *meth,
const char *hdr, const char *exp_hdr,
uint32_t max_age) {
exp_header.c_str(), max_age);
}
-void dump_start(struct req_state *s)
+void dump_start(req_state *s)
{
if (!s->content_started) {
s->formatter->output_header();
}
}
-void end_header(struct req_state* s, RGWOp* op, const char *content_type,
+void end_header(req_state* s, RGWOp* op, const char *content_type,
const int64_t proposed_content_length, bool force_content_type,
bool force_no_error)
{
dest_uri += s->info.request_params;
}
-void abort_early(struct req_state *s, RGWOp* op, int err_no,
+void abort_early(req_state *s, RGWOp* op, int err_no,
RGWHandler* handler, optional_yield y)
{
string error_content("");
perfcounter->inc(l_rgw_failed_req);
}
-void dump_continue(struct req_state * const s)
+void dump_continue(req_state * const s)
{
try {
RESTFUL_IO(s)->send_100_continue();
}
}
-void dump_range(struct req_state* const s,
+void dump_range(req_state* const s,
const uint64_t ofs,
const uint64_t end,
const uint64_t total)
}
-int dump_body(struct req_state* const s,
+int dump_body(req_state* const s,
const char* const buf,
const size_t len)
{
}
}
-int dump_body(struct req_state* const s, /* const */ ceph::buffer::list& bl)
+int dump_body(req_state* const s, /* const */ ceph::buffer::list& bl)
{
return dump_body(s, bl.c_str(), bl.length());
}
-int dump_body(struct req_state* const s, const std::string& str)
+int dump_body(req_state* const s, const std::string& str)
{
return dump_body(s, str.c_str(), str.length());
}
-int recv_body(struct req_state* const s,
+int recv_body(req_state* const s,
char* const buf,
const size_t max)
{
return 0;
}
-int RESTArgs::get_string(struct req_state *s, const string& name,
+int RESTArgs::get_string(req_state *s, const string& name,
const string& def_val, string *val, bool *existed)
{
bool exists;
return 0;
}
-int RESTArgs::get_uint64(struct req_state *s, const string& name,
+int RESTArgs::get_uint64(req_state *s, const string& name,
uint64_t def_val, uint64_t *val, bool *existed)
{
bool exists;
return 0;
}
-int RESTArgs::get_int64(struct req_state *s, const string& name,
+int RESTArgs::get_int64(req_state *s, const string& name,
int64_t def_val, int64_t *val, bool *existed)
{
bool exists;
return 0;
}
-int RESTArgs::get_uint32(struct req_state *s, const string& name,
+int RESTArgs::get_uint32(req_state *s, const string& name,
uint32_t def_val, uint32_t *val, bool *existed)
{
bool exists;
return 0;
}
-int RESTArgs::get_int32(struct req_state *s, const string& name,
+int RESTArgs::get_int32(req_state *s, const string& name,
int32_t def_val, int32_t *val, bool *existed)
{
bool exists;
return 0;
}
-int RESTArgs::get_time(struct req_state *s, const string& name,
+int RESTArgs::get_time(req_state *s, const string& name,
const utime_t& def_val, utime_t *val, bool *existed)
{
bool exists;
return 0;
}
-int RESTArgs::get_epoch(struct req_state *s, const string& name, uint64_t def_val, uint64_t *epoch, bool *existed)
+int RESTArgs::get_epoch(req_state *s, const string& name, uint64_t def_val, uint64_t *epoch, bool *existed)
{
bool exists;
string date = s->info.args.get(name, &exists);
return 0;
}
-int RESTArgs::get_bool(struct req_state *s, const string& name, bool def_val, bool *val, bool *existed)
+int RESTArgs::get_bool(req_state *s, const string& name, bool def_val, bool *val, bool *existed)
{
bool exists;
string sval = s->info.args.get(name, &exists);
return std::make_tuple(0, std::move(bl));
}
-std::tuple<int, bufferlist > rgw_rest_read_all_input(struct req_state *s,
+std::tuple<int, bufferlist > rgw_rest_read_all_input(req_state *s,
const uint64_t max_len,
const bool allow_chunked)
{
delete op;
} /* put_op */
-int RGWHandler_REST::allocate_formatter(struct req_state *s,
+int RGWHandler_REST::allocate_formatter(req_state *s,
int default_type,
bool configurable)
{
return RGWHandler_REST::reallocate_formatter(s, type);
}
-int RGWHandler_REST::reallocate_formatter(struct req_state *s, int type)
+int RGWHandler_REST::reallocate_formatter(req_state *s, int type)
{
if (s->format == type) {
// do nothing, just reset
default_mgr = mgr;
}
-RGWRESTMgr* RGWRESTMgr::get_resource_mgr(struct req_state* const s,
+RGWRESTMgr* RGWRESTMgr::get_resource_mgr(req_state* const s,
const std::string& uri,
std::string* const out_uri)
{
return len;
}
-int RGWREST::preprocess(struct req_state *s, rgw::io::BasicClient* cio)
+int RGWREST::preprocess(req_state *s, rgw::io::BasicClient* cio)
{
req_info& info = s->info;
RGWHandler_REST* RGWREST::get_handler(
rgw::sal::Store* const store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix,
RGWRestfulIO* const rio,
extern void rgw_rest_init(CephContext *cct, const rgw::sal::ZoneGroup& zone_group);
-extern void rgw_flush_formatter_and_reset(struct req_state *s,
+extern void rgw_flush_formatter_and_reset(req_state *s,
ceph::Formatter *formatter);
-extern void rgw_flush_formatter(struct req_state *s,
+extern void rgw_flush_formatter(req_state *s,
ceph::Formatter *formatter);
inline std::string_view rgw_sanitized_hdrval(ceph::buffer::list& raw)
class RESTArgs {
public:
- static int get_string(struct req_state *s, const std::string& name,
+ static int get_string(req_state *s, const std::string& name,
const std::string& def_val, std::string *val,
bool *existed = NULL);
- static int get_uint64(struct req_state *s, const std::string& name,
+ static int get_uint64(req_state *s, const std::string& name,
uint64_t def_val, uint64_t *val, bool *existed = NULL);
- static int get_int64(struct req_state *s, const std::string& name,
+ static int get_int64(req_state *s, const std::string& name,
int64_t def_val, int64_t *val, bool *existed = NULL);
- static int get_uint32(struct req_state *s, const std::string& name,
+ static int get_uint32(req_state *s, const std::string& name,
uint32_t def_val, uint32_t *val, bool *existed = NULL);
- static int get_int32(struct req_state *s, const std::string& name,
+ static int get_int32(req_state *s, const std::string& name,
int32_t def_val, int32_t *val, bool *existed = NULL);
- static int get_time(struct req_state *s, const std::string& name,
+ static int get_time(req_state *s, const std::string& name,
const utime_t& def_val, utime_t *val,
bool *existed = NULL);
- static int get_epoch(struct req_state *s, const std::string& name,
+ static int get_epoch(req_state *s, const std::string& name,
uint64_t def_val, uint64_t *epoch,
bool *existed = NULL);
- static int get_bool(struct req_state *s, const std::string& name, bool def_val,
+ static int get_bool(req_state *s, const std::string& name, bool def_val,
bool *val, bool *existed = NULL);
};
class RGWRESTFlusher : public RGWFormatterFlusher {
- struct req_state *s;
+ req_state *s;
RGWOp *op;
protected:
void do_flush() override;
void do_start(int ret) override;
public:
- RGWRESTFlusher(struct req_state *_s, RGWOp *_op) :
+ RGWRESTFlusher(req_state *_s, RGWOp *_op) :
RGWFormatterFlusher(_s->formatter), s(_s), op(_op) {}
RGWRESTFlusher() : RGWFormatterFlusher(NULL), s(NULL), op(NULL) {}
- void init(struct req_state *_s, RGWOp *_op) {
+ void init(req_state *_s, RGWOp *_op) {
s = _s;
op = _op;
set_formatter(s->formatter);
public:
RGWGetObj_ObjStore() : sent_header(false) {}
- void init(rgw::sal::Store* store, struct req_state *s, RGWHandler *h) override {
+ void init(rgw::sal::Store* store, req_state *s, RGWHandler *h) override {
RGWGetObj::init(store, s, h);
sent_header = false;
}
RGWRESTFlusher flusher;
public:
- void init(rgw::sal::Store* store, struct req_state *s,
+ void init(rgw::sal::Store* store, req_state *s,
RGWHandler *dialect_handler) override {
RGWOp::init(store, s, dialect_handler);
flusher.init(s, this);
virtual RGWOp *op_options() { return NULL; }
public:
- static int allocate_formatter(struct req_state *s, int default_formatter,
+ static int allocate_formatter(req_state *s, int default_formatter,
bool configurable);
static constexpr int MAX_BUCKET_NAME_LEN = 255;
static int validate_bucket_name(const std::string& bucket);
static int validate_object_name(const std::string& object);
- static int reallocate_formatter(struct req_state *s, int type);
+ static int reallocate_formatter(req_state *s, int type);
int init_permissions(RGWOp* op, optional_yield y) override;
int read_permissions(RGWOp* op, optional_yield y) override;
std::multimap<size_t, std::string> resources_by_size;
RGWRESTMgr* default_mgr;
- virtual RGWRESTMgr* get_resource_mgr(struct req_state* s,
+ virtual RGWRESTMgr* get_resource_mgr(req_state* s,
const std::string& uri,
std::string* out_uri);
- virtual RGWRESTMgr* get_resource_mgr_as_default(struct req_state* const s,
+ virtual RGWRESTMgr* get_resource_mgr_as_default(req_state* const s,
const std::string& uri,
std::string* our_uri) {
return this;
void register_resource(std::string resource, RGWRESTMgr* mgr);
void register_default_mgr(RGWRESTMgr* mgr);
- virtual RGWRESTMgr* get_manager(struct req_state* const s,
+ virtual RGWRESTMgr* get_manager(req_state* const s,
/* Prefix to be concatenated with @uri
* during the lookup. */
const std::string& frontend_prefix,
virtual RGWHandler_REST* get_handler(
rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix
) {
boost::container::flat_set<x_header> x_headers;
RGWRESTMgr mgr;
- static int preprocess(struct req_state *s, rgw::io::BasicClient* rio);
+ static int preprocess(req_state *s, rgw::io::BasicClient* rio);
public:
RGWREST() {}
RGWHandler_REST *get_handler(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix,
RGWRestfulIO *rio,
RGWRESTMgr **pmgr,
int *init_error);
#if 0
- RGWHandler *get_handler(RGWRados *store, struct req_state *s,
+ RGWHandler *get_handler(RGWRados *store, req_state *s,
RGWLibIO *io, RGWRESTMgr **pmgr,
int *init_error);
#endif
extern void dump_errno(int http_ret, std::string& out);
extern void dump_errno(const struct rgw_err &err, std::string& out);
-extern void dump_errno(struct req_state *s);
-extern void dump_errno(struct req_state *s, int http_ret);
-extern void end_header(struct req_state *s,
+extern void dump_errno(req_state *s);
+extern void dump_errno(req_state *s, int http_ret);
+extern void end_header(req_state *s,
RGWOp* op = nullptr,
const char *content_type = nullptr,
const int64_t proposed_content_length =
NO_CONTENT_LENGTH,
bool force_content_type = false,
bool force_no_error = false);
-extern void dump_start(struct req_state *s);
-extern void list_all_buckets_start(struct req_state *s);
-extern void dump_owner(struct req_state *s, const rgw_user& id,
+extern void dump_start(req_state *s);
+extern void list_all_buckets_start(req_state *s);
+extern void dump_owner(req_state *s, const rgw_user& id,
const std::string& name, const char *section = NULL);
-extern void dump_header(struct req_state* s,
+extern void dump_header(req_state* s,
const std::string_view& name,
const std::string_view& val);
-extern void dump_header(struct req_state* s,
+extern void dump_header(req_state* s,
const std::string_view& name,
ceph::buffer::list& bl);
-extern void dump_header(struct req_state* s,
+extern void dump_header(req_state* s,
const std::string_view& name,
long long val);
-extern void dump_header(struct req_state* s,
+extern void dump_header(req_state* s,
const std::string_view& name,
const utime_t& val);
template <class... Args>
-inline void dump_header_prefixed(struct req_state* s,
+inline void dump_header_prefixed(req_state* s,
const std::string_view& name_prefix,
const std::string_view& name,
Args&&... args) {
}
template <class... Args>
-inline void dump_header_infixed(struct req_state* s,
+inline void dump_header_infixed(req_state* s,
const std::string_view& prefix,
const std::string_view& infix,
const std::string_view& sufix,
}
template <class... Args>
-inline void dump_header_quoted(struct req_state* s,
+inline void dump_header_quoted(req_state* s,
const std::string_view& name,
const std::string_view& val) {
/* We need two extra bytes for quotes. */
}
template <class ValueT>
-inline void dump_header_if_nonempty(struct req_state* s,
+inline void dump_header_if_nonempty(req_state* s,
const std::string_view& name,
const ValueT& value) {
if (name.length() > 0 && value.length() > 0) {
}
}
-inline std::string compute_domain_uri(const struct req_state *s) {
+inline std::string compute_domain_uri(const req_state *s) {
std::string uri = (!s->info.domain.empty()) ? s->info.domain :
[&s]() -> std::string {
RGWEnv const &env(*(s->info.env));
return uri;
}
-extern void dump_content_length(struct req_state *s, uint64_t len);
+extern void dump_content_length(req_state *s, uint64_t len);
extern int64_t parse_content_length(const char *content_length);
-extern void dump_etag(struct req_state *s,
+extern void dump_etag(req_state *s,
const std::string_view& etag,
bool quoted = false);
-extern void dump_epoch_header(struct req_state *s, const char *name, real_time t);
-extern void dump_time_header(struct req_state *s, const char *name, real_time t);
-extern void dump_last_modified(struct req_state *s, real_time t);
-extern void abort_early(struct req_state* s, RGWOp* op, int err,
+extern void dump_epoch_header(req_state *s, const char *name, real_time t);
+extern void dump_time_header(req_state *s, const char *name, real_time t);
+extern void dump_last_modified(req_state *s, real_time t);
+extern void abort_early(req_state* s, RGWOp* op, int err,
RGWHandler* handler, optional_yield y);
-extern void dump_range(struct req_state* s, uint64_t ofs, uint64_t end,
+extern void dump_range(req_state* s, uint64_t ofs, uint64_t end,
uint64_t total_size);
-extern void dump_continue(struct req_state *s);
-extern void list_all_buckets_end(struct req_state *s);
-extern void dump_time(struct req_state *s, const char *name, real_time t);
+extern void dump_continue(req_state *s);
+extern void list_all_buckets_end(req_state *s);
+extern void dump_time(req_state *s, const char *name, real_time t);
extern std::string dump_time_to_str(const real_time& t);
-extern void dump_bucket_from_state(struct req_state *s);
-extern void dump_redirect(struct req_state *s, const std::string& redirect);
+extern void dump_bucket_from_state(req_state *s);
+extern void dump_redirect(req_state *s, const std::string& redirect);
extern bool is_valid_url(const char *url);
-extern void dump_access_control(struct req_state *s, const char *origin,
+extern void dump_access_control(req_state *s, const char *origin,
const char *meth,
const char *hdr, const char *exp_hdr,
uint32_t max_age);
extern void dump_access_control(req_state *s, RGWOp *op);
-extern int dump_body(struct req_state* s, const char* buf, size_t len);
-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);
+extern int dump_body(req_state* s, const char* buf, size_t len);
+extern int dump_body(req_state* s, /* const */ ceph::buffer::list& bl);
+extern int dump_body(req_state* s, const std::string& str);
+extern int recv_body(req_state* s, char* buf, size_t max);
~RGWRESTMgr_Bucket() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return new RGWHandler_Bucket(auth_registry);
~RGWRESTMgr_Config() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* ,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return new RGWHandler_Config(auth_registry);
}
int RGWHandler_REST_IAM::init(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
rgw::io::BasicClient *cio)
{
s->dialect = "iam";
return RGW_Auth_S3::authorize(dpp, store, auth_registry, s, y);
}
-int RGWHandler_REST_IAM::init_from_header(struct req_state* s,
+int RGWHandler_REST_IAM::init_from_header(req_state* s,
int default_formatter,
bool configurable_format)
{
RGWHandler_REST*
RGWRESTMgr_IAM::get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
{
void rgw_iam_parse_input();
public:
- static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
+ static int init_from_header(req_state *s, int default_formatter, bool configurable_format);
RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry,
bufferlist& bl_post_body)
~RGWHandler_REST_IAM() override = default;
int init(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider* dpp, optional_yield y) override;
int postauth_init(optional_yield y) override { return 0; }
RGWRESTMgr_IAM() = default;
~RGWRESTMgr_IAM() override = default;
- RGWRESTMgr *get_resource_mgr(struct req_state* const s,
+ RGWRESTMgr *get_resource_mgr(req_state* const s,
const std::string& uri,
std::string* const out_uri) override {
return this;
}
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry&,
const std::string&) override;
};
~RGWRESTMgr_Info() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return new RGWHandler_Info(auth_registry);
~RGWRESTMgr_Log() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state* const,
+ req_state* const,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefixs) override {
return new RGWHandler_Log(auth_registry);
~RGWRESTMgr_Metadata() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override {
return new RGWHandler_Metadata(auth_registry);
~RGWRESTMgr_Ratelimit() override = default;
RGWHandler_REST *get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return new RGWHandler_Ratelimit(auth_registry);
class RGWRESTMgr_Period : public RGWRESTMgr {
public:
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return new RGWHandler_Period(auth_registry);
RGWHandler_REST*
RGWRESTMgr_Realm::get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&)
{
RGWRESTMgr_Realm();
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override;
};
using namespace rgw;
using namespace ceph::crypto;
-void list_all_buckets_start(struct req_state *s)
+void list_all_buckets_start(req_state *s)
{
s->formatter->open_array_section_in_ns("ListAllMyBucketsResult", XMLNS_AWS_S3);
}
-void list_all_buckets_end(struct req_state *s)
+void list_all_buckets_end(req_state *s)
{
s->formatter->close_section();
}
-void dump_bucket(struct req_state *s, rgw::sal::Bucket& obj)
+void dump_bucket(req_state *s, rgw::sal::Bucket& obj)
{
s->formatter->open_object_section("Bucket");
s->formatter->dump_string("Name", obj.get_name());
}
static inline std::string get_s3_expiration_header(
- struct req_state* s,
+ req_state* s,
const ceph::real_time& mtime)
{
return rgw::lc::s3_expiration_header(
}
static inline bool get_s3_multipart_abort_header(
- struct req_state* s, const ceph::real_time& mtime,
+ req_state* s, const ceph::real_time& mtime,
ceph::real_time& date, std::string& rule_id)
{
return rgw::lc::s3_multipart_abort_header(
rgw_flush_formatter_and_reset(s, s->formatter);
}
-static void dump_bucket_metadata(struct req_state *s, rgw::sal::Bucket* bucket)
+static void dump_bucket_metadata(req_state *s, rgw::sal::Bucket* bucket)
{
dump_header(s, "X-RGW-Object-Count", static_cast<long long>(bucket->get_count()));
dump_header(s, "X-RGW-Bytes-Used", static_cast<long long>(bucket->get_size()));
dump_start(s);
}
-static int create_s3_policy(struct req_state *s, rgw::sal::Store* store,
+static int create_s3_policy(req_state *s, rgw::sal::Store* store,
RGWAccessControlPolicy_S3& s3policy,
ACLOwner& owner)
{
end_header(s, this);
}
-static inline void map_qs_metadata(struct req_state* s, bool crypto_too)
+static inline void map_qs_metadata(req_state* s, bool crypto_too)
{
/* merge S3 valid user metadata from the query-string into
* x_meta_map, which maps them to attributes */
}
int RGWPutACLs_ObjStore_S3::get_policy_from_state(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
stringstream& ss)
{
RGWAccessControlPolicy_S3 s3policy(s->cct);
}
int RGWHandler_REST_S3::init_from_header(rgw::sal::Store* store,
- struct req_state* s,
+ req_state* s,
int default_formatter,
bool configurable_format)
{
return 0;
}
-int RGWHandler_REST_S3::init(rgw::sal::Store* store, struct req_state *s,
+int RGWHandler_REST_S3::init(rgw::sal::Store* store, req_state *s,
rgw::io::BasicClient *cio)
{
int ret;
int RGW_Auth_S3::authorize(const DoutPrefixProvider *dpp,
rgw::sal::Store* const store,
const rgw::auth::StrategyRegistry& auth_registry,
- struct req_state* const s, optional_yield y)
+ req_state* const s, optional_yield y)
{
/* neither keystone and rados enabled; warn and exit! */
return ret;
}
-int RGWHandler_Auth_S3::init(rgw::sal::Store* store, struct req_state *state,
+int RGWHandler_Auth_S3::init(rgw::sal::Store* store, req_state *state,
rgw::io::BasicClient *cio)
{
int ret = RGWHandler_REST_S3::init_from_header(store, state, RGW_FORMAT_JSON, true);
}
RGWHandler_REST* RGWRESTMgr_S3::get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
{
RGWPutACLs_ObjStore_S3() {}
~RGWPutACLs_ObjStore_S3() override {}
- int get_policy_from_state(rgw::sal::Store* store, struct req_state *s, std::stringstream& ss) override;
+ int get_policy_from_state(rgw::sal::Store* store, req_state *s, std::stringstream& ss) override;
void send_response() override;
int get_params(optional_yield y) override;
};
static int authorize(const DoutPrefixProvider *dpp,
rgw::sal::Store* store,
const rgw::auth::StrategyRegistry& auth_registry,
- struct req_state *s, optional_yield y);
+ req_state *s, optional_yield y);
};
class RGWHandler_Auth_S3 : public RGWHandler_REST {
static int validate_object_name(const std::string& bucket);
int init(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override {
return RGW_Auth_S3::authorize(dpp, store, auth_registry, s, y);
protected:
const rgw::auth::StrategyRegistry& auth_registry;
public:
- static int init_from_header(rgw::sal::Store* store, struct req_state *s, int default_formatter, bool configurable_format);
+ static int init_from_header(rgw::sal::Store* store, req_state *s, int default_formatter, bool configurable_format);
explicit RGWHandler_REST_S3(const rgw::auth::StrategyRegistry& auth_registry)
: RGWHandler_REST(),
~RGWHandler_REST_S3() override = default;
int init(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override;
int postauth_init(optional_yield y) override;
~RGWRESTMgr_S3() override = default;
RGWHandler_REST *get_handler(rgw::sal::Store* store,
- struct req_state* s,
+ req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
int RGW_Auth_STS::authorize(const DoutPrefixProvider *dpp,
rgw::sal::Store* store,
const rgw::auth::StrategyRegistry& auth_registry,
- struct req_state *s, optional_yield y)
+ req_state *s, optional_yield y)
{
return rgw::auth::Strategy::apply(dpp, auth_registry.get_sts(), s, y);
}
}
int RGWHandler_REST_STS::init(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
rgw::io::BasicClient *cio)
{
s->dialect = "sts";
return RGW_Auth_S3::authorize(dpp, store, auth_registry, s, y);
}
-int RGWHandler_REST_STS::init_from_header(struct req_state* s,
+int RGWHandler_REST_STS::init_from_header(req_state* s,
int default_formatter,
bool configurable_format)
{
RGWHandler_REST*
RGWRESTMgr_STS::get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
{
static int authorize(const DoutPrefixProvider *dpp,
rgw::sal::Store* store,
const rgw::auth::StrategyRegistry& auth_registry,
- struct req_state *s, optional_yield y);
+ req_state *s, optional_yield y);
};
class RGWHandler_REST_STS : public RGWHandler_REST {
void rgw_sts_parse_input();
public:
- static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
+ static int init_from_header(req_state *s, int default_formatter, bool configurable_format);
RGWHandler_REST_STS(const rgw::auth::StrategyRegistry& auth_registry, const std::string& post_body="")
: RGWHandler_REST(),
~RGWHandler_REST_STS() override = default;
int init(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider* dpp, optional_yield y) override;
int postauth_init(optional_yield y) override { return 0; }
RGWRESTMgr_STS() = default;
~RGWRESTMgr_STS() override = default;
- RGWRESTMgr *get_resource_mgr(struct req_state* const s,
+ RGWRESTMgr *get_resource_mgr(req_state* const s,
const std::string& uri,
std::string* const out_uri) override {
return this;
}
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry&,
const std::string&) override;
};
return 0;
}
-static void dump_account_metadata(struct req_state * const s,
+static void dump_account_metadata(req_state * const s,
const RGWUsageStats& global_stats,
const std::map<std::string, RGWUsageStats> &policies_stats,
/* const */map<string, bufferlist>& attrs,
return 0;
}
-static void dump_container_metadata(struct req_state *,
+static void dump_container_metadata(req_state *,
const rgw::sal::Bucket*,
const RGWQuotaInfo&,
const RGWBucketWebsiteConf&);
rgw_flush_formatter_and_reset(s, s->formatter);
} // RGWListBucket_ObjStore_SWIFT::send_response
-static void dump_container_metadata(struct req_state *s,
+static void dump_container_metadata(req_state *s,
const rgw::sal::Bucket* bucket,
const RGWQuotaInfo& quota,
const RGWBucketWebsiteConf& ws_conf)
}
}
-static void dump_object_metadata(const DoutPrefixProvider* dpp, struct req_state * const s,
+static void dump_object_metadata(const DoutPrefixProvider* dpp, req_state * const s,
const map<string, bufferlist>& attrs)
{
map<string, string> response_attrs;
}
int RGWHandler_REST_SWIFT::init_from_header(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const std::string& frontend_prefix)
{
string req;
return 0;
}
-int RGWHandler_REST_SWIFT::init(rgw::sal::Store* store, struct req_state* s,
+int RGWHandler_REST_SWIFT::init(rgw::sal::Store* store, req_state* s,
rgw::io::BasicClient *cio)
{
struct req_init_state *t = &s->init_state;
RGWHandler_REST*
RGWRESTMgr_SWIFT::get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
{
RGWHandler_REST* RGWRESTMgr_SWIFT_Info::get_handler(
rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
{
return false;
}
- static int init_from_header(rgw::sal::Store* store, struct req_state* s,
+ static int init_from_header(rgw::sal::Store* store, req_state* s,
const std::string& frontend_prefix);
public:
explicit RGWHandler_REST_SWIFT(const rgw::auth::Strategy& auth_strategy)
int validate_bucket_name(const std::string& bucket);
- int init(rgw::sal::Store* store, struct req_state *s, rgw::io::BasicClient *cio) override;
+ int init(rgw::sal::Store* store, req_state *s, rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override;
int postauth_init(optional_yield y) override;
}
int init(rgw::sal::Store* const store,
- struct req_state* const s,
+ req_state* const s,
rgw::io::BasicClient* const cio) override {
website_handler = boost::in_place<RGWSwiftWebsiteHandler>(store, s, this);
return RGWHandler_REST_SWIFT::init(store, s, cio);
}
int init(rgw::sal::Store* const store,
- struct req_state* const s,
+ req_state* const s,
rgw::io::BasicClient* const cio) override {
website_handler = boost::in_place<RGWSwiftWebsiteHandler>(store, s, this);
return RGWHandler_REST_SWIFT::init(store, s, cio);
class RGWRESTMgr_SWIFT : public RGWRESTMgr {
protected:
- RGWRESTMgr* get_resource_mgr_as_default(struct req_state* const s,
+ RGWRESTMgr* get_resource_mgr_as_default(req_state* const s,
const std::string& uri,
std::string* const out_uri) override {
return this->get_resource_mgr(s, uri, out_uri);
~RGWRESTMgr_SWIFT() override = default;
RGWHandler_REST *get_handler(rgw::sal::Store* store,
- struct req_state *s,
+ req_state *s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
}
int init(rgw::sal::Store* const store,
- struct req_state* const state,
+ req_state* const state,
rgw::io::BasicClient* const cio) override {
state->dialect = "swift";
state->formatter = new JSONFormatter;
class RGWRESTMgr_SWIFT_CrossDomain : public RGWRESTMgr {
protected:
- RGWRESTMgr *get_resource_mgr(struct req_state* const s,
+ RGWRESTMgr *get_resource_mgr(req_state* const s,
const std::string& uri,
std::string* const out_uri) override {
return this;
~RGWRESTMgr_SWIFT_CrossDomain() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry&,
const std::string&) override {
s->prot_flags |= RGW_REST_SWIFT;
}
int init(rgw::sal::Store* const store,
- struct req_state* const state,
+ req_state* const state,
rgw::io::BasicClient* const cio) override {
state->dialect = "swift";
state->formatter = new JSONFormatter;
class RGWRESTMgr_SWIFT_HealthCheck : public RGWRESTMgr {
protected:
- RGWRESTMgr *get_resource_mgr(struct req_state* const s,
+ RGWRESTMgr *get_resource_mgr(req_state* const s,
const std::string& uri,
std::string* const out_uri) override {
return this;
~RGWRESTMgr_SWIFT_HealthCheck() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry&,
const std::string&) override {
s->prot_flags |= RGW_REST_SWIFT;
}
int init(rgw::sal::Store* const store,
- struct req_state* const state,
+ req_state* const state,
rgw::io::BasicClient* const cio) override {
state->dialect = "swift";
state->formatter = new JSONFormatter;
~RGWRESTMgr_SWIFT_Info() override = default;
RGWHandler_REST *get_handler(rgw::sal::Store* store,
- struct req_state* s,
+ req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
~RGWRESTMgr_Usage() override = default;
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return new RGWHandler_Usage(auth_registry);
~RGWRESTMgr_User() override = default;
RGWHandler_REST *get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string&) override {
return new RGWHandler_User(auth_registry);
private:
std::string sql_result;
- struct req_state* s;
+ req_state* s;
uint32_t header_size;
// the parameters are according to CRC-32 algorithm and its aligned with AWS-cli checksum
boost::crc_optimal<32, 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true, true> crc32;
int create_message(u_int32_t header_len);
public:
- aws_response_handler(struct req_state* ps, RGWOp* rgwop) : s(ps), m_rgwop(rgwop), total_bytes_returned{0}, processed_size{0}
+ aws_response_handler(req_state* ps, RGWOp* rgwop) : s(ps), m_rgwop(rgwop), total_bytes_returned{0}, processed_size{0}
{}
aws_response_handler() : s(nullptr), m_rgwop(nullptr), total_bytes_returned{0}, processed_size{0}
return true;
}
- void set(struct req_state* ps, RGWOp* rgwop)
+ void set(req_state* ps, RGWOp* rgwop)
{
s = ps;
m_rgwop = rgwop;
/** Get a @a Notification object. Used to communicate with non-RGW daemons, such as
* management/tracking software */
/** RGWOp variant */
- virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s,
+ virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s,
rgw::notify::EventType event_type, const std::string* object_name=nullptr) = 0;
/** No-req_state variant (e.g., rgwlc) */
virtual std::unique_ptr<Notification> get_notification(
}
std::unique_ptr<Notification> DBStore::get_notification(
- rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s,
+ rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s,
rgw::notify::EventType event_type, const std::string* object_name)
{
return std::make_unique<DBNotification>(obj, src_obj, event_type);
virtual std::unique_ptr<Completions> get_completions(void) override;
virtual std::unique_ptr<Notification> get_notification(
- rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s,
+ rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s,
rgw::notify::EventType event_type, const std::string* object_name) override;
virtual std::unique_ptr<Notification> get_notification(
return 0;
}
-std::unique_ptr<Notification> MotrStore::get_notification(Object* obj, Object* src_obj, struct req_state* s,
+std::unique_ptr<Notification> MotrStore::get_notification(Object* obj, Object* src_obj, req_state* s,
rgw::notify::EventType event_type, const string* object_name)
{
return std::make_unique<MotrNotification>(obj, src_obj, event_type);
virtual std::unique_ptr<Lifecycle> get_lifecycle(void) override;
virtual std::unique_ptr<Completions> get_completions(void) override;
virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj,
- struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override;
+ req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override;
virtual std::unique_ptr<Notification> get_notification(const DoutPrefixProvider* dpp, rgw::sal::Object* obj,
rgw::sal::Object* src_obj, rgw::notify::EventType event_type, rgw::sal::Bucket* _bucket,
std::string& _user_id, std::string& _user_tenant, std::string& _req_id, optional_yield y) override;
}
std::unique_ptr<Notification> RadosStore::get_notification(
- rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name)
+ rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name)
{
return std::make_unique<RadosNotification>(s, this, obj, src_obj, s, event_type, object_name);
}
virtual int cluster_stat(RGWClusterStat& stats) override;
virtual std::unique_ptr<Lifecycle> get_lifecycle(void) override;
virtual std::unique_ptr<Completions> get_completions(void) override;
- virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, struct req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override;
+ virtual std::unique_ptr<Notification> get_notification(rgw::sal::Object* obj, rgw::sal::Object* src_obj, req_state* s, rgw::notify::EventType event_type, const std::string* object_name=nullptr) override;
virtual std::unique_ptr<Notification> get_notification(
const DoutPrefixProvider* dpp, rgw::sal::Object* obj, rgw::sal::Object* src_obj,
rgw::notify::EventType event_type, rgw::sal::Bucket* _bucket, std::string& _user_id, std::string& _user_tenant,
end_header(s);
}
-int RGWHandler_SWIFT_Auth::init(rgw::sal::Store* store, struct req_state *state,
+int RGWHandler_SWIFT_Auth::init(rgw::sal::Store* store, req_state *state,
rgw::io::BasicClient *cio)
{
state->dialect = "swift-auth";
~RGWHandler_SWIFT_Auth() override {}
RGWOp *op_get() override;
- int init(rgw::sal::Store* store, struct req_state *state, rgw::io::BasicClient *cio) override;
+ int init(rgw::sal::Store* store, req_state *state, rgw::io::BasicClient *cio) override;
int authorize(const DoutPrefixProvider *dpp, optional_yield y) override;
int postauth_init(optional_yield) override { return 0; }
int read_permissions(RGWOp *op, optional_yield) override { return 0; }
RGWRESTMgr_SWIFT_Auth() = default;
~RGWRESTMgr_SWIFT_Auth() override = default;
- RGWRESTMgr *get_resource_mgr(struct req_state* const s,
+ RGWRESTMgr *get_resource_mgr(req_state* const s,
const std::string& uri,
std::string* const out_uri) override {
return this;
}
RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state*,
+ req_state*,
const rgw::auth::StrategyRegistry&,
const std::string&) override {
return new RGWHandler_SWIFT_Auth;
RGWHandler_REST* RGWRESTMgr_MDSearch_S3::get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
{
explicit RGWRESTMgr_MDSearch_S3() {}
RGWHandler_REST *get_handler(rgw::sal::Store* store,
- struct req_state* s,
+ req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
// factory for ceph specific PubSub REST handlers
RGWHandler_REST* RGWRESTMgr_PubSub::get_handler(rgw::sal::Store* store,
- struct req_state* const s,
+ req_state* const s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix)
{
class RGWRESTMgr_PubSub : public RGWRESTMgr {
public:
virtual RGWHandler_REST* get_handler(rgw::sal::Store* store,
- struct req_state* s,
+ req_state* s,
const rgw::auth::StrategyRegistry& auth_registry,
const std::string& frontend_prefix) override;
};
store = NULL;
}
-void seed::init(struct req_state *p_req, rgw::sal::Store* p_store)
+void seed::init(req_state *p_req, rgw::sal::Store* p_store)
{
s = p_req;
store = p_store;
bool is_torrent; // flag
bufferlist bl; // bufflist ready to send
- struct req_state *s{nullptr};
+ req_state *s{nullptr};
rgw::sal::Store* store{nullptr};
SHA1 h;
~seed();
int get_params();
- void init(struct req_state *p_req, rgw::sal::Store* p_store);
+ void init(req_state *p_req, rgw::sal::Store* p_store);
int get_torrent_file(rgw::sal::Object* object,
uint64_t &total_len,
ceph::bufferlist &bl_data,