]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: cosmetic changes in the new auth infra.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 23 May 2016 12:03:56 +0000 (14:03 +0200)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 2 Jun 2016 19:17:13 +0000 (21:17 +0200)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/librgw.cc
src/rgw/rgw_acl_swift.cc
src/rgw/rgw_auth.cc
src/rgw/rgw_auth.h
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_swift_auth.cc

index ff60a1a8a83086b688b7d0d38f026cd4534c001e..0aff2527b1de66d6487a1c6b2a075d28b3d72be3 100644 (file)
@@ -230,7 +230,7 @@ namespace rgw {
 
     /* 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);
     }
 
@@ -342,7 +342,7 @@ namespace rgw {
 
     /* 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);
     }
 
index 8bbb90d6bedc919e122c5772db56be1b8fcbf5a5..4cd51469409ef69b5b0b8b5d344b981c55c9eb5d 100644 (file)
@@ -63,7 +63,8 @@ static bool uid_is_public(const string& uid)
          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) {
index 5ab312c37d19cc4a9ce9e5bd517e1cb930d7279a..b96795d665a489acd76345a9c073509098ba4e34 100644 (file)
@@ -306,11 +306,11 @@ typedef RGWKeystoneHTTPTransceiver RGWGetRevokedTokens;
 
 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
@@ -390,7 +390,7 @@ RGWKeystoneAuthEngine::get_creds_info(const KeystoneToken& token,
     }
   }
 
-  return {
+  return RGWRemoteAuthApplier::AuthInfo {
     /* Suggested account name for the authenticated user. */
     rgw_user(token.get_project_id()),
     /* User's display name (aka real name). */
index 09538fda4a83a86c44fde4103aa27dc2e982bf67..0bf39ec7faf3a80679204450f61a874e59a395db 100644 (file)
@@ -156,12 +156,12 @@ public:
       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() {}
@@ -199,14 +199,14 @@ public:
   }
 
 
-  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() {}
index 1a55de9759f519c6927dcb9bcf95c5aa0eb3934d..3918603288a2a27f6a84c1e6f5986eaae08bbe54 100644 (file)
@@ -1524,7 +1524,7 @@ int RGWHandler_REST_SWIFT::authorize()
   };
 
   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;
index 7f41287a37360731dbaeac4df63a6a83dc2a63f5..ceb64aadf1c23cf0d5c629fa3b2bf9f4300e624f 100644 (file)
@@ -29,17 +29,17 @@ using namespace ceph::crypto;
 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 + "\"";
   }