summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_auth_s3.cc
diff options
context:
space:
mode:
authorYehuda Sadeh <yehuda@redhat.com>2021-02-19 18:42:12 +0100
committerYehuda Sadeh <yehuda@redhat.com>2021-03-09 11:04:58 +0100
commitd98ed0cb9f4f90266503dfc889746c678b7f946d (patch)
tree17a1833a70255724170faefe2435114151f10a3c /src/rgw/rgw_auth_s3.cc
parentrgw: rest client: sign awsv4 content (if possible) (diff)
downloadceph-d98ed0cb9f4f90266503dfc889746c678b7f946d.tar.xz
ceph-d98ed0cb9f4f90266503dfc889746c678b7f946d.zip
rgw: auth v4: extract service from url
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
Diffstat (limited to 'src/rgw/rgw_auth_s3.cc')
-rw-r--r--src/rgw/rgw_auth_s3.cc7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/rgw/rgw_auth_s3.cc b/src/rgw/rgw_auth_s3.cc
index 0ea45f19721..f59f3126344 100644
--- a/src/rgw/rgw_auth_s3.cc
+++ b/src/rgw/rgw_auth_s3.cc
@@ -495,7 +495,8 @@ int parse_v4_credentials(const req_info& info, /* in */
}
string gen_v4_scope(const ceph::real_time& timestamp,
- const string& region)
+ const string& region,
+ const string& service)
{
auto sec = real_clock::to_time_t(timestamp);
@@ -507,8 +508,8 @@ string gen_v4_scope(const ceph::real_time& timestamp,
auto mon = bt.tm_mon + 1;
auto day = bt.tm_mday;
- return fmt::format(FMT_STRING("{:d}{:02d}{:02d}/{:s}/s3/aws4_request"),
- year, mon, day, region);
+ return fmt::format(FMT_STRING("{:d}{:02d}{:02d}/{:s}/{:s}/aws4_request"),
+ year, mon, day, region, service);
}
std::string get_v4_canonical_qs(const req_info& info, const bool using_qs)