Skip to content

Commit f1ee5b5

Browse files
Hathoutemichaelklishin
authored andcommitted
Update rabbit_oauth2_schema.erl
(cherry picked from commit ed5f29c)
1 parent 0d51ee9 commit f1ee5b5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

deps/rabbitmq_auth_backend_oauth2/src/rabbit_oauth2_schema.erl

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@
1616
-define(AUTH_OAUTH2_RESOURCE_SERVERS, ?AUTH_OAUTH2 ++ "." ++ ?RESOURCE_SERVERS).
1717
-define(AUTH_OAUTH2_OAUTH_PROVIDERS, ?AUTH_OAUTH2 ++ "." ++ ?OAUTH_PROVIDERS).
1818
-define(AUTH_OAUTH2_SIGNING_KEYS, ?AUTH_OAUTH2 ++ "." ++ ?SIGNING_KEYS).
19+
-define(RESOURCE_SERVERS_SYNONYMS, #{
20+
"additional_scopes_key" => "extra_scopes_source"
21+
}).
1922

2023
-export([
2124
translate_oauth_providers/1,
@@ -25,14 +28,7 @@
2528
translate_scope_aliases/1
2629
]).
2730

28-
-define(RESOURCE_SERVERS_SYNONYMS, #{
29-
"additional_scopes_key" => "extra_scopes_source"
30-
}).
31-
32-
resource_servers_key_synonym(Name) ->
33-
case maps:find(Name, ?RESOURCE_SERVERS_SYNONYMS) of {ok, Synonym} -> Synonym;
34-
error -> Name
35-
end.
31+
resource_servers_key_synonym(Key) -> maps:get(Key, ?RESOURCE_SERVERS_SYNONYMS, Key).
3632

3733
extract_key_as_binary({Name,_}) -> list_to_binary(Name).
3834
extract_value({_Name,V}) -> V.

0 commit comments

Comments
 (0)