rgw_crypt.cc
rgw_crypt_sanitize.cc
rgw_iam_policy.cc
- rgw_rest_user_policy.cc)
+ rgw_rest_user_policy.cc
+ rgw_sts.cc
+ rgw_rest_sts.cc)
+
add_library(rgw_common OBJECT ${librgw_common_srcs})
if(WITH_LTTNG)
// S3 website mode is a specialization of S3
const bool s3website_enabled = apis_map.count("s3website") > 0;
+ const bool sts_enabled = apis_map.count("sts") > 0;
// Swift API entrypoint could placed in the root instead of S3
const bool swift_at_root = g_conf()->rgw_swift_url_prefix == "/";
if (apis_map.count("s3") > 0 || s3website_enabled) {
if (! swift_at_root) {
rest.register_default_mgr(set_logging(rest_filter(store, RGW_REST_S3,
- new RGWRESTMgr_S3(s3website_enabled))));
+ new RGWRESTMgr_S3(s3website_enabled, sts_enabled))));
} else {
derr << "Cannot have the S3 or S3 Website enabled together with "
<< "Swift API placed in the root of hierarchy" << dendl;
rest.register_resource(g_conf()->rgw_admin_entry, admin_resource);
}
- if (apis_map.count("sts") > 0) {
- auto *sts = new RGWRESTMgr_STS;
- rest.register_resource(g_conf()->rgw_sts_entry, set_logging(sts));
- }
-
/* Initialize the registry of auth strategies which will coordinate
* the dynamic reconfiguration. */
auto auth_registry = \
#include "include/ceph_assert.h"
#include "include/assert.h"
#include "rgw_role.h"
+#include "rgw_rest_sts.h"
#include "rgw_sts.h"
#define dout_context g_ceph_context
if (action.compare("DeleteUserPolicy") == 0)
return new RGWDeleteUserPolicy;
}
+ if (this->isSTSenabled) {
+ RGWHandler_REST_STS sts_handler(auth_registry);
+ sts_handler.init(store, s, s->cio);
+ return sts_handler.get_op(store);
+ }
return NULL;
}
}
} else {
if (s->init_state.url_bucket.empty()) {
- handler = new RGWHandler_REST_Service_S3(auth_registry);
+ handler = new RGWHandler_REST_Service_S3(auth_registry, enable_sts);
} else if (s->object.empty()) {
handler = new RGWHandler_REST_Bucket_S3(auth_registry);
} else {
class RGWHandler_REST_S3 : public RGWHandler_REST {
friend class RGWRESTMgr_S3;
-
+protected:
const rgw::auth::StrategyRegistry& auth_registry;
public:
static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
class RGWHandler_REST_Service_S3 : public RGWHandler_REST_S3 {
protected:
+ bool isSTSenabled;
bool is_usage_op() {
return s->info.args.exists("usage");
}
RGWOp *op_head() override;
RGWOp *op_post() override;
public:
- using RGWHandler_REST_S3::RGWHandler_REST_S3;
+ RGWHandler_REST_Service_S3(const rgw::auth::StrategyRegistry& auth_registry,
+ bool isSTSenabled) :
+ RGWHandler_REST_S3(auth_registry), isSTSenabled(isSTSenabled) {}
~RGWHandler_REST_Service_S3() override = default;
};
class RGWRESTMgr_S3 : public RGWRESTMgr {
private:
bool enable_s3website;
+ bool enable_sts;
public:
- explicit RGWRESTMgr_S3(bool enable_s3website = false)
- : enable_s3website(enable_s3website) {
+ explicit RGWRESTMgr_S3(bool enable_s3website = false, bool enable_sts = false)
+ : enable_s3website(enable_s3website),
+ enable_sts(enable_sts) {
}
~RGWRESTMgr_S3() override = default;