]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_rest_config.h
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / rgw / rgw_rest_config.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
3
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
16 #pragma once
17
18 #include "rgw_auth_s3.h"
19 #include "rgw_rest.h"
20 #include "rgw_zone.h"
21
22 class RGWOp_ZoneConfig_Get : public RGWRESTOp {
23 RGWZoneParams zone_params;
24 public:
25 RGWOp_ZoneConfig_Get() {}
26
27 int check_caps(const RGWUserCaps& caps) override {
28 return caps.check_cap("zone", RGW_CAP_READ);
29 }
30 int verify_permission(optional_yield) override {
31 return check_caps(s->user->get_caps());
32 }
33 void execute(optional_yield) override {} /* driver already has the info we need, just need to send response */
34 void send_response() override ;
35 const char* name() const override {
36 return "get_zone_config";
37 }
38 };
39
40 class RGWHandler_Config : public RGWHandler_Auth_S3 {
41 protected:
42 RGWOp *op_get() override;
43
44 int read_permissions(RGWOp*, optional_yield) override {
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
58 RGWHandler_REST* get_handler(rgw::sal::Driver* ,
59 req_state*,
60 const rgw::auth::StrategyRegistry& auth_registry,
61 const std::string&) override {
62 return new RGWHandler_Config(auth_registry);
63 }
64 };