]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_rest_iam.h
0822f6f7e68932ef1d9526b0bfa5f3b47f4ba614
[ceph.git] / ceph / src / rgw / rgw_rest_iam.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 #pragma once
5
6 #include "rgw_auth.h"
7 #include "rgw_auth_filters.h"
8 #include "rgw_rest.h"
9
10 class RGWHandler_REST_IAM : public RGWHandler_REST {
11 const rgw::auth::StrategyRegistry& auth_registry;
12 const std::string& post_body;
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
19 RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry,
20 const std::string& post_body="")
21 : RGWHandler_REST(),
22 auth_registry(auth_registry),
23 post_body(post_body) {}
24 ~RGWHandler_REST_IAM() override = default;
25
26 int init(rgw::sal::Store* store,
27 struct req_state *s,
28 rgw::io::BasicClient *cio) override;
29 int authorize(const DoutPrefixProvider* dpp, optional_yield y) override;
30 int postauth_init(optional_yield y) override { return 0; }
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
44 RGWHandler_REST* get_handler(rgw::sal::Store* store,
45 struct req_state*,
46 const rgw::auth::StrategyRegistry&,
47 const std::string&) override;
48 };