fix(saml): cert files cleanup when destroy
This commit is contained in:
parent
80a6c1150d
commit
1dddccb448
|
|
@ -29,6 +29,8 @@
|
||||||
|
|
||||||
-dialyzer({nowarn_function, create/1}).
|
-dialyzer({nowarn_function, create/1}).
|
||||||
|
|
||||||
|
-define(DIR, <<"saml_sp_certs">>).
|
||||||
|
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
%% Hocon Schema
|
%% Hocon Schema
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
|
|
@ -148,6 +150,7 @@ update(Config0, State) ->
|
||||||
create(Config0).
|
create(Config0).
|
||||||
|
|
||||||
destroy(_State) ->
|
destroy(_State) ->
|
||||||
|
_ = file:del_dir_r(emqx_tls_lib:pem_dir(?DIR)),
|
||||||
_ = application:stop(esaml),
|
_ = application:stop(esaml),
|
||||||
ok.
|
ok.
|
||||||
|
|
||||||
|
|
@ -201,8 +204,6 @@ do_validate_assertion(SP, DuplicateFun, Body) ->
|
||||||
%% Internal functions
|
%% Internal functions
|
||||||
%%------------------------------------------------------------------------------
|
%%------------------------------------------------------------------------------
|
||||||
|
|
||||||
-define(DIR, <<"SAML_SSO_sp_certs">>).
|
|
||||||
|
|
||||||
ensure_cert_and_key(#{sp_public_key := Cert, sp_private_key := Key} = Config) ->
|
ensure_cert_and_key(#{sp_public_key := Cert, sp_private_key := Key} = Config) ->
|
||||||
case
|
case
|
||||||
emqx_tls_lib:ensure_ssl_files(
|
emqx_tls_lib:ensure_ssl_files(
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue