]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rgw/rgw_basic_types.cc
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
8 #include "rgw_basic_types.h"
10 #include "common/ceph_json.h"
13 using std::stringstream
;
15 void decode_json_obj(rgw_user
& val
, JSONObj
*obj
)
17 val
.from_str(obj
->get_data());
20 void encode_json(const char *name
, const rgw_user
& val
, Formatter
*f
)
22 f
->dump_string(name
, val
.to_str());
25 void encode_xml(const char *name
, const rgw_user
& val
, Formatter
*f
)
27 encode_xml(name
, val
.to_str(), f
);
32 ostream
& operator <<(ostream
& m
, const Principal
& p
) {
33 if (p
.is_wildcard()) {
37 m
<< "arn:aws:iam:" << p
.get_tenant() << ":";
41 return m
<< (p
.is_user() ? "user/" : "role/") << p
.get_id();