diff --git a/apps/emqx_authentication/include/emqx_authentication.hrl b/apps/emqx_authentication/include/emqx_authentication.hrl index 9fe8f58d2..09d3c5fc4 100644 --- a/apps/emqx_authentication/include/emqx_authentication.hrl +++ b/apps/emqx_authentication/include/emqx_authentication.hrl @@ -36,6 +36,6 @@ -record(chain, { id :: chain_id() - , services :: [#service{}] + , services :: [{service_name(), #service{}}] , created_at :: integer() }). diff --git a/apps/emqx_authentication/src/emqx_authentication_jwt.erl b/apps/emqx_authentication/src/emqx_authentication_jwt.erl index 45c8cd429..2b8024e1c 100644 --- a/apps/emqx_authentication/src/emqx_authentication_jwt.erl +++ b/apps/emqx_authentication/src/emqx_authentication_jwt.erl @@ -131,7 +131,7 @@ authenticate(ClientInfo = #{password := JWT}, #{jwk := JWK, destroy(#{jwks_connector := undefined}) -> ok; destroy(#{jwks_connector := Connector}) -> - emqx_authentication_jwks_connector:stop(Connector), + _ = emqx_authentication_jwks_connector:stop(Connector), ok. %%-------------------------------------------------------------------- @@ -171,7 +171,7 @@ do_create(#{use_jwks := true} = Opts) -> do_update(Opts, #{jwk_connector := undefined}) -> do_create(Opts); do_update(#{use_jwks := false} = Opts, #{jwk_connector := Connector}) -> - emqx_authentication_jwks_connector:stop(Connector), + _ = emqx_authentication_jwks_connector:stop(Connector), do_create(Opts); do_update(#{use_jwks := true} = Opts, #{jwk_connector := Connector} = State) -> ok = emqx_authentication_jwks_connector:update(Connector, Opts), diff --git a/apps/emqx_authentication/src/emqx_authentication_mnesia.erl b/apps/emqx_authentication/src/emqx_authentication_mnesia.erl index 626ec27b7..53dc4dd73 100644 --- a/apps/emqx_authentication/src/emqx_authentication_mnesia.erl +++ b/apps/emqx_authentication/src/emqx_authentication_mnesia.erl @@ -119,8 +119,8 @@ authenticate(ClientInfo = #{password := Password}, destroy(#{user_group := UserGroup}) -> trans( fun() -> - MatchSpec = [{#user_info{user_id = {UserGroup, '_'}, _ = '_'}, [], ['$_']}], - lists:foreach(fun delete_user2/1, mnesia:select(?TAB, MatchSpec, write)) + MatchSpec = [{{user_info, {UserGroup, '_'}, '_', '_'}, [], ['$_']}], + ok = lists:foreach(fun delete_user2/1, mnesia:select(?TAB, MatchSpec, write)) end). import_users(Filename0, State) -> @@ -211,7 +211,7 @@ import_users_from_csv(Filename, #{user_group := UserGroup}) -> case get_csv_header(File) of {ok, Seq} -> Result = trans(fun import/3, [UserGroup, File, Seq]), - file:close(File), + _ = file:close(File), Result; {error, Reason} -> {error, Reason}