Skip to content

Commit e447350

Browse files
MarcialRosalesmichaelklishin
authored andcommitted
Remove obsolete function
1 parent 374efe9 commit e447350

File tree

2 files changed

+1
-55
lines changed

2 files changed

+1
-55
lines changed
Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,6 @@
11
-module(uaa_jwks).
2-
-export([get/2, ssl_options/1]).
2+
-export([get/2]).
33

44
-spec get(string() | binary(), term()) -> {ok, term()} | {error, term()}.
55
get(JwksUrl, KeyConfig) ->
66
httpc:request(get, {JwksUrl, []}, [{ssl, ssl_options(KeyConfig)}, {timeout, 60000}], []).
7-
8-
-spec ssl_options(term()) -> list().
9-
ssl_options(KeyConfig) ->
10-
PeerVerification = proplists:get_value(peer_verification, KeyConfig, verify_none),
11-
Depth = proplists:get_value(depth, KeyConfig, 10),
12-
FailIfNoPeerCert = proplists:get_value(fail_if_no_peer_cert, KeyConfig, false),
13-
CrlCheck = proplists:get_value(crl_check, KeyConfig, false),
14-
SslOpts0 = [{verify, PeerVerification},
15-
{depth, Depth},
16-
{fail_if_no_peer_cert, FailIfNoPeerCert},
17-
{crl_check, CrlCheck},
18-
{crl_cache, {ssl_crl_cache, {internal, [{http, 10000}]}}} | cacertfile(KeyConfig)],
19-
20-
case proplists:get_value(hostname_verification, KeyConfig, none) of
21-
wildcard ->
22-
[{customize_hostname_check, [{match_fun, public_key:pkix_verify_hostname_match_fun(https)}]} | SslOpts0];
23-
none ->
24-
SslOpts0
25-
end.
26-
27-
cacertfile(KeyConfig) ->
28-
case proplists:get_value(cacertfile, KeyConfig) of
29-
undefined -> [];
30-
CaCertFile -> [{cacertfile, CaCertFile}]
31-
end.

deps/rabbitmq_auth_backend_oauth2/test/unit_SUITE.erl

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ all() ->
3737
test_post_process_payload_rich_auth_request_using_regular_expression_with_cluster,
3838
test_unsuccessful_access_with_a_token_that_uses_missing_scope_alias_in_scope_field,
3939
test_unsuccessful_access_with_a_token_that_uses_missing_scope_alias_in_extra_scope_source_field,
40-
test_default_ssl_options,
41-
test_default_ssl_options_with_cacertfile,
4240
test_username_from,
4341
{group, with_rabbitmq_node}
4442
].
@@ -125,10 +123,6 @@ init_per_testcase(test_post_process_payload_rich_auth_request_using_regular_expr
125123
application:set_env(rabbitmq_auth_backend_oauth2, resource_server_id, <<"rabbitmq-test">>),
126124
Config;
127125

128-
init_per_testcase(test_default_ssl_options_with_cacertfile, Config) ->
129-
application:set_env(rabbitmq_auth_backend_oauth2, key_config, [{ cacertfile, filename:join(["testca", "cacert.pem"]) }] ),
130-
Config;
131-
132126
init_per_testcase(_, Config) ->
133127
Config.
134128

@@ -137,10 +131,6 @@ end_per_testcase(test_post_process_token_payload_complex_claims, Config) ->
137131
application:set_env(rabbitmq_auth_backend_oauth2, resource_server_id, undefined),
138132
Config;
139133

140-
end_per_testcase(test_default_ssl_options_with_cacertfile, Config) ->
141-
application:set_env(rabbitmq_auth_backend_oauth2, key_config, undefined),
142-
Config;
143-
144134
end_per_testcase(_, Config) ->
145135
Config.
146136

@@ -1331,25 +1321,6 @@ test_validate_payload_when_verify_aud_false(_) ->
13311321
<<"scope">> => [<<"bar">>, <<"other.third">>]}},
13321322
rabbit_auth_backend_oauth2:validate_payload(?RESOURCE_SERVER_ID, WithAudWithUnknownResourceId, ?DEFAULT_SCOPE_PREFIX)).
13331323

1334-
test_default_ssl_options(_) ->
1335-
?assertEqual([
1336-
{verify, verify_none},
1337-
{depth, 10},
1338-
{fail_if_no_peer_cert, false},
1339-
{crl_check, false},
1340-
{crl_cache, {ssl_crl_cache, {internal, [{http, 10000}]}}}
1341-
], uaa_jwks:ssl_options(rabbit_oauth2_config:get_key_config())).
1342-
1343-
test_default_ssl_options_with_cacertfile(_) ->
1344-
?assertEqual([
1345-
{verify, verify_none},
1346-
{depth, 10},
1347-
{fail_if_no_peer_cert, false},
1348-
{crl_check, false},
1349-
{crl_cache, {ssl_crl_cache, {internal, [{http, 10000}]}}},
1350-
{cacertfile, filename:join(["testca", "cacert.pem"])}
1351-
], uaa_jwks:ssl_options(rabbit_oauth2_config:get_key_config())).
1352-
13531324
%%
13541325
%% Helpers
13551326
%%

0 commit comments

Comments
 (0)