From 844e456b5fbc0bf13bae9a787ba889aeed8dbc16 Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 2 Jun 2016 18:53:25 +0200 Subject: [PATCH] rgw: RGWAnonymousAuthEngine accepts now only requests without a token. Signed-off-by: Radoslaw Zarzynski --- src/rgw/rgw_auth.h | 7 ++++--- src/rgw/rgw_rest_swift.cc | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_auth.h b/src/rgw/rgw_auth.h index dd25a67fbe8f3..efcd654425fe1 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 3918603288a2a..9ed0c03ba9733 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; -- 2.39.5