]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: replace RGWDummyIdentityApplier with rgw::auth::DummyIdentityApplier.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Wed, 11 Jan 2017 15:14:11 +0000 (16:14 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 24 Mar 2017 15:55:26 +0000 (16:55 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
src/rgw/librgw.cc
src/rgw/rgw_auth.cc
src/rgw/rgw_auth.h
src/rgw/rgw_process.cc
src/rgw/rgw_rest_s3.cc

index 4150a6f9dc6b9680bafa1ccf323dda06b6c70b1b..9a0d3f33751ea6b17a5c101b49cac211fd37854a 100644 (file)
@@ -250,8 +250,8 @@ namespace rgw {
 
     /* FIXME: remove this after switching all handlers to the new authentication
      * infrastructure. */
-    if (! s->auth_identity) {
-      s->auth_identity = rgw_auth_transform_old_authinfo(s);
+    if (! s->auth.identity) {
+      s->auth.identity = rgw::auth::transform_old_authinfo(s);
     }
 
     req->log(s, "reading op permissions");
@@ -365,8 +365,8 @@ namespace rgw {
 
     /* FIXME: remove this after switching all handlers to the new authentication
      * infrastructure. */
-    if (! s->auth_identity) {
-      s->auth_identity = rgw_auth_transform_old_authinfo(s);
+    if (! s->auth.identity) {
+      s->auth.identity = rgw::auth::transform_old_authinfo(s);
     }
 
     req->log(s, "reading op permissions");
index 27840f28490b7982b822cd1d30ce9370eb36019c..c9a1893913c3b646460394e9687d8da5526db4bb 100644 (file)
 #define dout_subsys ceph_subsys_rgw
 
 
-std::unique_ptr<RGWIdentityApplier>
-rgw_auth_transform_old_authinfo(req_state * const s)
+namespace rgw {
+namespace auth {
+
+std::unique_ptr<rgw::auth::Identity>
+transform_old_authinfo(const req_state* const s)
 {
   /* This class is not intended for public use. Should be removed altogether
    * with this function after moving all our APIs to the new authentication
    * infrastructure. */
-  class RGWDummyIdentityApplier : public RGWIdentityApplier {
-    CephContext * const cct;
+  class DummyIdentityApplier : public rgw::auth::Identity {
+    CephContext* const cct;
 
     /* For this particular case it's OK to use rgw_user structure to convey
      * the identity info as this was the policy for doing that before the
@@ -31,10 +34,10 @@ rgw_auth_transform_old_authinfo(req_state * const s)
     const int perm_mask;
     const bool is_admin;
   public:
-    RGWDummyIdentityApplier(CephContext * const cct,
-                            const rgw_user& auth_id,
-                            const int perm_mask,
-                            const bool is_admin)
+    DummyIdentityApplier(CephContext* const cct,
+                         const rgw_user& auth_id,
+                         const int perm_mask,
+                         const bool is_admin)
       : cct(cct),
         id(auth_id),
         perm_mask(perm_mask),
@@ -64,15 +67,18 @@ rgw_auth_transform_old_authinfo(req_state * const s)
     }
   };
 
-  return std::unique_ptr<RGWIdentityApplier>(
-        new RGWDummyIdentityApplier(s->cct,
-                                    s->user->user_id,
-                                    s->perm_mask,
+  return std::unique_ptr<rgw::auth::Identity>(
+        new DummyIdentityApplier(s->cct,
+                                 s->user->user_id,
+                                 s->perm_mask,
   /* System user has admin permissions by default - it's supposed to pass
    * through any security check. */
-                                    s->system_request));
+                                 s->system_request));
 }
 
+} /* namespace auth */
+} /* namespace rgw */
+
 
 uint32_t rgw_perms_from_aclspec_default_strategy(
   const rgw_user& uid,
index 6755c8812b0fca73fb3199dcf2d3d78da6974fed..53d6b9e506d69c06dfd3a75071a9ecf16efe1d7b 100644 (file)
@@ -62,9 +62,6 @@ inline std::ostream& operator<<(std::ostream& out,
   return out;
 }
 
-std::unique_ptr<RGWIdentityApplier>
-rgw_auth_transform_old_authinfo(req_state * const s);
-
 uint32_t rgw_perms_from_aclspec_default_strategy(
   const rgw_user& uid,
   const RGWIdentityApplier::aclspec_t& aclspec);
@@ -409,6 +406,9 @@ inline std::ostream& operator<<(std::ostream& out,
 }
 
 
+std::unique_ptr<Identity> transform_old_authinfo(const req_state* const s);
+
+
 /* Interface for classes applying changes to request state/RADOS store
  * imposed by a particular rgw::auth::Engine.
  *
index 6b2c79d5939304800082a4e6c256e1e29a44096e..c4d2c8dfbc67cf4c1e9a197bc2a6495f7ea3de38 100644 (file)
@@ -178,8 +178,8 @@ int process_request(RGWRados* const store,
 
   /* FIXME: remove this after switching all handlers to the new authentication
    * infrastructure. */
-  if (nullptr == s->auth_identity) {
-    s->auth_identity = rgw_auth_transform_old_authinfo(s);
+  if (nullptr == s->auth.identity) {
+    s->auth.identity = rgw::auth::transform_old_authinfo(s);
   }
 
   req->log(s, "normalizing buckets and tenants");
index a902c614029f1e4a41c0a4ee2d730e79f15e92ae..fbd988eba923120c9d3d970dc5f8de13b0bfd2ed 100644 (file)
@@ -1927,7 +1927,7 @@ int RGWPostObj_ObjStore_S3::get_policy()
 
     /* FIXME: remove this after switching S3 to the new authentication
      * infrastructure. */
-    s->auth_identity = rgw_auth_transform_old_authinfo(s);
+    s->auth.identity = rgw::auth::transform_old_authinfo(s);
   } else {
     ldout(s->cct, 0) << "No attached policy found!" << dendl;
   }