4343#include " common/async/yield_context.h"
4444#include " rgw_website.h"
4545#include " rgw_object_lock.h"
46+ #include " rgw_object_ownership.h"
4647#include " rgw_tag.h"
4748#include " rgw_op_type.h"
4849#include " rgw_sync_policy.h"
@@ -121,6 +122,8 @@ using ceph::crypto::MD5;
121122#define RGW_ATTR_OBJECT_RETENTION RGW_ATTR_PREFIX " object-retention"
122123#define RGW_ATTR_OBJECT_LEGAL_HOLD RGW_ATTR_PREFIX " object-legal-hold"
123124
125+ // S3 Object Ownership
126+ #define RGW_ATTR_OWNERSHIP_CONTROLS RGW_ATTR_PREFIX " ownership-controls"
124127
125128#define RGW_ATTR_PG_VER RGW_ATTR_PREFIX " pg_ver"
126129#define RGW_ATTR_SOURCE_ZONE RGW_ATTR_PREFIX " source_zone"
@@ -350,6 +353,9 @@ inline constexpr const char* RGW_REST_STS_XMLNS =
350353#define ERR_PRESIGNED_URL_DISABLED 2224
351354#define ERR_AUTHORIZATION 2225 // SNS 403 AuthorizationError
352355#define ERR_ILLEGAL_LOCATION_CONSTRAINT_EXCEPTION 2226
356+ #define ERR_ACLS_NOT_SUPPORTED 2227 // 400 AccessControlListNotSupported
357+ #define ERR_INVALID_BUCKET_ACL 2228 // 400 InvalidBucketAclWithObjectOwnership
358+ #define ERR_NO_SUCH_OWNERSHIP_CONTROLS 2229 // 404 OwnershipControlsNotFoundError
353359
354360#define ERR_BUSY_RESHARDING 2300 // also in cls_rgw_types.h, don't change!
355361#define ERR_NO_SUCH_ENTITY 2301
@@ -1382,6 +1388,7 @@ struct req_state : DoutPrefixProvider {
13821388 rgw::IAM::Environment env;
13831389 boost::optional<rgw::IAM::Policy> iam_policy;
13841390 boost::optional<PublicAccessBlockConfiguration> bucket_access_conf;
1391+ rgw::s3::ObjectOwnership bucket_object_ownership = rgw::s3::ObjectOwnership::ObjectWriter;
13851392 std::vector<rgw::IAM::Policy> iam_identity_policies;
13861393
13871394 /* Is the request made by an user marked as a system one?
@@ -1696,6 +1703,7 @@ struct perm_state_base {
16961703 const rgw::IAM::Environment& env;
16971704 rgw::auth::Identity *identity;
16981705 const RGWBucketInfo bucket_info;
1706+ rgw::s3::ObjectOwnership bucket_object_ownership;
16991707 int perm_mask;
17001708 bool defer_to_bucket_acls;
17011709 boost::optional<PublicAccessBlockConfiguration> bucket_access_conf;
@@ -1704,13 +1712,15 @@ struct perm_state_base {
17041712 const rgw::IAM::Environment& _env,
17051713 rgw::auth::Identity *_identity,
17061714 const RGWBucketInfo& _bucket_info,
1715+ rgw::s3::ObjectOwnership bucket_object_ownership,
17071716 int _perm_mask,
17081717 bool _defer_to_bucket_acls,
17091718 boost::optional<PublicAccessBlockConfiguration> _bucket_access_conf = boost::none) :
17101719 cct (_cct),
17111720 env (_env),
17121721 identity (_identity),
17131722 bucket_info (_bucket_info),
1723+ bucket_object_ownership (bucket_object_ownership),
17141724 perm_mask (_perm_mask),
17151725 defer_to_bucket_acls (_defer_to_bucket_acls),
17161726 bucket_access_conf (_bucket_access_conf)
@@ -1733,13 +1743,15 @@ struct perm_state : public perm_state_base {
17331743 const rgw::IAM::Environment& _env,
17341744 rgw::auth::Identity *_identity,
17351745 const RGWBucketInfo& _bucket_info,
1746+ rgw::s3::ObjectOwnership bucket_object_ownership,
17361747 int _perm_mask,
17371748 bool _defer_to_bucket_acls,
17381749 const char *_referer,
17391750 bool _request_payer) : perm_state_base(_cct,
17401751 _env,
17411752 _identity,
17421753 _bucket_info,
1754+ bucket_object_ownership,
17431755 _perm_mask,
17441756 _defer_to_bucket_acls),
17451757 referer (_referer),
0 commit comments