OPTION(rgw_healthcheck_disabling_path, OPT_STR, "") // path that existence causes the healthcheck to respond 503
OPTION(rgw_s3_auth_use_rados, OPT_BOOL, true) // should we try to use the internal credentials for s3?
OPTION(rgw_s3_auth_use_keystone, OPT_BOOL, false) // should we try to use keystone for s3?
+OPTION(rgw_s3_auth_aws4_force_boto2_compat, OPT_BOOL, true) // force aws4 auth boto2 compatibility
/* OpenLDAP-style LDAP parameter strings */
/* rgw_ldap_uri space-separated list of LDAP servers in URI format */
if (algorithm != "AWS4-HMAC-SHA256") {
return -EPERM;
}
- return authorize_v4(store, s);
+ /* compute first aws4 signature (stick to the boto2 implementation) */
+ int err = authorize_v4(store, s);
+ if ((err==-ERR_SIGNATURE_NO_MATCH) && !store->ctx()->_conf->rgw_s3_auth_aws4_force_boto2_compat) {
+ /* compute second aws4 signature (no bugs supported) */
+ ldout(s->cct, 10) << "computing second aws4 signature..." << dendl;
+ return authorize_v4(store, s, false);
+ }
+ return err;
}
/* AWS2 */
/*
* handle v4 signatures (rados auth only)
*/
-int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s)
+int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s, bool force_boto2_compat /* = true */)
{
string::size_type pos;
bool using_qs;
}
}
string token_value = string(t);
- if (using_qs && (token == "host")) {
+ if (force_boto2_compat && using_qs && (token == "host")) {
if (!secure_port.empty()) {
if (secure_port != "443")
token_value = token_value + ":" + secure_port;
static rgw::LDAPHelper* ldh;
static int authorize_v2(RGWRados *store, struct req_state *s);
- static int authorize_v4(RGWRados *store, struct req_state *s);
+ static int authorize_v4(RGWRados *store, struct req_state *s, bool force_boto2_compat = true);
static int authorize_v4_complete(RGWRados *store, struct req_state *s,
const string& request_payload,
bool unsigned_payload);