Skip to content

Commit 4efd3b8

Browse files
MarcialRosalesmergify[bot]
authored andcommitted
Fix test cases
(cherry picked from commit 175ee2c)
1 parent 1e56cfb commit 4efd3b8

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

deps/oauth2_client/src/oauth2_client.erl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ extract_ssl_options_as_list(Map) ->
328328
% Replace peer_verification with verify to make it more consistent with other
329329
% ssl_options in RabbitMQ and Erlang's ssl options
330330
% Eventually, peer_verification will be removed. For now, both are allowed
331-
-spec get_verify_or_peer_verification(#{atom() => any()}, any()) -> proplists:proplist().
331+
-spec get_verify_or_peer_verification(#{atom() => any()}, verify_none | verify_peer ) -> verify_none | verify_peer.
332332
get_verify_or_peer_verification(Ssl_options, Default) ->
333333
case maps:get(verify, Ssl_options, undefined) of
334334
undefined ->
@@ -437,14 +437,13 @@ map_to_oauth_provider(Map) when is_map(Map) ->
437437
jwks_uri = maps:get(?RESPONSE_JWKS_URI, Map, undefined)
438438
};
439439

440-
map_to_oauth_provider(PropList) when is_list(PropList) ->
440+
map_to_oauth_provider(PropList) when is_list(PropList) ->
441441
#oauth_provider{
442442
issuer = proplists:get_value(issuer, PropList),
443443
token_endpoint = proplists:get_value(token_endpoint, PropList),
444444
authorization_endpoint = proplists:get_value(authorization_endpoint, PropList, undefined),
445445
jwks_uri = proplists:get_value(jwks_uri, PropList, undefined),
446-
ssl_options = extract_ssl_options_as_list(maps:from_list(
447-
proplists:get_value(https, PropList, [])))
446+
ssl_options = extract_ssl_options_as_list(maps:from_list(proplists:get_value(https, PropList, [])))
448447
}.
449448

450449

deps/oauth2_client/test/system_SUITE.erl

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ groups() ->
177177
ssl_connection_error,
178178
{group, with_all_oauth_provider_settings},
179179
{group, without_all_oauth_providers_settings}
180-
]}
180+
]}
181181
].
182182

183183
init_per_suite(Config) ->
@@ -463,8 +463,14 @@ build_https_oauth_provider(CaCertFile) ->
463463
}.
464464
oauth_provider_to_proplist(#oauth_provider{ issuer = Issuer, token_endpoint = TokenEndpoint,
465465
ssl_options = SslOptions, jwks_uri = Jwks_url}) ->
466-
[ { issuer, Issuer}, {token_endpoint, TokenEndpoint},
467-
{ https, SslOptions}, {jwks_url, Jwks_url} ].
466+
[ { issuer, Issuer},
467+
{token_endpoint, TokenEndpoint},
468+
{ https,
469+
case SslOptions of
470+
undefined -> [];
471+
Value -> Value
472+
end},
473+
{jwks_url, Jwks_url} ].
468474

469475
start_http_oauth_server(Port, Expectations) when is_list(Expectations) ->
470476
Dispatch = cowboy_router:compile([

0 commit comments

Comments
 (0)