]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: RGWAnonymousAuthEngine accepts now only requests without a token.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Thu, 2 Jun 2016 16:53:25 +0000 (18:53 +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/rgw_auth.h
src/rgw/rgw_rest_swift.cc

index dd25a67fbe8f37cb4156953b05a428912cd1b94c..efcd654425fe1c08431a5ba308faf56fa58da7bf 100644 (file)
@@ -318,18 +318,19 @@ public:
 
 
 /* Anonymous */
-class RGWAnonymousAuthEngine : public RGWAuthEngine {
+class RGWAnonymousAuthEngine : public RGWTokenBasedAuthEngine {
   const RGWLocalAuthApplier::Factory * const apl_factory;
 
 public:
   RGWAnonymousAuthEngine(CephContext * const cct,
+                         const Extractor& extr,
                          const RGWLocalAuthApplier::Factory * const apl_factory)
-    : RGWAuthEngine(cct),
+    : RGWTokenBasedAuthEngine(cct, extr),
       apl_factory(apl_factory) {
   }
 
   bool is_applicable() const noexcept override {
-    return true;
+    return token.empty();
   }
 
   const char* get_name() const noexcept override {
index 3918603288a2a27f6a84c1e6f5986eaae08bbe54..9ed0c03ba973377fed14ab870ff396e74def85e9 100644 (file)
@@ -1515,7 +1515,7 @@ int RGWHandler_REST_SWIFT::authorize()
   RGWSignedTokenAuthEngine rgwtk(s->cct, store, token_extr, &aplfact);
   RGWKeystoneAuthEngine keystone(s->cct,        token_extr, &aplfact);
   RGWExternalTokenAuthEngine ext(s->cct, store, token_extr, &aplfact);
-  RGWAnonymousAuthEngine anoneng(s->cct,                    &aplfact);
+  RGWAnonymousAuthEngine anoneng(s->cct,        token_extr, &aplfact);
 
   /* Pipeline. */
   constexpr size_t ENGINES_NUM = 5;