Skip to content

Commit 98d4445

Browse files
michaelklishinmergify[bot]
authored andcommitted
rabbitmq.conf schema and tests for #13698
(cherry picked from commit 20188a7)
1 parent 95c2ba7 commit 98d4445

File tree

4 files changed

+51
-2
lines changed

4 files changed

+51
-2
lines changed

deps/rabbitmq_management/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ define PROJECT_ENV
1515
{content_security_policy, "script-src 'self' 'unsafe-eval' 'unsafe-inline'; object-src 'self'"},
1616
{max_http_body_size, 10000000},
1717
{delegate_count, 5},
18-
{require_auth_for_api_desc_page, false}
18+
{require_auth_for_api_reference, false}
1919
]
2020
endef
2121

deps/rabbitmq_management/priv/schema/rabbitmq_management.schema

+7
Original file line numberDiff line numberDiff line change
@@ -654,3 +654,10 @@ end}.
654654
{datatype, {enum, [true, false]}},
655655
{include_default, false}
656656
]}.
657+
658+
%% Require authentication for the HTTP API reference page.
659+
660+
{mapping, "management.require_auth_for_api_reference", "rabbitmq_management.require_auth_for_api_reference", [
661+
{datatype, {enum, [true, false]}},
662+
{include_default, false}
663+
]}.

deps/rabbitmq_management/src/rabbit_mgmt_wm_static.erl

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ malformed_request(Req, State) ->
5050

5151
is_authorized(Req0=#{path := Path}, State)
5252
when Path =:= <<"/api/index.html">>; Path =:= <<"/cli/index.html">> ->
53-
case application:get_env(rabbitmq_management, require_auth_for_api_desc_page) of
53+
case application:get_env(rabbitmq_management, require_auth_for_api_reference) of
5454
{ok, true} ->
5555
%% We temporarily use #context{} here to make authorization work,
5656
%% and discard it immediately after since we only want to check

deps/rabbitmq_management/test/config_schema_SUITE_data/rabbitmq_management.snippets

+42
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,48 @@
497497
], [rabbitmq_management]
498498
},
499499

500+
%%
501+
%% Restrictions
502+
%%
503+
504+
{restrictions_quorum_queue_replica_operations_disabled_case1,
505+
"management.restrictions.quorum_queue_replica_operations.disabled = true",
506+
[
507+
{rabbitmq_management, [
508+
{restrictions, [
509+
{quorum_queue_replica_operations, [
510+
{disabled, true}
511+
]}
512+
]}
513+
]}
514+
], [rabbitmq_management]
515+
},
516+
517+
{restrictions_operator_policy_changes_disabled_case1,
518+
"management.restrictions.operator_policy_changes.disabled = true",
519+
[
520+
{rabbitmq_management, [
521+
{restrictions, [
522+
{operator_policy_changes, [
523+
{disabled, true}
524+
]}
525+
]}
526+
]}
527+
], [rabbitmq_management]
528+
},
529+
530+
%%
531+
%% Exotic options
532+
%%
533+
534+
{auth_for_http_api_reference_case1,
535+
"management.require_auth_for_api_reference = true",
536+
[
537+
{rabbitmq_management, [
538+
{require_auth_for_api_reference, true}
539+
]}
540+
], [rabbitmq_management]
541+
},
500542

501543
%%
502544
%% Legacy listener configuration

0 commit comments

Comments
 (0)