return 0;
}
+int RGWOp::do_aws4_auth_completion()
+{
+ int ret;
+
+ if (s->aws4_auth_needs_complete) {
+ /* complete */
+ ret = RGW_Auth_S3::authorize_aws4_auth_complete(store, s);
+ s->aws4_auth_needs_complete = false;
+ if (ret) {
+ return ret;
+ }
+ /* verify signature */
+ if (s->aws4_auth->signature != s->aws4_auth->new_signature) {
+ ret = -ERR_SIGNATURE_NO_MATCH;
+ ldout(s->cct, 20) << "delayed aws4 auth failed" << dendl;
+ return ret;
+ }
+ /* authorization ok */
+ dout(10) << "v4 auth ok" << dendl;
+ }
+
+ return 0;
+}
+
int RGWOp::init_quota()
{
/* no quota enforcement for system requests */
RGWQuotaInfo user_quota;
int op_ret;
+ int do_aws4_auth_completion();
+
virtual int init_quota();
public:
RGWOp() : s(NULL), dialect_handler(NULL), store(NULL), cors_exist(false),
virtual int verify_params();
virtual int get_params();
- int get_data(bufferlist& bl);
+ virtual int get_data(bufferlist& bl);
};
class RGWPostObj_ObjStore : public RGWPostObj
return RGWPutObj_ObjStore::get_params();
}
+int RGWPutObj_ObjStore_S3::get_data(bufferlist& bl)
+{
+ int ret = RGWPutObj_ObjStore::get_data(bl);
+ if (ret < 0)
+ s->aws4_auth_needs_complete = false;
+ if ((ret == 0) && s->aws4_auth_needs_complete) {
+ int ret_auth = do_aws4_auth_completion();
+ if (ret_auth)
+ return ret_auth;
+ }
+ return ret;
+}
+
static int get_success_retcode(int code)
{
switch (code) {
~RGWPutObj_ObjStore_S3() {}
int get_params();
+ int get_data(bufferlist& bl);
void send_response();
};