fix(saml): cert files cleanup when destroy

This commit is contained in:
JimMoen 2023-09-22 22:49:08 +08:00
parent 80a6c1150d
commit 1dddccb448
No known key found for this signature in database
GPG Key ID: 87A520B4F76BA86D
1 changed files with 3 additions and 2 deletions

View File

@ -29,6 +29,8 @@
-dialyzer({nowarn_function, create/1}).
-define(DIR, <<"saml_sp_certs">>).
%%------------------------------------------------------------------------------
%% Hocon Schema
%%------------------------------------------------------------------------------
@ -148,6 +150,7 @@ update(Config0, State) ->
create(Config0).
destroy(_State) ->
_ = file:del_dir_r(emqx_tls_lib:pem_dir(?DIR)),
_ = application:stop(esaml),
ok.
@ -201,8 +204,6 @@ do_validate_assertion(SP, DuplicateFun, Body) ->
%% Internal functions
%%------------------------------------------------------------------------------
-define(DIR, <<"SAML_SSO_sp_certs">>).
ensure_cert_and_key(#{sp_public_key := Cert, sp_private_key := Key} = Config) ->
case
emqx_tls_lib:ensure_ssl_files(