From 5547f73db8102965b2ef730f8a7c2d7222d0faf8 Mon Sep 17 00:00:00 2001 From: Matt Benjamin Date: Fri, 19 Oct 2018 16:40:19 -0400 Subject: [PATCH] rgw: distinguish parse_v4_credentials The caller and callees of this method are v4-specific, and their names contain a v4 infix. Signed-off-by: Matt Benjamin (cherry picked from commit aa8c686da10ce1211a706f3519757045dfe34bed) Conflicts: src/rgw/rgw_auth_s3.cc src/rgw/rgw_auth_s3.h src/rgw/rgw_rest_s3.cc - Included v4 infix in 'parse_credentials()' and removed "session_token" param from definition, declaration and call of 'parse_v4_credentials()'. --- src/rgw/rgw_auth_s3.cc | 14 +++++++------- src/rgw/rgw_auth_s3.h | 14 +++++++------- src/rgw/rgw_rest_s3.cc | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc index f4bd2522c9f42..6534bfb440677 100644 --- a/src/rgw/rgw_auth_s3.cc +++ b/src/rgw/rgw_auth_s3.cc @@ -411,13 +411,13 @@ static inline int parse_v4_auth_header(const req_info& info, /* in return 0; } -int parse_credentials(const req_info& info, /* in */ - boost::string_view& access_key_id, /* out */ - boost::string_view& credential_scope, /* out */ - boost::string_view& signedheaders, /* out */ - boost::string_view& signature, /* out */ - boost::string_view& date, /* out */ - const bool using_qs) /* in */ +int parse_v4_credentials(const req_info& info, /* in */ + boost::string_view& access_key_id, /* out */ + boost::string_view& credential_scope, /* out */ + boost::string_view& signedheaders, /* out */ + boost::string_view& signature, /* out */ + boost::string_view& date, /* out */ + const bool using_qs) /* in */ { boost::string_view credential; int ret; diff --git a/src/rgw/rgw_auth_s3.h b/src/rgw/rgw_auth_s3.h index d3b6e44b74cbd..2934484167a4e 100644 --- a/src/rgw/rgw_auth_s3.h +++ b/src/rgw/rgw_auth_s3.h @@ -376,13 +376,13 @@ static constexpr char AWS4_UNSIGNED_PAYLOAD_HASH[] = "UNSIGNED-PAYLOAD"; static constexpr char AWS4_STREAMING_PAYLOAD_HASH[] = \ "STREAMING-AWS4-HMAC-SHA256-PAYLOAD"; -int parse_credentials(const req_info& info, /* in */ - boost::string_view& access_key_id, /* out */ - boost::string_view& credential_scope, /* out */ - boost::string_view& signedheaders, /* out */ - boost::string_view& signature, /* out */ - boost::string_view& date, /* out */ - const bool using_qs); /* in */ +int parse_v4_credentials(const req_info& info, /* in */ + boost::string_view& access_key_id, /* out */ + boost::string_view& credential_scope, /* out */ + boost::string_view& signedheaders, /* out */ + boost::string_view& signature, /* out */ + boost::string_view& date, /* out */ + const bool using_qs); /* in */ static inline std::string get_v4_canonical_uri(const req_info& info) { /* The code should normalize according to RFC 3986 but S3 does NOT do path diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index 67d0712f1f1b3..add3eda61d29e 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -3793,13 +3793,13 @@ AWSGeneralAbstractor::get_auth_data_v4(const req_state* const s, boost::string_view credential_scope; boost::string_view client_signature; - int ret = rgw::auth::s3::parse_credentials(s->info, - access_key_id, - credential_scope, - signed_hdrs, - client_signature, - date, - using_qs); + int ret = rgw::auth::s3::parse_v4_credentials(s->info, + access_key_id, + credential_scope, + signed_hdrs, + client_signature, + date, + using_qs); if (ret < 0) { throw ret; } -- 2.39.5