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_bucket_encryption.cc | |
parent | Initial commit. (diff) | |
download | ceph-e6918187568dbd01842d8d1d2c808ce16a894239.tar.xz ceph-e6918187568dbd01842d8d1d2c808ce16a894239.zip |
Adding upstream version 18.2.2.upstream/18.2.2
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | src/rgw/rgw_bucket_encryption.cc | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/rgw/rgw_bucket_encryption.cc b/src/rgw/rgw_bucket_encryption.cc new file mode 100644 index 000000000..f029709db --- /dev/null +++ b/src/rgw/rgw_bucket_encryption.cc @@ -0,0 +1,49 @@ +// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- +// vim: ts=8 sw=2 smarttab ft=cpp +// +#include "rgw_bucket_encryption.h" +#include "rgw_xml.h" +#include "common/ceph_json.h" + +void ApplyServerSideEncryptionByDefault::decode_xml(XMLObj *obj) { + RGWXMLDecoder::decode_xml("KMSMasterKeyID", kmsMasterKeyID, obj, false); + RGWXMLDecoder::decode_xml("SSEAlgorithm", sseAlgorithm, obj, false); +} + +void ApplyServerSideEncryptionByDefault::dump_xml(Formatter *f) const { + encode_xml("SSEAlgorithm", sseAlgorithm, f); + if (kmsMasterKeyID != "") { + encode_xml("KMSMasterKeyID", kmsMasterKeyID, f); + } +} + +void ServerSideEncryptionConfiguration::decode_xml(XMLObj *obj) { + RGWXMLDecoder::decode_xml("ApplyServerSideEncryptionByDefault", applyServerSideEncryptionByDefault, obj, false); + RGWXMLDecoder::decode_xml("BucketKeyEnabled", bucketKeyEnabled, obj, false); +} + +void ServerSideEncryptionConfiguration::dump_xml(Formatter *f) const { + encode_xml("ApplyServerSideEncryptionByDefault", applyServerSideEncryptionByDefault, f); + if (bucketKeyEnabled) { + encode_xml("BucketKeyEnabled", true, f); + } +} + +void RGWBucketEncryptionConfig::decode_xml(XMLObj *obj) { + rule_exist = RGWXMLDecoder::decode_xml("Rule", rule, obj); +} + +void RGWBucketEncryptionConfig::dump_xml(Formatter *f) const { + if (rule_exist) { + encode_xml("Rule", rule, f); + } +} + +void RGWBucketEncryptionConfig::dump(Formatter *f) const { + encode_json("rule_exist", has_rule(), f); + if (has_rule()) { + encode_json("sse_algorithm", sse_algorithm(), f); + encode_json("kms_master_key_id", kms_master_key_id(), f); + encode_json("bucket_key_enabled", bucket_key_enabled(), f); + } +} |