]> git.proxmox.com Git - ceph.git/blame - ceph/src/rgw/rgw_rest_ratelimit.h
import quincy 17.2.0
[ceph.git] / ceph / src / rgw / rgw_rest_ratelimit.h
CommitLineData
20effc67
TL
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#pragma once
5
6#include "rgw_rest.h"
7#include "rgw_rest_s3.h"
8#include "rgw_sal_rados.h"
9
10class RGWHandler_Ratelimit : public RGWHandler_Auth_S3 {
11protected:
12 RGWOp *op_get() override;
13 RGWOp *op_post() override;
14public:
15 using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
16 ~RGWHandler_Ratelimit() override = default;
17
18 int read_permissions(RGWOp*, optional_yield) override {
19 return 0;
20 }
21};
22
23class RGWRESTMgr_Ratelimit : public RGWRESTMgr {
24public:
25 RGWRESTMgr_Ratelimit() = default;
26 ~RGWRESTMgr_Ratelimit() override = default;
27
28 RGWHandler_REST *get_handler(rgw::sal::Store* store,
29 struct req_state*,
30 const rgw::auth::StrategyRegistry& auth_registry,
31 const std::string&) override {
32 return new RGWHandler_Ratelimit(auth_registry);
33 }
34};