]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_rest_iam.h
import ceph 15.2.10
[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
9 class RGWHandler_REST_IAM : public RGWHandler_REST {
10 const rgw::auth::StrategyRegistry& auth_registry;
11 const string& post_body;
12 RGWOp *op_post() override;
13 void rgw_iam_parse_input();
14 public:
15
16 static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
17
18 RGWHandler_REST_IAM(const rgw::auth::StrategyRegistry& auth_registry, const string& post_body="")
19 : RGWHandler_REST(),
20 auth_registry(auth_registry),
21 post_body(post_body) {}
22 ~RGWHandler_REST_IAM() override = default;
23
24 int init(rgw::sal::RGWRadosStore *store,
25 struct req_state *s,
26 rgw::io::BasicClient *cio) override;
27 int authorize(const DoutPrefixProvider* dpp) override;
28 int postauth_init() override { return 0; }
29 };
30
31 class RGWRESTMgr_IAM : public RGWRESTMgr {
32 public:
33 RGWRESTMgr_IAM() = default;
34 ~RGWRESTMgr_IAM() override = default;
35
36 RGWRESTMgr *get_resource_mgr(struct req_state* const s,
37 const std::string& uri,
38 std::string* const out_uri) override {
39 return this;
40 }
41
42 RGWHandler_REST* get_handler(struct req_state*,
43 const rgw::auth::StrategyRegistry&,
44 const std::string&) override;
45 };