]>
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; | |
20effc67 | 12 | const std::string& post_body; |
92f5a8d4 TL |
13 | RGWOp *op_post() override; |
14 | void rgw_iam_parse_input(); | |
15 | public: | |
16 | ||
17 | static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format); | |
18 | ||
20effc67 TL |
19 | RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry, |
20 | const std::string& post_body="") | |
92f5a8d4 TL |
21 | : RGWHandler_REST(), |
22 | auth_registry(auth_registry), | |
23 | post_body(post_body) {} | |
24 | ~RGWHandler_REST_IAM() override = default; | |
25 | ||
20effc67 | 26 | int init(rgw::sal::Store* store, |
92f5a8d4 TL |
27 | struct req_state *s, |
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 | ||
38 | RGWRESTMgr *get_resource_mgr(struct req_state* const s, | |
39 | const std::string& uri, | |
40 | std::string* const out_uri) override { | |
41 | return this; | |
42 | } | |
43 | ||
20effc67 | 44 | RGWHandler_REST* get_handler(rgw::sal::Store* store, |
f67539c2 | 45 | struct req_state*, |
92f5a8d4 TL |
46 | const rgw::auth::StrategyRegistry&, |
47 | const std::string&) override; | |
48 | }; |