1 #ifndef CEPH_RGW_ROLE_H
2 #define CEPH_RGW_ROLE_H
6 static const string role_name_oid_prefix
;
7 static const string role_oid_prefix
;
8 static const string role_path_oid_prefix
;
9 static const string role_arn_prefix
;
19 map
<string
, string
> perm_policy_map
;
22 int store_info(bool exclusive
);
23 int store_name(bool exclusive
);
24 int store_path(bool exclusive
);
25 int read_id(const string
& role_name
, string
& role_id
);
28 void set_id(const string
& id
) { this->id
= id
; }
31 RGWRole(CephContext
*cct
,
39 name(std::move(name
)),
40 path(std::move(path
)),
41 trust_policy(std::move(trust_policy
)),
43 if (this->path
.empty())
47 RGWRole(CephContext
*cct
,
52 name(std::move(name
)) {}
54 RGWRole(CephContext
*cct
,
63 void encode(bufferlist
& bl
) const {
64 ENCODE_START(1, 1, bl
);
69 ::encode(creation_date
, bl
);
70 ::encode(trust_policy
, bl
);
71 ::encode(perm_policy_map
, bl
);
75 void decode(bufferlist::iterator
& bl
) {
81 ::decode(creation_date
, bl
);
82 ::decode(trust_policy
, bl
);
83 ::decode(perm_policy_map
, bl
);
87 const string
& get_id() const { return id
; }
88 const string
& get_name() const { return name
; }
89 const string
& get_path() const { return path
; }
90 const string
& get_create_date() const { return creation_date
; }
92 int create(bool exclusive
);
96 void update_trust_policy(string
& trust_policy
);
97 void set_perm_policy(const string
& policy_name
, const string
& perm_policy
);
98 vector
<string
> get_role_policy_names();
99 int get_role_policy(const string
& policy_name
, string
& perm_policy
);
100 int delete_policy(const string
& policy_name
);
101 void dump(Formatter
*f
) const;
102 void decode_json(JSONObj
*obj
);
104 static const string
& get_names_oid_prefix();
105 static const string
& get_info_oid_prefix();
106 static const string
& get_path_oid_prefix();
107 static int get_roles_by_path_prefix(RGWRados
*store
, CephContext
*cct
, const string
& path_prefix
, vector
<RGWRole
>& roles
);
109 WRITE_CLASS_ENCODER(RGWRole
)
110 #endif /* CEPH_RGW_ROLE_H */