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-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4ead6acc0f218c20efa232afe7688b443e32e876;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 19e612b10cb..8ed135822a3 100644 --- a/src/auth/cephx/CephxServiceHandler.cc +++ b/src/auth/cephx/CephxServiceHandler.cc @@ -46,9 +46,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) {