From: Patrick Donnelly Date: Wed, 26 Mar 2025 01:55:22 +0000 (-0400) Subject: auth/cephx: enforce sorted config keys X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=60d823363aa606e281a7696452381517c8f2d9cc;p=ceph-ci.git auth/cephx: enforce sorted config keys Makes future additions avoid conflicts. Signed-off-by: Patrick Donnelly (cherry picked from commit 6ca5288570a8e6f4edb7b4f7ca0c47b9c4f0d212) --- diff --git a/src/auth/cephx/CephxServiceHandler.cc b/src/auth/cephx/CephxServiceHandler.cc index 4b61df25bad..df886514352 100644 --- a/src/auth/cephx/CephxServiceHandler.cc +++ b/src/auth/cephx/CephxServiceHandler.cc @@ -45,9 +45,11 @@ CephxServiceHandler::CephxServiceHandler(CephContext *cct_, KeyServer *ks) std::vector CephxServiceHandler::get_tracked_keys() const noexcept { - return { - "cephx_allowed_ciphers"s - }; + static constexpr auto as_sv = std::to_array({ + "cephx_allowed_ciphers", + }); + static_assert(std::is_sorted(as_sv.begin(), as_sv.end()), "keys are not sorted!"); + return {as_sv.begin(), as_sv.end()}; } void CephxServiceHandler::init_conf(const ConfigProxy& conf) {