Skip to content

Latest commit

 

History

History
304 lines (279 loc) · 41.5 KB

s3_compliance.rst

File metadata and controls

304 lines (279 loc) · 41.5 KB

Rados Gateway S3 API Compliance

Warning

This document is a draft, it might not be accurate

Naming code reference

Here comes a BNF definition on how to name a feature in the code for referencing purpose : :

name ::= request_type "_" ( header | operation ) ( "_" header_option )?

request_type ::= "req" | "res"

header ::= string

operation ::= method resource

method ::= "GET" | "PUT" | "POST" | "DELETE" | "OPTIONS" | "HEAD"

resource ::= string

header_option ::= string

Common Request Headers

S3 Documentation reference : http://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html

Header Supported? Code Links Tests links
Authorization Yes
int RGW_Auth_S3::authorize(RGWRados *store, struct req_state *s)
if (auth_sign != digest)
Content-Length Yes
Content-Type Yes
Content-MD5 Yes
supplied_md5_b64, supplied_md5_b64 + strlen(supplied_md5_b64));
buf_to_hex(m, CEPH_CRYPTO_MD5_DIGESTSIZE, calc_md5);
Date Yes
const char *str = info.env->get("HTTP_DATE");
Expect Yes
s->expect_cont = (expect && !strcasecmp(expect, "100-continue"));
if (s->expect_cont) {
if (s->expect_cont)
Host ?
x-amz-date Yes
req_date = info.env->get("HTTP_X_AMZ_DATE");
should take precedence over DATE as mentioned here -> http://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonRequestHeaders.html
x-amz-security-token No

Common Response Headers

S3 Documentation reference : http://docs.aws.amazon.com/AmazonS3/latest/API/RESTCommonResponseHeaders.html

Header Supported? Code Links Tests links
Content-Length Yes
Connection ?
Date ?
ETag Yes
policy.encode(aclbl);
attrs[RGW_ATTR_ETAG] = etag_bl;
dump_etag(s, etag);
s->formatter->dump_format("ETag", "\"%s\"", iter->etag.c_str());
dump_etag(s, etag.c_str());
s->formatter->dump_string("ETag", etag);
s->formatter->dump_string("ETag", etag);
s->formatter->dump_string("ETag", info.etag);
Server No
x-amz-delete-marker No
x-amz-id-2 No
x-amz-request-id Yes https://github.com/ceph/ceph/commit/b711e3124f8f73c17ebd19b38807a1b77f201e44
x-amz-version-id No

Operations on the Service

S3 Documentation reference : http://docs.aws.amazon.com/AmazonS3/latest/API/RESTServiceOps.html

Type Operation Supported? Code links Tests links
GET Service Yes
return new RGWHandler_ObjStore_Service_S3;
return new RGWListBuckets_ObjStore_S3;
void RGWListBuckets_ObjStore_S3::send_response_begin(bool has_buckets)

Operations on Buckets

S3 Documentation reference : http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketOps.html

Type Operation Supported? Code links Tests links
DELETE Bucket Yes
RGWOp *RGWHandler_ObjStore_Bucket_S3::op_delete()
RGWOp *RGWHandler_Bucket::op_delete()
void RGWOp_Object_Remove::execute()
int RGWBucketAdminOp::remove_object(RGWRados *store, RGWBucketAdminOpState& op_state)
int RGWBucket::remove_object(RGWBucketAdminOpState& op_state, std::string *err_msg)
int rgw_remove_object(RGWRados *store, rgw_bucket& bucket, std::string& object)
void RGWDeleteBucket_ObjStore_S3::send_response()
DELETE Bucket cors ?
return new RGWDeleteCORS_ObjStore_S3;
DELETE Bucket lifecycle No
DELETE Bucket policy ?
DELETE Bucket tagging ?
DELETE Bucket website No
GET Bucket Yes
return new RGWListBuckets_ObjStore_S3;
void RGWListBuckets_ObjStore_S3::send_response_begin(bool has_buckets)
GET Bucket acl Yes
return new RGWGetACLs_ObjStore_S3;
void RGWGetACLs::execute()
void RGWGetACLs_ObjStore_S3::send_response()
GET Bucket cors ?
} else if (is_cors_op()) {
void RGWGetCORS::execute()
handler->read_cors_config();
GET Bucket lifecycle No
GET Bucket location No
GET Bucket policy ?
return new RGWOp_Get_Policy;
void RGWOp_Get_Policy::execute()
GET Bucket logging ?
return new RGWGetBucketLogging_ObjStore_S3;
void RGWGetBucketLogging_ObjStore_S3::send_response()
GET Bucket notification No
GET Bucket tagging No
GET Bucket Object versions No
GET Bucket requestPayment No
GET Bucket versioning No
GET Bucket website No
GET List Multipart uploads Yes
return new RGWListBucketMultiparts_ObjStore_S3;
int RGWListMultipart_ObjStore::get_params()
int RGWListBucketMultiparts::verify_permission()
void RGWListBucketMultiparts::execute()
HEAD Bucket Yes
return get_obj_op(false);
return new RGWStatBucket_ObjStore_S3;
int RGWStatBucket::verify_permission()
void RGWStatBucket::execute()
PUT Bucket Yes
return new RGWCreateBucket_ObjStore_S3;
int RGWCreateBucket_ObjStore_S3::get_params()
void RGWCreateBucket_ObjStore_S3::send_response()
int RGWCreateBucket::verify_permission()
void RGWCreateBucket::execute()
PUT Bucket acl Yes
return new RGWPutACLs_ObjStore_S3;
int RGWPutACLs_ObjStore_S3::get_policy_from_state(RGWRados *store, struct req_state *s, stringstream& ss)
void RGWPutACLs_ObjStore_S3::send_response()
int RGWPutACLs::verify_permission()
void RGWPutACLs::execute()
PUT Bucket cors ?
return new RGWPutCORS_ObjStore_S3;
void RGWPutCORS_ObjStore_S3::send_response()
int RGWPutCORS::verify_permission()
void RGWPutCORS::execute()
PUT Bucket lifecycle No
PUT Bucket policy ?
PUT Bucket logging ?
PUT Bucket notification No
PUT Bucket tagging ?
PUT Bucket requestPayment No
PUT Bucket versioning No
PUT Bucket website No

Operations on Objects

S3 Documentation reference : http://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectOps.html

Type Operation Supported? Code links Tests links
DELETE Object Yes
return new RGWDeleteObj_ObjStore_S3;
int RGWDeleteObj::verify_permission()
void RGWDeleteObj::execute()
DELETE Multiple objects Yes
return new RGWDeleteMultiObj_ObjStore_S3;
void RGWDeleteMultiObj_ObjStore_S3::send_status()
void RGWDeleteMultiObj_ObjStore_S3::begin_response()
void RGWDeleteMultiObj_ObjStore_S3::send_partial_response(pair<string,int>& result)
void RGWDeleteMultiObj_ObjStore_S3::end_response()
int RGWDeleteObj::verify_permission()
void RGWDeleteObj::execute()
GET Object Yes
return get_obj_op(true);
int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs, off_t bl_len)
int RGWGetObj::verify_permission()
int RGWGetObj::read_user_manifest_part(rgw_bucket& bucket, RGWObjEnt& ent, RGWAccessControlPolicy *bucket_policy, off_t start_ofs, off_t end_ofs)
int RGWGetObj::iterate_user_manifest_parts(rgw_bucket& bucket, string& obj_prefix, RGWAccessControlPolicy *bucket_policy,
int RGWGetObj::handle_user_manifest(const char *prefix)
int RGWGetObj::get_data_cb(bufferlist& bl, off_t bl_ofs, off_t bl_len)
void RGWGetObj::execute()
int RGWGetObj::init_common()
GET Object acl Yes
GET Object torrent No
HEAD Object Yes
return get_obj_op(false);
int RGWGetObj_ObjStore_S3::send_response_data(bufferlist& bl, off_t bl_ofs, off_t bl_len)
int RGWGetObj::verify_permission()
int RGWGetObj::read_user_manifest_part(rgw_bucket& bucket, RGWObjEnt& ent, RGWAccessControlPolicy *bucket_policy, off_t start_ofs, off_t end_ofs)
int RGWGetObj::iterate_user_manifest_parts(rgw_bucket& bucket, string& obj_prefix, RGWAccessControlPolicy *bucket_policy,
int RGWGetObj::handle_user_manifest(const char *prefix)
int RGWGetObj::get_data_cb(bufferlist& bl, off_t bl_ofs, off_t bl_len)
void RGWGetObj::execute()
int RGWGetObj::init_common()
OPTIONS Object Yes
return new RGWOptionsCORS_ObjStore_S3;
void RGWOptionsCORS_ObjStore_S3::send_response()
void RGWOptionsCORS::get_response_params(string& hdrs, string& exp_hdrs, unsigned *max_age) {
int RGWOptionsCORS::validate_cors_request() {
void RGWOptionsCORS::execute()
POST Object Yes
return new RGWPostObj_ObjStore_S3;
int RGWPostObj_ObjStore_S3::read_with_boundary(bufferlist& bl, uint64_t max, bool check_crlf,
int RGWPostObj_ObjStore_S3::read_line(bufferlist& bl, uint64_t max,
int RGWPostObj_ObjStore_S3::read_data(bufferlist& bl, uint64_t max,
int RGWPostObj_ObjStore_S3::read_form_part_header(struct post_form_part *part,
bool RGWPostObj_ObjStore_S3::part_str(const string& name, string *val)
bool RGWPostObj_ObjStore_S3::part_bl(const string& name, bufferlist *pbl)
void RGWPostObj_ObjStore_S3::rebuild_key(string& key)
int RGWPostObj_ObjStore_S3::get_params()
int RGWPostObj_ObjStore_S3::get_policy()
int RGWPostObj_ObjStore_S3::complete_get_params()
int RGWPostObj_ObjStore_S3::get_data(bufferlist& bl)
void RGWPostObj_ObjStore_S3::send_response()
int RGWPostObj::verify_permission()
void RGWPostObj::dispose_processor(RGWPutObjProcessor *processor)
void RGWPostObj::execute()
POST Object restore ?
PUT Object Yes
PUT Object acl Yes
PUT Object copy Yes
PUT Initiate multipart upload Yes
PUT Upload Part Yes
PUT Upload Part copy ?
PUT Complete multipart upload Yes
PUT Abort multipart upload Yes
PUT List parts Yes