]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | #ifndef CEPH_RGW_REST_ROLE_H |
2 | #define CEPH_RGW_REST_ROLE_H | |
3 | ||
4 | class RGWRestRole : public RGWOp { | |
5 | protected: | |
6 | string role_name; | |
7 | string role_path; | |
8 | string trust_policy; | |
9 | string policy_name; | |
10 | string perm_policy; | |
11 | string path_prefix; | |
12 | ||
13 | public: | |
14 | void send_response() override; | |
15 | }; | |
16 | ||
17 | class RGWRoleRead : public RGWRestRole { | |
18 | public: | |
19 | RGWRoleRead() = default; | |
20 | int verify_permission() override; | |
21 | uint32_t op_mask() override { return RGW_OP_TYPE_READ; } | |
22 | }; | |
23 | ||
24 | class RGWRoleWrite : public RGWRestRole { | |
25 | public: | |
26 | RGWRoleWrite() = default; | |
27 | int verify_permission() override; | |
28 | uint32_t op_mask() override { return RGW_OP_TYPE_WRITE; } | |
29 | }; | |
30 | ||
31 | class RGWCreateRole : public RGWRoleWrite { | |
32 | public: | |
33 | RGWCreateRole() = default; | |
34 | void execute() override; | |
35 | int get_params(); | |
36 | const string name() override { return "create_role"; } | |
37 | RGWOpType get_type() override { return RGW_OP_CREATE_ROLE; } | |
38 | }; | |
39 | ||
40 | class RGWDeleteRole : public RGWRoleWrite { | |
41 | public: | |
42 | RGWDeleteRole() = default; | |
43 | void execute() override; | |
44 | int get_params(); | |
45 | const string name() override { return "delete_role"; } | |
46 | RGWOpType get_type() override { return RGW_OP_DELETE_ROLE; } | |
47 | }; | |
48 | ||
49 | class RGWGetRole : public RGWRoleRead { | |
50 | public: | |
51 | RGWGetRole() = default; | |
52 | void execute() override; | |
53 | int get_params(); | |
54 | const string name() override { return "get_role"; } | |
55 | RGWOpType get_type() override { return RGW_OP_GET_ROLE; } | |
56 | }; | |
57 | ||
58 | class RGWModifyRole : public RGWRoleWrite { | |
59 | public: | |
60 | RGWModifyRole() = default; | |
61 | void execute() override; | |
62 | int get_params(); | |
63 | const string name() override { return "modify_role"; } | |
64 | RGWOpType get_type() override { return RGW_OP_MODIFY_ROLE; } | |
65 | }; | |
66 | ||
67 | class RGWListRoles : public RGWRoleRead { | |
68 | public: | |
69 | RGWListRoles() = default; | |
70 | void execute() override; | |
71 | int get_params(); | |
72 | const string name() override { return "list_roles"; } | |
73 | RGWOpType get_type() override { return RGW_OP_LIST_ROLES; } | |
74 | }; | |
75 | ||
76 | class RGWPutRolePolicy : public RGWRoleWrite { | |
77 | public: | |
78 | RGWPutRolePolicy() = default; | |
79 | void execute() override; | |
80 | int get_params(); | |
81 | const string name() override { return "put_role_policy"; } | |
82 | RGWOpType get_type() override { return RGW_OP_PUT_ROLE_POLICY; } | |
83 | }; | |
84 | ||
85 | class RGWGetRolePolicy : public RGWRoleRead { | |
86 | public: | |
87 | RGWGetRolePolicy() = default; | |
88 | void execute() override; | |
89 | int get_params(); | |
90 | const string name() override { return "get_role_policy"; } | |
91 | RGWOpType get_type() override { return RGW_OP_GET_ROLE_POLICY; } | |
92 | }; | |
93 | ||
94 | class RGWListRolePolicies : public RGWRoleRead { | |
95 | public: | |
96 | RGWListRolePolicies() = default; | |
97 | void execute() override; | |
98 | int get_params(); | |
99 | const string name() override { return "list_role_policies"; } | |
100 | RGWOpType get_type() override { return RGW_OP_LIST_ROLE_POLICIES; } | |
101 | }; | |
102 | ||
103 | class RGWDeleteRolePolicy : public RGWRoleWrite { | |
104 | public: | |
105 | RGWDeleteRolePolicy() = default; | |
106 | void execute() override; | |
107 | int get_params(); | |
108 | const string name() override { return "delete_role_policy"; } | |
109 | RGWOpType get_type() override { return RGW_OP_DELETE_ROLE_POLICY; } | |
110 | }; | |
111 | #endif /* CEPH_RGW_REST_ROLE_H */ | |
112 |