]> git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_rest_oidc_provider.h
import quincy 17.2.0
[ceph.git] / ceph / src / rgw / rgw_rest_oidc_provider.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_rest.h"
7 #include "rgw_oidc_provider.h"
8
9 class RGWRestOIDCProvider : public RGWRESTOp {
10 protected:
11 std::vector<std::string> client_ids;
12 std::vector<std::string> thumbprints;
13 std::string provider_url; //'iss' field in JWT
14 std::string provider_arn;
15 public:
16 int verify_permission(optional_yield y) override;
17 void send_response() override;
18 virtual uint64_t get_op() = 0;
19 };
20
21 class RGWRestOIDCProviderRead : public RGWRestOIDCProvider {
22 public:
23 RGWRestOIDCProviderRead() = default;
24 int check_caps(const RGWUserCaps& caps) override;
25 };
26
27 class RGWRestOIDCProviderWrite : public RGWRestOIDCProvider {
28 public:
29 RGWRestOIDCProviderWrite() = default;
30 int check_caps(const RGWUserCaps& caps) override;
31 };
32
33 class RGWCreateOIDCProvider : public RGWRestOIDCProviderWrite {
34 public:
35 RGWCreateOIDCProvider() = default;
36 int verify_permission(optional_yield y) override;
37 void execute(optional_yield y) override;
38 int get_params();
39 const char* name() const override { return "create_oidc_provider"; }
40 RGWOpType get_type() override { return RGW_OP_CREATE_OIDC_PROVIDER; }
41 uint64_t get_op() override { return rgw::IAM::iamCreateOIDCProvider; }
42 };
43
44 class RGWDeleteOIDCProvider : public RGWRestOIDCProviderWrite {
45 public:
46 RGWDeleteOIDCProvider() = default;
47 void execute(optional_yield y) override;
48 const char* name() const override { return "delete_oidc_provider"; }
49 RGWOpType get_type() override { return RGW_OP_DELETE_OIDC_PROVIDER; }
50 uint64_t get_op() override { return rgw::IAM::iamDeleteOIDCProvider; }
51 };
52
53 class RGWGetOIDCProvider : public RGWRestOIDCProviderRead {
54 public:
55 RGWGetOIDCProvider() = default;
56 void execute(optional_yield y) override;
57 const char* name() const override { return "get_oidc_provider"; }
58 RGWOpType get_type() override { return RGW_OP_GET_OIDC_PROVIDER; }
59 uint64_t get_op() override { return rgw::IAM::iamGetOIDCProvider; }
60 };
61
62 class RGWListOIDCProviders : public RGWRestOIDCProviderRead {
63 public:
64 RGWListOIDCProviders() = default;
65 int verify_permission(optional_yield y) override;
66 void execute(optional_yield y) override;
67 int get_params();
68 const char* name() const override { return "list_oidc_providers"; }
69 RGWOpType get_type() override { return RGW_OP_LIST_OIDC_PROVIDERS; }
70 uint64_t get_op() override { return rgw::IAM::iamListOIDCProviders; }
71 };