Skip to content

Commit aa221a9

Browse files
Clean up ct:log statements
WIP address a dialyzer error
1 parent 28576a6 commit aa221a9

File tree

2 files changed

+8
-24
lines changed

2 files changed

+8
-24
lines changed

deps/oauth2_client/src/oauth2_client.erl

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@
99
refresh_access_token/2,
1010
get_oauth_provider/1, get_oauth_provider/2,
1111
get_openid_configuration/2,
12-
build_openid_discovery_endpoint/3, build_openid_discovery_endpoint/1,
13-
build_openid_discovery_endpoint/2,
12+
build_openid_discovery_endpoint/3,
1413
merge_openid_configuration/2,
1514
merge_oauth_provider/2,
1615
extract_ssl_options_as_list/1,
@@ -49,17 +48,6 @@ refresh_access_token(OAuthProvider, Request) ->
4948
append_paths(Path1, Path2) ->
5049
erlang:iolist_to_binary([Path1, Path2]).
5150

52-
-spec build_openid_discovery_endpoint(Issuer :: uri_string:uri_string())
53-
-> uri_string:uri_string().
54-
build_openid_discovery_endpoint(Issuer) ->
55-
build_openid_discovery_endpoint(Issuer, undefined, undefined).
56-
57-
-spec build_openid_discovery_endpoint(Issuer :: uri_string:uri_string(),
58-
OpenIdConfigurationPath :: uri_string:uri_string() | undefined)
59-
-> uri_string:uri_string().
60-
build_openid_discovery_endpoint(Issuer, OpenIdConfigurationPath) ->
61-
build_openid_discovery_endpoint(Issuer, OpenIdConfigurationPath, undefined).
62-
6351
-spec build_openid_discovery_endpoint(Issuer :: uri_string:uri_string(),
6452
OpenIdConfigurationPath :: uri_string:uri_string() | undefined,
6553
Params :: query_list()) -> uri_string:uri_string().
@@ -72,8 +60,6 @@ build_openid_discovery_endpoint(Issuer, OpenIdConfigurationPath, Params) ->
7260
OpenIdPath = ensure_leading_path_separator(OpenIdConfigurationPath),
7361
URLMap1 = URLMap0#{
7462
path := case maps:get(path, URLMap0) of
75-
"/" -> OpenIdPath;
76-
"" -> OpenIdPath;
7763
[] -> OpenIdPath;
7864
P -> append_paths(drop_trailing_path_separator(P), OpenIdPath)
7965
end

deps/oauth2_client/test/system_SUITE.erl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@
1212

1313
-include_lib("oauth2_client.hrl").
1414
-import(oauth2_client, [
15-
build_openid_discovery_endpoint/1,
16-
build_openid_discovery_endpoint/2]).
15+
build_openid_discovery_endpoint/3]).
1716

1817
-compile(export_all).
1918

@@ -150,7 +149,6 @@ init_per_group(_, Config) ->
150149
get_http_oauth_server_expectations(TestCase, Config) ->
151150
case ?config(TestCase, Config) of
152151
undefined ->
153-
ct:log("get_openid_configuration_http_expectation : ~p", [get_openid_configuration_http_expectation(TestCase)]),
154152
[ {token_endpoint, build_http_mock_behaviour(build_http_access_token_request(),
155153
build_http_200_access_token_response())},
156154
{get_openid_configuration, get_openid_configuration_http_expectation(TestCase)}
@@ -247,7 +245,6 @@ init_per_testcase(TestCase, Config) ->
247245

248246
case ?config(group, Config) of
249247
https ->
250-
ct:log("Start https with expectations ~p", [ListOfExpectations]),
251248
start_https_oauth_server(?AUTH_PORT, ?config(rmq_certsdir, Config),
252249
ListOfExpectations);
253250
_ ->
@@ -280,6 +277,12 @@ end_per_group(with_default_oauth_provider, Config) ->
280277
end_per_group(_, Config) ->
281278
Config.
282279

280+
build_openid_discovery_endpoint(Issuer) ->
281+
build_openid_discovery_endpoint(Issuer, undefined, undefined).
282+
283+
build_openid_discovery_endpoint(Issuer, Path) ->
284+
build_openid_discovery_endpoint(Issuer, Path, undefined).
285+
283286
get_openid_configuration(Config) ->
284287
ExpectedOAuthProvider = ?config(oauth_provider, Config),
285288
SslOptions = [{ssl, ExpectedOAuthProvider#oauth_provider.ssl_options}],
@@ -468,7 +471,6 @@ verify_get_oauth_provider_returns_default_oauth_provider(DefaultOAuthProviderId)
468471
{ok, OAuthProvider2} =
469472
oauth2_client:get_oauth_provider(DefaultOAuthProviderId,
470473
[issuer, token_endpoint, jwks_uri]),
471-
ct:log("verify_get_oauth_provider_returns_default_oauth_provider ~p vs ~p", [OAuthProvider1, OAuthProvider2]),
472474
?assertEqual(OAuthProvider1, OAuthProvider2).
473475

474476
get_oauth_provider(Config) ->
@@ -622,8 +624,6 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
622624
{'_', [{Path, oauth_http_mock, Expected} || #{request := #{path := Path}}
623625
= Expected <- Expectations ]}
624626
]),
625-
ct:log("start_https_oauth_server with expectation list : ~p -> dispatch: ~p",
626-
[Expectations, Dispatch]),
627627
{ok, _} = cowboy:start_tls(
628628
mock_http_auth_listener,
629629
[{port, Port},
@@ -634,8 +634,6 @@ start_https_oauth_server(Port, CertsDir, Expectations) when is_list(Expectations
634634

635635
start_https_oauth_server(Port, CertsDir, #{request := #{path := Path}} = Expected) ->
636636
Dispatch = cowboy_router:compile([{'_', [{Path, oauth_http_mock, Expected}]}]),
637-
ct:log("start_https_oauth_server with expectation : ~p -> dispatch: ~p",
638-
[Expected, Dispatch]),
639637
{ok, _} = cowboy:start_tls(
640638
mock_http_auth_listener,
641639
[{port, Port},

0 commit comments

Comments
 (0)