mirror of
https://github.com/ceph/ceph
synced 2025-02-24 03:27:10 +00:00
rgw: PublicAccessConfiguration -> PublicAccessBlockConfiguration
also drop iam namespace Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
This commit is contained in:
parent
2c98fa754d
commit
b7ddec14ac
@ -1695,7 +1695,7 @@ struct req_state : DoutPrefixProvider {
|
||||
|
||||
rgw::IAM::Environment env;
|
||||
boost::optional<rgw::IAM::Policy> iam_policy;
|
||||
boost::optional<rgw::IAM::PublicAccessConfiguration> bucket_access_conf;
|
||||
boost::optional<PublicAccessBlockConfiguration> bucket_access_conf;
|
||||
vector<rgw::IAM::Policy> iam_user_policies;
|
||||
|
||||
/* Is the request made by an user marked as a system one?
|
||||
|
@ -86,7 +86,6 @@ using rgw::IAM::Effect;
|
||||
using rgw::IAM::Policy;
|
||||
|
||||
using rgw::IAM::Policy;
|
||||
using rgw::IAM::PublicAccessConfiguration;
|
||||
|
||||
static string mp_ns = RGW_OBJ_NS_MULTIPART;
|
||||
static string shadow_ns = RGW_OBJ_NS_SHADOW;
|
||||
@ -295,13 +294,13 @@ static boost::optional<Policy> get_iam_policy_from_attr(CephContext* cct,
|
||||
}
|
||||
}
|
||||
|
||||
static boost::optional<PublicAccessConfiguration>
|
||||
static boost::optional<PublicAccessBlockConfiguration>
|
||||
get_public_access_conf_from_attr(const map<string, bufferlist>& attrs)
|
||||
{
|
||||
if (auto aiter = attrs.find(RGW_ATTR_PUBLIC_ACCESS);
|
||||
aiter != attrs.end()) {
|
||||
bufferlist::const_iterator iter{&aiter->second};
|
||||
PublicAccessConfiguration access_conf;
|
||||
PublicAccessBlockConfiguration access_conf;
|
||||
try {
|
||||
access_conf.decode(iter);
|
||||
} catch (const buffer::error& e) {
|
||||
|
@ -2400,7 +2400,7 @@ public:
|
||||
class RGWPutBucketPublicAccessBlock : public RGWOp {
|
||||
protected:
|
||||
bufferlist data;
|
||||
rgw::IAM::PublicAccessConfiguration access_conf;
|
||||
PublicAccessBlockConfiguration access_conf;
|
||||
public:
|
||||
int verify_permission() override;
|
||||
const char* name() const override { return "put_bucket_public_access_block";}
|
||||
@ -2413,7 +2413,7 @@ public:
|
||||
|
||||
class RGWGetBucketPublicAccessBlock : public RGWOp {
|
||||
protected:
|
||||
rgw::IAM::PublicAccessConfiguration access_conf;
|
||||
PublicAccessBlockConfiguration access_conf;
|
||||
public:
|
||||
int verify_permission() override;
|
||||
const char* name() const override { return "get_bucket_public_access_block";}
|
||||
@ -2426,7 +2426,7 @@ public:
|
||||
|
||||
class RGWDeleteBucketPublicAccessBlock : public RGWOp {
|
||||
protected:
|
||||
rgw::IAM::PublicAccessConfiguration access_conf;
|
||||
PublicAccessBlockConfiguration access_conf;
|
||||
public:
|
||||
int verify_permission() override;
|
||||
const char* name() const override { return "delete_bucket_public_access_block";}
|
||||
|
@ -1,17 +1,15 @@
|
||||
#include "rgw_public_access.h"
|
||||
#include "rgw_xml.h"
|
||||
|
||||
namespace rgw::IAM {
|
||||
|
||||
void PublicAccessConfiguration::decode_xml(XMLObj *obj) {
|
||||
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 PublicAccessConfiguration::dump_xml(Formatter *f) const {
|
||||
Formatter::ObjectSection os(*f, "BlockPublicAccessConfiguration");
|
||||
void PublicAccessBlockConfiguration::dump_xml(Formatter *f) const {
|
||||
Formatter::ObjectSection os(*f, "BlockPublicAccessBlockConfiguration");
|
||||
// AWS spec mentions the values to be ALL CAPs, but clients will not
|
||||
// understand this or a mixed case like it is supposed to, hence the need to
|
||||
// manually encode here
|
||||
@ -24,7 +22,7 @@ void PublicAccessConfiguration::dump_xml(Formatter *f) const {
|
||||
}
|
||||
|
||||
|
||||
ostream& operator<< (ostream& os, const PublicAccessConfiguration& access_conf)
|
||||
ostream& operator<< (ostream& os, const PublicAccessBlockConfiguration& access_conf)
|
||||
{
|
||||
os << std::boolalpha
|
||||
<< "BlockPublicAcls: " << access_conf.block_public_acls() << std::endl
|
||||
@ -35,4 +33,3 @@ ostream& operator<< (ostream& os, const PublicAccessConfiguration& access_conf)
|
||||
return os;
|
||||
}
|
||||
|
||||
} // namespace rgw::IAM
|
||||
|
@ -18,15 +18,13 @@
|
||||
|
||||
class XMLObj;
|
||||
|
||||
namespace rgw::IAM {
|
||||
|
||||
class PublicAccessConfiguration {
|
||||
class PublicAccessBlockConfiguration {
|
||||
bool BlockPublicAcls;
|
||||
bool IgnorePublicAcls;
|
||||
bool BlockPublicPolicy;
|
||||
bool RestrictPublicBuckets;
|
||||
public:
|
||||
PublicAccessConfiguration():
|
||||
PublicAccessBlockConfiguration():
|
||||
BlockPublicAcls(false), IgnorePublicAcls(false),
|
||||
BlockPublicPolicy(false), RestrictPublicBuckets(false)
|
||||
{}
|
||||
@ -65,6 +63,5 @@ class PublicAccessConfiguration {
|
||||
void decode_xml(XMLObj *obj);
|
||||
void dump_xml(Formatter *f) const;
|
||||
};
|
||||
WRITE_CLASS_ENCODER(PublicAccessConfiguration)
|
||||
ostream& operator<< (ostream& os, const PublicAccessConfiguration& access_conf);
|
||||
} // namespace rgw::IAM
|
||||
WRITE_CLASS_ENCODER(PublicAccessBlockConfiguration)
|
||||
ostream& operator<< (ostream& os, const PublicAccessBlockConfiguration& access_conf);
|
||||
|
Loading…
Reference in New Issue
Block a user