From 81f780a2e9ec766571d6d04c11837bf864d6b76d Mon Sep 17 00:00:00 2001 From: Aaron Seo Date: Thu, 6 Mar 2025 11:48:00 -0800 Subject: [PATCH] Rename web_dispatch config prefix to http_dispatch (cherry picked from commit 8c09e6c7ddb6cfdf7a6a656d3873cda4be3c2baa) --- .../priv/schema/rabbitmq_web_dispatch.schema | 16 +++++----- .../rabbitmq_web_dispatch.snippets | 32 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/deps/rabbitmq_web_dispatch/priv/schema/rabbitmq_web_dispatch.schema b/deps/rabbitmq_web_dispatch/priv/schema/rabbitmq_web_dispatch.schema index 8e3c5131bf..f9f2705fea 100644 --- a/deps/rabbitmq_web_dispatch/priv/schema/rabbitmq_web_dispatch.schema +++ b/deps/rabbitmq_web_dispatch/priv/schema/rabbitmq_web_dispatch.schema @@ -10,11 +10,11 @@ %% Select an authentication backend to use for the management plugin. RabbitMQ provides an %% internal backend in the core. %% -%% {web_dispatch.auth_backends, [rabbit_auth_backend_internal]}, +%% {http_dispatch.auth_backends, [rabbit_auth_backend_internal]}, {translation, "rabbitmq_web_dispatch.auth_backends", fun(Conf) -> - Settings = cuttlefish_variable:filter_by_prefix("web_dispatch.auth_backends", Conf), + Settings = cuttlefish_variable:filter_by_prefix("http_dispatch.auth_backends", Conf), BackendModule = fun (internal) -> rabbit_auth_backend_internal; (ldap) -> rabbit_auth_backend_ldap; @@ -27,9 +27,9 @@ fun(Conf) -> (Other) when is_atom(Other) -> Other; (_) -> cuttlefish:invalid("Unknown/unsupported auth backend") end, - AuthBackends = [{Num, {default, BackendModule(V)}} || {["web_dispatch", "auth_backends", Num], V} <- Settings], - AuthNBackends = [{Num, {authn, BackendModule(V)}} || {["web_dispatch", "auth_backends", Num, "authn"], V} <- Settings], - AuthZBackends = [{Num, {authz, BackendModule(V)}} || {["web_dispatch", "auth_backends", Num, "authz"], V} <- Settings], + AuthBackends = [{Num, {default, BackendModule(V)}} || {["http_dispatch", "auth_backends", Num], V} <- Settings], + AuthNBackends = [{Num, {authn, BackendModule(V)}} || {["http_dispatch", "auth_backends", Num, "authn"], V} <- Settings], + AuthZBackends = [{Num, {authz, BackendModule(V)}} || {["http_dispatch", "auth_backends", Num, "authz"], V} <- Settings], Backends = lists:foldl( fun({NumStr, {Type, V}}, Acc) -> Num = case catch list_to_integer(NumStr) of @@ -84,15 +84,15 @@ fun(Conf) -> lists:keysort(1, dict:to_list(Backends))) end}. -{mapping, "web_dispatch.auth_backends.$num", "rabbitmq_web_dispatch.auth_backends", [ +{mapping, "http_dispatch.auth_backends.$num", "rabbitmq_web_dispatch.auth_backends", [ {datatype, atom} ]}. -{mapping, "web_dispatch.auth_backends.$num.authn", "rabbitmq_web_dispatch.auth_backends",[ +{mapping, "http_dispatch.auth_backends.$num.authn", "rabbitmq_web_dispatch.auth_backends",[ {datatype, atom} ]}. -{mapping, "web_dispatch.auth_backends.$num.authz", "rabbitmq_web_dispatch.auth_backends",[ +{mapping, "http_dispatch.auth_backends.$num.authz", "rabbitmq_web_dispatch.auth_backends",[ {datatype, atom} ]}. diff --git a/deps/rabbitmq_web_dispatch/test/config_schema_SUITE_data/rabbitmq_web_dispatch.snippets b/deps/rabbitmq_web_dispatch/test/config_schema_SUITE_data/rabbitmq_web_dispatch.snippets index fb26681fd7..8997912dd2 100644 --- a/deps/rabbitmq_web_dispatch/test/config_schema_SUITE_data/rabbitmq_web_dispatch.snippets +++ b/deps/rabbitmq_web_dispatch/test/config_schema_SUITE_data/rabbitmq_web_dispatch.snippets @@ -2,61 +2,61 @@ % [{internal_auth_backend, - "web_dispatch.auth_backends.1 = internal", + "http_dispatch.auth_backends.1 = internal", [{rabbitmq_web_dispatch,[{auth_backends,[rabbit_auth_backend_internal]}]}], []}, {ldap_auth_backend, - "web_dispatch.auth_backends.1 = ldap", + "http_dispatch.auth_backends.1 = ldap", [{rabbitmq_web_dispatch,[{auth_backends,[rabbit_auth_backend_ldap]}]}], []}, {http_auth_backend, - "web_dispatch.auth_backends.1 = http", + "http_dispatch.auth_backends.1 = http", [{rabbitmq_web_dispatch,[{auth_backends,[rabbit_auth_backend_http]}]}], []}, {oauth2_auth_backend, - "web_dispatch.auth_backends.1 = oauth2", + "http_dispatch.auth_backends.1 = oauth2", [{rabbitmq_web_dispatch,[{auth_backends,[rabbit_auth_backend_oauth2]}]}], []}, {multiple_auth_backends, - "web_dispatch.auth_backends.1 = ldap -web_dispatch.auth_backends.2 = internal", + "http_dispatch.auth_backends.1 = ldap +http_dispatch.auth_backends.2 = internal", [{rabbitmq_web_dispatch, [{auth_backends, [rabbit_auth_backend_ldap,rabbit_auth_backend_internal]}]}], []}, {full_name_auth_backend, - "web_dispatch.auth_backends.1 = ldap + "http_dispatch.auth_backends.1 = ldap # uses module name instead of a short alias, \"http\" -web_dispatch.auth_backends.2 = rabbit_auth_backend_http", +http_dispatch.auth_backends.2 = rabbit_auth_backend_http", [{rabbitmq_web_dispatch, [{auth_backends,[rabbit_auth_backend_ldap,rabbit_auth_backend_http]}]}], []}, {third_party_auth_backend, - "web_dispatch.auth_backends.1.authn = internal + "http_dispatch.auth_backends.1.authn = internal # uses module name because this backend is from a 3rd party -web_dispatch.auth_backends.1.authz = rabbit_auth_backend_ip_range", +http_dispatch.auth_backends.1.authz = rabbit_auth_backend_ip_range", [{rabbitmq_web_dispatch, [{auth_backends, [{rabbit_auth_backend_internal,rabbit_auth_backend_ip_range}]}]}], []}, {authn_authz_backend, - "web_dispatch.auth_backends.1.authn = ldap -web_dispatch.auth_backends.1.authz = internal", + "http_dispatch.auth_backends.1.authn = ldap +http_dispatch.auth_backends.1.authz = internal", [{rabbitmq_web_dispatch, [{auth_backends, [{rabbit_auth_backend_ldap,rabbit_auth_backend_internal}]}]}], []}, {authn_authz_multiple_backends, - "web_dispatch.auth_backends.1.authn = ldap -web_dispatch.auth_backends.1.authz = internal -web_dispatch.auth_backends.2 = internal", + "http_dispatch.auth_backends.1.authn = ldap +http_dispatch.auth_backends.1.authz = internal +http_dispatch.auth_backends.2 = internal", [{rabbitmq_web_dispatch, [{auth_backends, [{rabbit_auth_backend_ldap,rabbit_auth_backend_internal}, rabbit_auth_backend_internal]}]}], []}, {authn_backend_only, - "web_dispatch.auth_backends.1.authn = ldap", + "http_dispatch.auth_backends.1.authn = ldap", [{rabbitmq_web_dispatch, [{auth_backends, [{rabbit_auth_backend_ldap,rabbit_auth_backend_ldap}]}]}],