1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab ft=cpp
5 * Ceph - scalable distributed file system
7 * Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
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.
18 #include "rgw_auth_s3.h"
22 class RGWOp_ZoneGroupMap_Get
: public RGWRESTOp
{
23 RGWZoneGroupMap zonegroup_map
;
26 explicit RGWOp_ZoneGroupMap_Get(bool _old_format
):old_format(_old_format
) {}
27 ~RGWOp_ZoneGroupMap_Get() override
{}
29 int check_caps(const RGWUserCaps
& caps
) override
{
30 return caps
.check_cap("zone", RGW_CAP_READ
);
32 int verify_permission(optional_yield
) override
{
33 return check_caps(s
->user
->get_caps());
35 void execute(optional_yield y
) override
;
36 void send_response() override
;
37 const char* name() const override
{
39 return "get_region_map";
41 return "get_zonegroup_map";
46 class RGWOp_ZoneConfig_Get
: public RGWRESTOp
{
47 RGWZoneParams zone_params
;
49 RGWOp_ZoneConfig_Get() {}
51 int check_caps(const RGWUserCaps
& caps
) override
{
52 return caps
.check_cap("zone", RGW_CAP_READ
);
54 int verify_permission(optional_yield
) override
{
55 return check_caps(s
->user
->get_caps());
57 void execute(optional_yield
) override
{} /* store already has the info we need, just need to send response */
58 void send_response() override
;
59 const char* name() const override
{
60 return "get_zone_config";
64 class RGWHandler_Config
: public RGWHandler_Auth_S3
{
66 RGWOp
*op_get() override
;
68 int read_permissions(RGWOp
*, optional_yield
) override
{
72 using RGWHandler_Auth_S3::RGWHandler_Auth_S3
;
73 ~RGWHandler_Config() override
= default;
77 class RGWRESTMgr_Config
: public RGWRESTMgr
{
79 RGWRESTMgr_Config() = default;
80 ~RGWRESTMgr_Config() override
= default;
82 RGWHandler_REST
* get_handler(rgw::sal::Store
* ,
84 const rgw::auth::StrategyRegistry
& auth_registry
,
85 const std::string
&) override
{
86 return new RGWHandler_Config(auth_registry
);