}
-using AWSVerAbstractor = AWSEngine::VersionAbstractor;
-
-std::tuple<AWSVerAbstractor::access_key_id_t,
- AWSVerAbstractor::client_signature_t,
- AWSVerAbstractor::string_to_sign_t,
- AWSVerAbstractor::signature_factory_t,
- AWSVerAbstractor::completer_factory_t>
+AWSEngine::VersionAbstractor::auth_data_t
AWSGeneralAbstractor::get_auth_data(const req_state* const s) const
{
AwsVersion version;
using_qs, false);
}
-std::tuple<AWSVerAbstractor::access_key_id_t,
- AWSVerAbstractor::client_signature_t,
- AWSVerAbstractor::string_to_sign_t,
- AWSVerAbstractor::signature_factory_t,
- AWSVerAbstractor::completer_factory_t>
+AWSEngine::VersionAbstractor::auth_data_t
AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s,
/* FIXME: const. */
bool using_qs) const
}
-std::tuple<AWSVerAbstractor::access_key_id_t,
- AWSVerAbstractor::client_signature_t,
- AWSVerAbstractor::string_to_sign_t,
- AWSVerAbstractor::signature_factory_t,
- AWSVerAbstractor::completer_factory_t>
+AWSEngine::VersionAbstractor::auth_data_t
AWSGeneralAbstractor::get_auth_data_v2(const req_state* const s) const
{
boost::string_view access_key_id;
}
-std::tuple<AWSVerAbstractor::access_key_id_t,
- AWSVerAbstractor::client_signature_t,
- AWSVerAbstractor::string_to_sign_t,
- AWSVerAbstractor::signature_factory_t,
- AWSVerAbstractor::completer_factory_t>
+AWSEngine::VersionAbstractor::auth_data_t
AWSBrowserUploadAbstractor::get_auth_data_v2(const req_state* const s) const
{
return {
};
}
-std::tuple<AWSVerAbstractor::access_key_id_t,
- AWSVerAbstractor::client_signature_t,
- AWSVerAbstractor::string_to_sign_t,
- AWSVerAbstractor::signature_factory_t,
- AWSVerAbstractor::completer_factory_t>
+AWSEngine::VersionAbstractor::auth_data_t
AWSBrowserUploadAbstractor::get_auth_data_v4(const req_state* const s) const
{
const boost::string_view credential = s->auth.s3_postobj_creds.x_amz_credential;
};
}
-std::tuple<AWSVerAbstractor::access_key_id_t,
- AWSVerAbstractor::client_signature_t,
- AWSVerAbstractor::string_to_sign_t,
- AWSVerAbstractor::signature_factory_t,
- AWSVerAbstractor::completer_factory_t>
+AWSEngine::VersionAbstractor::auth_data_t
AWSBrowserUploadAbstractor::get_auth_data(const req_state* const s) const
{
if (s->auth.s3_postobj_creds.x_amz_algorithm == AWS4_HMAC_SHA256_STR) {
AWSEngine::result_t
AWSEngine::authenticate(const req_state* const s) const
{
- boost::string_view access_key_id;
- boost::string_view signature;
- VersionAbstractor::string_to_sign_t string_to_sign;
-
- VersionAbstractor::signature_factory_t signature_factory;
- VersionAbstractor::completer_factory_t completer_factory;
-
/* Small reminder: an ver_abstractor is allowed to throw! */
- std::tie(access_key_id,
- signature,
- string_to_sign,
- signature_factory,
- completer_factory) = ver_abstractor.get_auth_data(s);
+ const auto auth_data = ver_abstractor.get_auth_data(s);
- if (access_key_id.empty() || signature.empty()) {
+ if (auth_data.access_key_id.empty() || auth_data.client_signature.empty()) {
return result_t::deny(-EINVAL);
} else {
- return authenticate(access_key_id, signature, string_to_sign,
- signature_factory, completer_factory, s);
+ return authenticate(auth_data.access_key_id,
+ auth_data.client_signature,
+ auth_data.string_to_sign,
+ auth_data.signature_factory,
+ auth_data.completer_factory,
+ s);
}
}
std::function<rgw::auth::Completer::cmplptr_t(
const boost::optional<std::string>& secret_key)>;
- virtual std::tuple<access_key_id_t,
- client_signature_t,
- string_to_sign_t,
- signature_factory_t,
- completer_factory_t>
- get_auth_data(const req_state* s) const = 0;
+ struct auth_data_t {
+ access_key_id_t access_key_id;
+ client_signature_t client_signature;
+ string_to_sign_t string_to_sign;
+ signature_factory_t signature_factory;
+ completer_factory_t completer_factory;
+ };
+
+ virtual auth_data_t get_auth_data(const req_state* s) const = 0;
};
protected:
const boost::string_view& signedheaders,
const bool using_qs) const;
- std::tuple<access_key_id_t,
- client_signature_t,
- string_to_sign_t,
- signature_factory_t,
- completer_factory_t>
- get_auth_data_v2(const req_state* s) const;
-
- std::tuple<access_key_id_t,
- client_signature_t,
- string_to_sign_t,
- signature_factory_t,
- completer_factory_t>
- get_auth_data_v4(const req_state* s, bool using_qs) const;
+ auth_data_t get_auth_data_v2(const req_state* s) const;
+ auth_data_t get_auth_data_v4(const req_state* s, bool using_qs) const;
public:
AWSGeneralAbstractor(CephContext* const cct)
: cct(cct) {
}
- std::tuple<access_key_id_t,
- client_signature_t,
- string_to_sign_t,
- signature_factory_t,
- completer_factory_t>
- get_auth_data(const req_state* s) const override;
+ auth_data_t get_auth_data(const req_state* s) const override;
};
class AWSGeneralBoto2Abstractor : public AWSGeneralAbstractor {
static_cast<std::string::size_type>(bl.length()));
}
- using auth_data_t = std::tuple<access_key_id_t,
- client_signature_t,
- string_to_sign_t,
- signature_factory_t,
- completer_factory_t>;
-
auth_data_t get_auth_data_v2(const req_state* s) const;
auth_data_t get_auth_data_v4(const req_state* s) const;
AWSBrowserUploadAbstractor(CephContext*) {
}
- std::tuple<access_key_id_t,
- client_signature_t,
- string_to_sign_t,
- signature_factory_t,
- completer_factory_t>
- get_auth_data(const req_state* s) const override;
+ auth_data_t get_auth_data(const req_state* s) const override;
};