#include "rapidjson/error/error.h"
#include "rapidjson/error/en.h"
-#include "fnmatch.h"
-
+#include "rgw_acl.h"
#include "rgw_basic_types.h"
#include "rgw_iam_policy_keywords.h"
-
-#include "include/assert.h" // razzin' frazzin' ...grrr.
+#include "rgw_string.h"
class RGWRados;
namespace rgw {
static constexpr std::uint64_t s3PutReplicationConfiguration = 1ULL << 45;
static constexpr std::uint64_t s3GetReplicationConfiguration = 1ULL << 46;
static constexpr std::uint64_t s3DeleteReplicationConfiguration = 1ULL << 47;
-static constexpr std::uint64_t s3Count = 48;
+static constexpr std::uint64_t s3GetObjectTagging = 1ULL << 48;
+static constexpr std::uint64_t s3PutObjectTagging = 1ULL << 49;
+static constexpr std::uint64_t s3DeleteObjectTagging = 1ULL << 50;
+static constexpr std::uint64_t s3GetObjectVersionTagging = 1ULL << 51;
+static constexpr std::uint64_t s3PutObjectVersionTagging = 1ULL << 52;
+static constexpr std::uint64_t s3DeleteObjectVersionTagging = 1ULL << 53;
+static constexpr std::uint64_t s3Count = 54;
static constexpr std::uint64_t s3All = (1ULL << s3Count) - 1;
namespace {
case s3GetObjectTorrent:
case s3GetObjectVersion:
case s3GetObjectVersionTorrent:
+ case s3GetObjectTagging:
+ case s3GetObjectVersionTagging:
case s3ListAllMyBuckets:
case s3ListBucket:
case s3ListBucketMultiPartUploads:
case s3DeleteObject:
case s3DeleteObjectVersion:
case s3PutObject:
+ case s3PutObjectTagging:
+ case s3PutObjectVersionTagging:
+ case s3DeleteObjectTagging:
+ case s3DeleteObjectVersionTagging:
case s3RestoreObject:
return RGW_PERM_WRITE;
inline bool operator ==(const MaskedIP& l, const MaskedIP& r) {
auto shift = std::max((l.v6 ? 128 : 32) - l.prefix,
(r.v6 ? 128 : 32) - r.prefix);
- ceph_assert(shift > 0);
return (l.addr >> shift) == (r.addr >> shift);
}
std::vector<std::string> vals;
Condition() = default;
- Condition(TokenID op, const char* s, std::size_t len) : op(op) {
- static constexpr char ifexistr[] = "IfExists";
- auto l = static_cast<const char*>(memmem(static_cast<const void*>(s), len,
- static_cast<const void*>(ifexistr),
- sizeof(ifexistr) -1));
- if (l && ((l + sizeof(ifexistr) - 1 == (s + len)))) {
- ifexists = true;
- key.assign(s, static_cast<const char*>(l) - s);
- } else {
- key.assign(s, len);
- }
- }
+ Condition(TokenID op, const char* s, std::size_t len, bool ifexists)
+ : op(op), key(s, len), ifexists(ifexists) {}
bool eval(const Environment& e) const;
try {
double d = std::stod(s, &p);
if (p == s.length()) {
- return !((d == +0.0) || (d = -0.0) || std::isnan(d));
+ return !((d == +0.0) || (d == -0.0) || std::isnan(d));
}
} catch (const std::logic_error& e) {
// Fallthrough
static boost::optional<MaskedIP> as_network(const std::string& s);
- struct ci_equal_to : public std::binary_function<const std::string,
- const std::string,
- bool> {
+ struct ci_equal_to {
bool operator ()(const std::string& s1,
const std::string& s2) const {
return boost::iequals(s1, s2);
}
};
+ struct string_like {
+ bool operator ()(const std::string& input,
+ const std::string& pattern) const {
+ return match_wildcards(pattern, input, 0);
+ }
+ };
template<typename F>
static bool orrible(F&& f, const std::string& c,