From: Patrick Donnelly Date: Wed, 26 Mar 2025 01:55:22 +0000 (-0400) Subject: auth/cephx: enforce sorted config keys X-Git-Tag: testing/wip-pdonnell-testing-20260210.212535~99 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=42693efea08d77f6d4fa02036cdaa3254a8dba7b;p=ceph-ci.git auth/cephx: enforce sorted config keys Makes future additions avoid conflicts. Signed-off-by: Patrick Donnelly --- diff --git a/src/auth/cephx/CephxServiceHandler.cc b/src/auth/cephx/CephxServiceHandler.cc index 0a4aba5f3f7..de819591c4b 100644 --- a/src/auth/cephx/CephxServiceHandler.cc +++ b/src/auth/cephx/CephxServiceHandler.cc @@ -47,9 +47,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) {