From: Yuval Lifshitz Date: Thu, 2 Jul 2020 05:47:22 +0000 (+0300) Subject: rgw: make RGWToken string ctor explicit X-Git-Tag: v16.1.0~1820^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=466f0c6b8c02e4db644ebb78896b4d68bfb144e6;p=ceph.git rgw: make RGWToken string ctor explicit Fixes: https://tracker.ceph.com/issues/46316 Signed-off-by: Yuval Lifshitz --- diff --git a/src/rgw/rgw_token.h b/src/rgw/rgw_token.h index 6f8d81c76f99..d9673f158d18 100644 --- a/src/rgw/rgw_token.h +++ b/src/rgw/rgw_token.h @@ -84,12 +84,19 @@ namespace rgw { const std::string& _key) : type(_type), id(_id), key(_key) {}; - RGWToken(const string& json) { + explicit RGWToken(const string& json) { JSONParser p; p.parse(json.c_str(), json.length()); JSONDecoder::decode_json(RGWToken::type_name, *this, &p); } + RGWToken& operator=(const std::string& json) { + JSONParser p; + p.parse(json.c_str(), json.length()); + JSONDecoder::decode_json(RGWToken::type_name, *this, &p); + return *this; + } + void encode(bufferlist& bl) const { uint32_t ver = version(); string typestr{from_type(type)};