Skip to content

Commit cf23f4c

Browse files
Remove management.oauth_metadata_url
1 parent be9e372 commit cf23f4c

File tree

4 files changed

+7
-42
lines changed

4 files changed

+7
-42
lines changed

deps/rabbitmq_auth_backend_oauth2/priv/schema/rabbitmq_auth_backend_oauth2.schema

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@
144144
[{datatype, string}, {validators, ["uri", "https_uri"]}]}.
145145

146146
{mapping,
147-
"auth_oauth2.jwks_url",
148-
"rabbitmq_auth_backend_oauth2.key_config.jwks_url",
147+
"auth_oauth2.jwks_uri",
148+
"rabbitmq_auth_backend_oauth2.key_config.jwks_uri",
149149
[{datatype, string}, {validators, ["uri", "https_uri"]}]}.
150150

151151
{mapping,

deps/rabbitmq_management/priv/schema/rabbitmq_management.schema

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -496,11 +496,6 @@ end}.
496496
{mapping, "management.oauth_scopes", "rabbitmq_management.oauth_scopes",
497497
[{datatype, string}]}.
498498

499-
%% The URL of the OIDC discovery url where the provider is listening on
500-
%% by default it is <oauth_provider_url>/.well-known/openid-configuration which is the
501-
%% default OIDC discovery endpoint
502-
{mapping, "management.oauth_metadata_url", "rabbitmq_management.oauth_metadata_url",
503-
[{datatype, string}]}.
504499

505500
%% Configure the OAuth 2 type allowed for the end users to logon to the management UI
506501
%% Default type is sp_initiated meaning the standard OAuth 2.0 mode where users come without any token
@@ -557,12 +552,6 @@ end}.
557552
[{datatype, string}]
558553
}.
559554

560-
{mapping,
561-
"management.oauth_resource_servers.$name.oauth_metadata_url",
562-
"rabbitmq_management.oauth_resource_servers",
563-
[{datatype, string}]
564-
}.
565-
566555
{mapping,
567556
"management.oauth_resource_servers.$name.oauth_initiated_logon_type",
568557
"rabbitmq_management.oauth_resource_servers",

deps/rabbitmq_management/src/rabbit_mgmt_wm_auth.erl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ merge_property(Key, List, MapIn) ->
3434
extract_oauth_provider_info_props_as_map(ManagementProps) ->
3535
lists:foldl(fun(K, Acc) ->
3636
merge_property(K, ManagementProps, Acc) end, #{}, [oauth_provider_url,
37-
oauth_metadata_url, oauth_authorization_endpoint_params,
37+
oauth_authorization_endpoint_params,
3838
oauth_token_endpoint_params]).
3939

4040
merge_oauth_provider_info(OAuthResourceServer, MgtResourceServer, ManagementProps) ->
@@ -55,8 +55,8 @@ oauth_provider_to_map(OAuthProvider) ->
5555
Map0 = case OAuthProvider#oauth_provider.issuer of
5656
undefined -> #{};
5757
Issuer -> #{ oauth_provider_url => Issuer,
58-
oauth_metadata_url => OAuthProvider#oauth_provider.discovery_endpoint
59-
}
58+
oauth_metadata_url => OAuthProvider#oauth_provider.discovery_endpoint
59+
}
6060
end,
6161
case OAuthProvider#oauth_provider.end_session_endpoint of
6262
undefined -> Map0;

deps/rabbitmq_management/test/rabbit_mgmt_wm_auth_SUITE.erl

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,7 @@ groups() ->
9696
should_return_mgt_oauth_metadata_url_url1,
9797
{with_mgt_oauth_provider_url_url0, [], [
9898
should_return_mgt_oauth_provider_url_url0,
99-
should_return_mgt_oauth_metadata_url_url1,
100-
{with_mgt_oauth_metadata_url_url0, [], [
101-
should_return_mgt_oauth_metadata_url_url0
102-
]}
99+
should_return_mgt_oauth_metadata_url_url1
103100
]}
104101
]}
105102
]}
@@ -205,10 +202,7 @@ groups() ->
205202
should_return_oauth_resource_server_a_with_oauth_metadata_url_url1,
206203
{with_mgt_oauth_resource_server_a_with_oauth_provider_url_url1, [], [
207204
should_return_oauth_resource_server_rabbit_with_oauth_provider_url_url0,
208-
should_return_oauth_resource_server_a_with_oauth_provider_url_url1,
209-
{with_mgt_oauth_resource_server_a_with_oauth_metadata_url_url0, [], [
210-
should_return_oauth_resource_server_a_with_oauth_metadata_url_url0
211-
]}
205+
should_return_oauth_resource_server_a_with_oauth_provider_url_url1
212206
]}
213207
]}
214208
]}
@@ -409,9 +403,6 @@ init_per_group(with_mgt_oauth_client_secret_q, Config) ->
409403
init_per_group(with_mgt_oauth_provider_url_url0, Config) ->
410404
set_env(rabbitmq_management, oauth_provider_url, ?config(url0, Config)),
411405
Config;
412-
init_per_group(with_mgt_oauth_metadata_url_url0, Config) ->
413-
set_env(rabbitmq_management, oauth_metadata_url, ?config(meta_url0, Config)),
414-
Config;
415406
init_per_group(with_root_issuer_url1, Config) ->
416407
set_env(rabbitmq_auth_backend_oauth2, issuer, ?config(url1, Config)),
417408
Config;
@@ -460,10 +451,6 @@ init_per_group(with_mgt_oauth_resource_server_a_with_oauth_provider_url_url1, Co
460451
set_attribute_in_entry_for_env_variable(rabbitmq_management, oauth_resource_servers,
461452
?config(a, Config), oauth_provider_url, ?config(url1, Config)),
462453
Config;
463-
init_per_group(with_mgt_oauth_resource_server_a_with_oauth_metadata_url_url0, Config) ->
464-
set_attribute_in_entry_for_env_variable(rabbitmq_management, oauth_resource_servers,
465-
?config(a, Config), oauth_metadata_url, ?config(meta_url0, Config)),
466-
Config;
467454
init_per_group(with_mgt_resource_server_a_with_client_id_x, Config) ->
468455
set_attribute_in_entry_for_env_variable(rabbitmq_management, oauth_resource_servers,
469456
?config(a, Config), oauth_client_id, ?config(x, Config)),
@@ -538,9 +525,6 @@ end_per_group(with_resource_server_id_rabbit, Config) ->
538525
end_per_group(with_mgt_oauth_provider_url_url0, Config) ->
539526
unset_env(rabbitmq_management, oauth_provider_url),
540527
Config;
541-
end_per_group(with_mgt_oauth_metadata_url_url0, Config) ->
542-
unset_env(rabbitmq_management, oauth_metadata_url),
543-
Config;
544528
end_per_group(with_root_issuer_url1, Config) ->
545529
unset_env(rabbitmq_auth_backend_oauth2, issuer),
546530
unset_env(rabbitmq_auth_backend_oauth2, discovery_endpoint),
@@ -574,10 +558,6 @@ end_per_group(with_mgt_oauth_resource_server_a_with_oauth_provider_url_url1, Con
574558
remove_attribute_from_entry_from_env_variable(rabbitmq_management, oauth_resource_servers,
575559
?config(a, Config), oauth_provider_url),
576560
Config;
577-
end_per_group(with_mgt_oauth_resource_server_a_with_oauth_metadata_url_url0, Config) ->
578-
remove_attribute_from_entry_from_env_variable(rabbitmq_management, oauth_resource_servers,
579-
?config(a, Config), oauth_metadata_url),
580-
Config;
581561
end_per_group(with_mgt_resource_server_a_with_oauth_initiated_logon_type_sp_initiated, Config) ->
582562
remove_attribute_from_entry_from_env_variable(rabbitmq_management, oauth_resource_servers,
583563
?config(a, Config), oauth_initiated_logon_type),
@@ -705,10 +685,6 @@ should_return_oauth_resource_server_a_with_oauth_metadata_url_url1(Config) ->
705685
assertEqual_on_attribute_for_oauth_resource_server(authSettings(),
706686
Config, a, oauth_metadata_url, meta_url1).
707687

708-
should_return_oauth_resource_server_a_with_oauth_metadata_url_url0(Config) ->
709-
assertEqual_on_attribute_for_oauth_resource_server(authSettings(),
710-
Config, a, oauth_metadata_url, meta_url0).
711-
712688
should_return_oauth_resource_server_a_with_oauth_provider_url_url0(Config) ->
713689
assertEqual_on_attribute_for_oauth_resource_server(authSettings(),
714690
Config, a, oauth_provider_url, url0).

0 commit comments

Comments
 (0)