}
const std::string& get_tenant() const {
- ceph_assert(t != Wildcard);
return u.tenant;
}
const std::string& get_id() const {
- ceph_assert(t != Wildcard && t != Tenant);
return u.id;
}
if ((s == "*") && wildcards) {
return ARN(Partition::wildcard, Service::wildcard, "*", "*", "*");
} else if (regex_match(s, match, wildcards ? rx_wild : rx_no_wild)) {
- ceph_assert(match.size() == 6);
+ if (match.size() != 6) {
+ return boost::none;
+ }
ARN a;
{
ECMAScript | optimize);
smatch match;
if (regex_match(a->resource, match, rx)) {
- ceph_assert(match.size() == 3);
+ if (match.size() != 3) {
+ return boost::none;
+ }
if (match[1] == "user") {
return Principal::user(std::move(a->account),
// Principals
} else if (w->kind == TokenKind::princ_type) {
- ceph_assert(pp->s.size() > 1);
+ if (pp->s.size() <= 1) {
+ return false;
+ }
auto& pri = pp->s[pp->s.size() - 2].w->id == TokenID::Principal ?
t->princ : t->noprinc;
#include "rgw_iam_policy_keywords.h"
#include "rgw_string.h"
-#include "include/assert.h" // razzin' frazzin' ...grrr.
-
class RGWRados;
namespace rgw {
namespace auth {
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);
}