From: Radoslaw Zarzynski Date: Thu, 2 Jun 2016 16:53:25 +0000 (+0200) Subject: rgw: RGWAnonymousAuthEngine accepts now only requests without a token. X-Git-Tag: v11.0.0~283^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=844e456b5fbc0bf13bae9a787ba889aeed8dbc16;p=ceph.git rgw: RGWAnonymousAuthEngine accepts now only requests without a token. Signed-off-by: Radoslaw Zarzynski --- diff --git a/src/rgw/rgw_auth.h b/src/rgw/rgw_auth.h index dd25a67fbe8f..efcd654425fe 100644 --- a/src/rgw/rgw_auth.h +++ b/src/rgw/rgw_auth.h @@ -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 { diff --git a/src/rgw/rgw_rest_swift.cc b/src/rgw/rgw_rest_swift.cc index 3918603288a2..9ed0c03ba973 100644 --- a/src/rgw/rgw_rest_swift.cc +++ b/src/rgw/rgw_rest_swift.cc @@ -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;