Fix test cases

This commit is contained in:
Marcial Rosales 2024-04-09 12:54:57 +02:00
parent f7e25b4611
commit 175ee2ccc7
2 changed files with 12 additions and 7 deletions

View File

@ -328,7 +328,7 @@ extract_ssl_options_as_list(Map) ->
% Replace peer_verification with verify to make it more consistent with other
% ssl_options in RabbitMQ and Erlang's ssl options
% Eventually, peer_verification will be removed. For now, both are allowed
-spec get_verify_or_peer_verification(#{atom() => any()}, any()) -> proplists:proplist().
-spec get_verify_or_peer_verification(#{atom() => any()}, verify_none | verify_peer ) -> verify_none | verify_peer.
get_verify_or_peer_verification(Ssl_options, Default) ->
case maps:get(verify, Ssl_options, undefined) of
undefined ->
@ -443,8 +443,7 @@ map_to_oauth_provider(PropList) when is_list(PropList) ->
token_endpoint = proplists:get_value(token_endpoint, PropList),
authorization_endpoint = proplists:get_value(authorization_endpoint, PropList, undefined),
jwks_uri = proplists:get_value(jwks_uri, PropList, undefined),
ssl_options = extract_ssl_options_as_list(maps:from_list(
proplists:get_value(https, PropList, [])))
ssl_options = extract_ssl_options_as_list(maps:from_list(proplists:get_value(https, PropList, [])))
}.

View File

@ -463,8 +463,14 @@ build_https_oauth_provider(CaCertFile) ->
}.
oauth_provider_to_proplist(#oauth_provider{ issuer = Issuer, token_endpoint = TokenEndpoint,
ssl_options = SslOptions, jwks_uri = Jwks_url}) ->
[ { issuer, Issuer}, {token_endpoint, TokenEndpoint},
{ https, SslOptions}, {jwks_url, Jwks_url} ].
[ { issuer, Issuer},
{token_endpoint, TokenEndpoint},
{ https,
case SslOptions of
undefined -> [];
Value -> Value
end},
{jwks_url, Jwks_url} ].
start_http_oauth_server(Port, Expectations) when is_list(Expectations) ->
Dispatch = cowboy_router:compile([