Skip to content

Commit d4142e1

Browse files
michaelklishinmergify[bot]
authored andcommitted
Wording, trailing ws #15044
(cherry picked from commit c6bcbf4)
1 parent f0fc165 commit d4142e1

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

deps/rabbitmq_management/src/rabbit_mgmt_schema.erl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@ extract_key_as_binary({Name,_}) -> list_to_binary(Name).
1818

1919
-spec translate_oauth_resource_servers([{list(), binary()}]) -> map().
2020
translate_oauth_resource_servers(Conf) ->
21-
%% Note: Conf must be reversed because cuttlefish_generator:transform_datatypes
22-
%% reverse the order of the configuration from rabbitmq.conf.
23-
%% Exactly on this line: `{[{Variable, NewValue}|Acc], ErrorAcc};`
24-
21+
%% `lists:reverse/1` must be reversed because cuttlefish_generator:transform_datatypes
22+
%% prepends new values as it translates rabbitmq.conf, like so:
23+
%% {[{Variable, NewValue}|Acc], ErrorAcc};
2524
Settings = cuttlefish_variable:filter_by_prefix(
2625
"management.oauth_resource_servers", lists:reverse(Conf)),
27-
26+
2827
Map = merge_list_of_maps([
2928
extract_resource_server_properties(Settings),
3029
extract_resource_server_endpoint_params(oauth_authorization_endpoint_params, Settings),
@@ -53,12 +52,12 @@ convert_list_to_binary(V) when is_list(V) ->
5352
convert_list_to_binary(V) ->
5453
V.
5554

56-
extract_resource_server_properties(Settings) ->
55+
extract_resource_server_properties(Settings) ->
5756
OAuthResourceServers = [{Name, {list_to_atom(Key), convert_list_to_binary(V)}}
5857
|| {["management","oauth_resource_servers", Name, Key], V} <- Settings ],
5958
lists:foldl(fun ({K, Value}, Acc) ->
6059
Key = list_to_binary(K),
61-
Attrs = case maps:get(Key, Acc, []) of
60+
Attrs = case maps:get(Key, Acc, []) of
6261
[] -> [] ++ [{index, maps:size(Acc)+1}, Value];
6362
List -> List ++ [Value]
6463
end,

0 commit comments

Comments
 (0)