|
7 | 7 |
|
8 | 8 | -module(rabbit_oauth2_schema). |
9 | 9 |
|
| 10 | +<<<<<<< HEAD |
| 11 | +======= |
| 12 | +-define(AUTH_OAUTH2, "auth_oauth2"). |
| 13 | +-define(SCOPE_ALIASES, "scope_aliases"). |
| 14 | +-define(RESOURCE_SERVERS, "resource_servers"). |
| 15 | +-define(OAUTH_PROVIDERS, "oauth_providers"). |
| 16 | +-define(SIGNING_KEYS, "signing_keys"). |
| 17 | +-define(AUTH_OAUTH2_SCOPE_ALIASES, ?AUTH_OAUTH2 ++ "." ++ ?SCOPE_ALIASES). |
| 18 | +-define(AUTH_OAUTH2_RESOURCE_SERVERS, ?AUTH_OAUTH2 ++ "." ++ ?RESOURCE_SERVERS). |
| 19 | +-define(AUTH_OAUTH2_OAUTH_PROVIDERS, ?AUTH_OAUTH2 ++ "." ++ ?OAUTH_PROVIDERS). |
| 20 | +-define(AUTH_OAUTH2_SIGNING_KEYS, ?AUTH_OAUTH2 ++ "." ++ ?SIGNING_KEYS). |
| 21 | +-define(RESOURCE_SERVERS_SYNONYMS, #{ |
| 22 | + "additional_scopes_key" => "extra_scopes_source" |
| 23 | +}). |
| 24 | +>>>>>>> f1ee5b551a (Update rabbit_oauth2_schema.erl) |
10 | 25 |
|
11 | 26 | -export([ |
12 | 27 | translate_oauth_providers/1, |
13 | 28 | translate_resource_servers/1, |
14 | 29 | translate_signing_keys/1 |
15 | 30 | ]). |
16 | 31 |
|
17 | | --define(RESOURCE_SERVERS_SYNONYMS, #{ |
18 | | - "additional_scopes_key" => "extra_scopes_source" |
19 | | -}). |
20 | | - |
21 | | -resource_servers_key_synonym(Name) -> |
22 | | - case maps:find(Name, ?RESOURCE_SERVERS_SYNONYMS) of {ok, Synonym} -> Synonym; |
23 | | - error -> Name |
24 | | - end. |
| 32 | +resource_servers_key_synonym(Key) -> maps:get(Key, ?RESOURCE_SERVERS_SYNONYMS, Key). |
25 | 33 |
|
26 | 34 | extract_key_as_binary({Name,_}) -> list_to_binary(Name). |
27 | 35 | extract_value({_Name,V}) -> V. |
|
0 commit comments