diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-21 11:54:28 +0000 |
commit | e6918187568dbd01842d8d1d2c808ce16a894239 (patch) | |
tree | 64f88b554b444a49f656b6c656111a145cbbaa28 /src/rgw/rgw_public_access.cc | |
parent | Initial commit. (diff) | |
download | ceph-upstream/18.2.2.tar.xz ceph-upstream/18.2.2.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/rgw/rgw_public_access.cc')
-rw-r--r-- | src/rgw/rgw_public_access.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/rgw/rgw_public_access.cc b/src/rgw/rgw_public_access.cc new file mode 100644 index 000000000..6298bb306 --- /dev/null +++ b/src/rgw/rgw_public_access.cc @@ -0,0 +1,33 @@ +#include "rgw_public_access.h" +#include "rgw_xml.h" + +void PublicAccessBlockConfiguration::decode_xml(XMLObj *obj) { + RGWXMLDecoder::decode_xml("BlockPublicAcls", BlockPublicAcls, obj); + RGWXMLDecoder::decode_xml("IgnorePublicAcls", IgnorePublicAcls, obj); + RGWXMLDecoder::decode_xml("BlockPublicPolicy", BlockPublicPolicy, obj); + RGWXMLDecoder::decode_xml("RestrictPublicBuckets", RestrictPublicBuckets, obj); +} + +void PublicAccessBlockConfiguration::dump_xml(Formatter *f) const { + Formatter::ObjectSection os(*f, "BlockPublicAccessBlockConfiguration"); + // Note: AWS spec mentions the values to be ALL CAPs, but clients seem to + // require all small letters, and S3 itself doesn't seem to follow the API + // spec here + f->dump_bool("BlockPublicAcls", BlockPublicAcls); + f->dump_bool("IgnorePublicAcls", IgnorePublicAcls); + f->dump_bool("BlockPublicPolicy", BlockPublicPolicy); + f->dump_bool("RestrictPublicBuckets", RestrictPublicBuckets); +} + + +std::ostream& operator<< (std::ostream& os, const PublicAccessBlockConfiguration& access_conf) +{ + os << std::boolalpha + << "BlockPublicAcls: " << access_conf.block_public_acls() << std::endl + << "IgnorePublicAcls: " << access_conf.ignore_public_acls() << std::endl + << "BlockPublicPolicy" << access_conf.block_public_policy() << std::endl + << "RestrictPublicBuckets" << access_conf.restrict_public_buckets() << std::endl; + + return os; +} + |