/* FIXME: remove this after switching all handlers to the new authentication
* infrastructure. */
- if (nullptr == s->auth_identity) {
+ if (! s->auth_identity) {
s->auth_identity = rgw_auth_transform_old_authinfo(s);
}
/* FIXME: remove this after switching all handlers to the new authentication
* infrastructure. */
- if (nullptr == s->auth_identity) {
+ if (! s->auth_identity) {
s->auth_identity = rgw_auth_transform_old_authinfo(s);
}
sub.compare(".referrer") == 0;
}
-static bool extract_referer_urlspec(const string& uid, string& url_spec)
+static bool extract_referer_urlspec(const std::string& uid,
+ std::string& url_spec)
{
const size_t pos = uid.find(':');
if (string::npos == pos) {
bool RGWKeystoneAuthEngine::is_applicable() const noexcept
{
- if (false == RGWTokenBasedAuthEngine::is_applicable()) {
+ if (! RGWTokenBasedAuthEngine::is_applicable()) {
return false;
}
- return false == cct->_conf->rgw_keystone_url.empty();
+ return ! cct->_conf->rgw_keystone_url.empty();
}
KeystoneToken RGWKeystoneAuthEngine::decode_pki_token(const std::string& token) const
}
}
- return {
+ return RGWRemoteAuthApplier::AuthInfo {
/* Suggested account name for the authenticated user. */
rgw_user(token.get_project_id()),
/* User's display name (aka real name). */
info(info) {
}
- virtual uint32_t get_perms_from_aclspec(const aclspec_t& aclspec) const override;
- virtual bool is_admin_of(const rgw_user& uid) const override;
- virtual bool is_owner_of(const rgw_user& uid) const override;
- virtual uint32_t get_perm_mask() const { return info.perm_mask; }
- virtual std::string to_str() const override;
- virtual void load_acct_info(RGWUserInfo& user_info) const override; /* out */
+ uint32_t get_perms_from_aclspec(const aclspec_t& aclspec) const override;
+ bool is_admin_of(const rgw_user& uid) const override;
+ bool is_owner_of(const rgw_user& uid) const override;
+ uint32_t get_perm_mask() const override { return info.perm_mask; }
+ std::string to_str() const override;
+ void load_acct_info(RGWUserInfo& user_info) const override; /* out */
struct Factory {
virtual ~Factory() {}
}
- virtual uint32_t get_perms_from_aclspec(const aclspec_t& aclspec) const override;
- virtual bool is_admin_of(const rgw_user& uid) const override;
- virtual bool is_owner_of(const rgw_user& uid) const override;
- virtual uint32_t get_perm_mask() const override {
+ uint32_t get_perms_from_aclspec(const aclspec_t& aclspec) const override;
+ bool is_admin_of(const rgw_user& uid) const override;
+ bool is_owner_of(const rgw_user& uid) const override;
+ uint32_t get_perm_mask() const override {
return get_perm_mask(subuser, user_info);
}
- virtual std::string to_str() const override;
- virtual void load_acct_info(RGWUserInfo& user_info) const override; /* out */
+ std::string to_str() const override;
+ void load_acct_info(RGWUserInfo& user_info) const override; /* out */
struct Factory {
virtual ~Factory() {}
};
for (const auto engine : engines) {
- if (!engine->is_applicable()) {
+ if (! engine->is_applicable()) {
/* Engine said it isn't suitable for handling this particular
* request. Let's try a next one. */
continue;
void RGWTempURLAuthApplier::modify_request_state(req_state * s) const /* in/out */
{
bool inline_exists = false;
- const string& filename = s->info.args.get("filename");
+ const std::string& filename = s->info.args.get("filename");
s->info.args.get("inline", &inline_exists);
if (inline_exists) {
s->content_disp.override = "inline";
} else if (!filename.empty()) {
- string fenc;
+ std::string fenc;
url_encode(filename, fenc);
s->content_disp.override = "attachment; filename=\"" + fenc + "\"";
} else {
- string fenc;
+ std::string fenc;
url_encode(s->object.name, fenc);
s->content_disp.fallback = "attachment; filename=\"" + fenc + "\"";
}