]>
Commit | Line | Data |
---|---|---|
92f5a8d4 | 1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
9f95a23c | 2 | // vim: ts=8 sw=2 smarttab ft=cpp |
92f5a8d4 | 3 | |
9f95a23c | 4 | #pragma once |
92f5a8d4 TL |
5 | |
6 | #include "rgw_auth.h" | |
7 | #include "rgw_auth_filters.h" | |
f67539c2 | 8 | #include "rgw_rest.h" |
92f5a8d4 TL |
9 | |
10 | class RGWHandler_REST_IAM : public RGWHandler_REST { | |
11 | const rgw::auth::StrategyRegistry& auth_registry; | |
39ae355f | 12 | bufferlist bl_post_body; |
92f5a8d4 | 13 | RGWOp *op_post() override; |
1e59de90 | 14 | |
92f5a8d4 TL |
15 | public: |
16 | ||
1e59de90 | 17 | static bool action_exists(const req_state* s); |
92f5a8d4 | 18 | |
20effc67 | 19 | RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry, |
39ae355f | 20 | bufferlist& bl_post_body) |
92f5a8d4 TL |
21 | : RGWHandler_REST(), |
22 | auth_registry(auth_registry), | |
39ae355f | 23 | bl_post_body(bl_post_body) {} |
92f5a8d4 TL |
24 | ~RGWHandler_REST_IAM() override = default; |
25 | ||
1e59de90 TL |
26 | int init(rgw::sal::Driver* driver, |
27 | req_state *s, | |
92f5a8d4 | 28 | rgw::io::BasicClient *cio) override; |
f67539c2 TL |
29 | int authorize(const DoutPrefixProvider* dpp, optional_yield y) override; |
30 | int postauth_init(optional_yield y) override { return 0; } | |
92f5a8d4 TL |
31 | }; |
32 | ||
33 | class RGWRESTMgr_IAM : public RGWRESTMgr { | |
34 | public: | |
35 | RGWRESTMgr_IAM() = default; | |
36 | ~RGWRESTMgr_IAM() override = default; | |
37 | ||
1e59de90 | 38 | RGWRESTMgr *get_resource_mgr(req_state* const s, |
92f5a8d4 TL |
39 | const std::string& uri, |
40 | std::string* const out_uri) override { | |
41 | return this; | |
42 | } | |
43 | ||
1e59de90 TL |
44 | RGWHandler_REST* get_handler(rgw::sal::Driver* driver, |
45 | req_state*, | |
92f5a8d4 TL |
46 | const rgw::auth::StrategyRegistry&, |
47 | const std::string&) override; | |
48 | }; |