]>
Commit | Line | Data |
---|---|---|
1e59de90 | 1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
9f95a23c | 2 | // vim: ts=8 sw=2 smarttab ft=cpp |
11fdf7f2 | 3 | |
7c673cae FG |
4 | /* |
5 | * Ceph - scalable distributed file system | |
6 | * | |
7 | * Copyright (C) 2013 eNovance SAS <licensing@enovance.com> | |
8 | * | |
9 | * This is free software; you can redistribute it and/or | |
10 | * modify it under the terms of the GNU Lesser General Public | |
11 | * License version 2.1, as published by the Free Software | |
12 | * Foundation. See file COPYING. | |
13 | * | |
14 | */ | |
15 | ||
9f95a23c | 16 | #pragma once |
7c673cae | 17 | |
f67539c2 TL |
18 | #include "rgw_auth_s3.h" |
19 | #include "rgw_rest.h" | |
11fdf7f2 TL |
20 | #include "rgw_zone.h" |
21 | ||
7c673cae FG |
22 | class RGWOp_ZoneConfig_Get : public RGWRESTOp { |
23 | RGWZoneParams zone_params; | |
24 | public: | |
25 | RGWOp_ZoneConfig_Get() {} | |
26 | ||
9f95a23c | 27 | int check_caps(const RGWUserCaps& caps) override { |
11fdf7f2 | 28 | return caps.check_cap("zone", RGW_CAP_READ); |
7c673cae | 29 | } |
f67539c2 | 30 | int verify_permission(optional_yield) override { |
9f95a23c | 31 | return check_caps(s->user->get_caps()); |
7c673cae | 32 | } |
1e59de90 | 33 | void execute(optional_yield) override {} /* driver already has the info we need, just need to send response */ |
11fdf7f2 TL |
34 | void send_response() override ; |
35 | const char* name() const override { | |
7c673cae FG |
36 | return "get_zone_config"; |
37 | } | |
38 | }; | |
39 | ||
40 | class RGWHandler_Config : public RGWHandler_Auth_S3 { | |
41 | protected: | |
42 | RGWOp *op_get() override; | |
43 | ||
f67539c2 | 44 | int read_permissions(RGWOp*, optional_yield) override { |
7c673cae FG |
45 | return 0; |
46 | } | |
47 | public: | |
48 | using RGWHandler_Auth_S3::RGWHandler_Auth_S3; | |
49 | ~RGWHandler_Config() override = default; | |
50 | }; | |
51 | ||
52 | ||
53 | class RGWRESTMgr_Config : public RGWRESTMgr { | |
54 | public: | |
55 | RGWRESTMgr_Config() = default; | |
56 | ~RGWRESTMgr_Config() override = default; | |
57 | ||
1e59de90 TL |
58 | RGWHandler_REST* get_handler(rgw::sal::Driver* , |
59 | req_state*, | |
7c673cae FG |
60 | const rgw::auth::StrategyRegistry& auth_registry, |
61 | const std::string&) override { | |
62 | return new RGWHandler_Config(auth_registry); | |
63 | } | |
64 | }; |