// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
-// vim: ts=8 sw=2 smarttab
+// vim: ts=8 sw=2 smarttab ft=cpp
#ifndef CEPH_RGW_AUTH_FILTERS_H
#define CEPH_RGW_AUTH_FILTERS_H
template <typename T>
class ThirdPartyAccountApplier : public DecoratedApplier<T> {
- /* const */RGWRados* const store;
+ /* const */RGWCtl* const ctl;
const rgw_user acct_user_override;
public:
static const rgw_user UNKNOWN_ACCT;
template <typename U>
- ThirdPartyAccountApplier(RGWRados* const store,
+ ThirdPartyAccountApplier(RGWCtl* const ctl,
const rgw_user &acct_user_override,
U&& decoratee)
: DecoratedApplier<T>(std::move(decoratee)),
- store(store),
+ ctl(ctl),
acct_user_override(acct_user_override) {
}
if (acct_user_override.tenant.empty()) {
const rgw_user tenanted_uid(acct_user_override.id, acct_user_override.id);
- if (rgw_get_user_info_by_uid(store, tenanted_uid, user_info) >= 0) {
+ if (ctl->user->get_info_by_uid(tenanted_uid, &user_info, null_yield) >= 0) {
/* Succeeded. */
return;
}
}
- const int ret = rgw_get_user_info_by_uid(store, acct_user_override, user_info);
+ const int ret = ctl->user->get_info_by_uid(acct_user_override, &user_info, null_yield);
if (ret < 0) {
/* We aren't trying to recover from ENOENT here. It's supposed that creating
* someone else's account isn't a thing we want to support in this filter. */
}
template <typename T> static inline
-ThirdPartyAccountApplier<T> add_3rdparty(RGWRados* const store,
+ThirdPartyAccountApplier<T> add_3rdparty(RGWCtl* const ctl,
const rgw_user &acct_user_override,
T&& t) {
- return ThirdPartyAccountApplier<T>(store, acct_user_override,
+ return ThirdPartyAccountApplier<T>(ctl, acct_user_override,
std::forward<T>(t));
}
template <typename T>
class SysReqApplier : public DecoratedApplier<T> {
CephContext* const cct;
- /*const*/ RGWRados* const store;
+ /*const*/ RGWCtl* const ctl;
const RGWHTTPArgs& args;
mutable boost::tribool is_system;
public:
template <typename U>
SysReqApplier(CephContext* const cct,
- /*const*/ RGWRados* const store,
+ /*const*/ RGWCtl* const ctl,
const req_state* const s,
U&& decoratee)
: DecoratedApplier<T>(std::forward<T>(decoratee)),
cct(cct),
- store(store),
+ ctl(ctl),
args(s->info.args),
is_system(boost::logic::indeterminate) {
}
* reasons. rgw_get_user_info_by_uid doesn't trigger the operator=() but
* calls ::decode instead. */
RGWUserInfo euser_info;
- if (rgw_get_user_info_by_uid(store, effective_uid, euser_info) < 0) {
+ if (ctl->user->get_info_by_uid(effective_uid, &euser_info, null_yield) < 0) {
//ldpp_dout(dpp, 0) << "User lookup failed!" << dendl;
throw -EACCES;
}
template <typename T> static inline
SysReqApplier<T> add_sysreq(CephContext* const cct,
- /* const */ RGWRados* const store,
+ /* const */ RGWCtl* const ctl,
const req_state* const s,
T&& t) {
- return SysReqApplier<T>(cct, store, s, std::forward<T>(t));
+ return SysReqApplier<T>(cct, ctl, s, std::forward<T>(t));
}
} /* namespace auth */