chore: apply suggestions from code review

Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
This commit is contained in:
zhongwencool 2024-04-25 09:16:53 +08:00 committed by GitHub
parent 4f12d45436
commit 2a2da3766e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 4 deletions

View File

@ -528,9 +528,9 @@ find_password_hash(hash, User = #{<<"password_hash">> := PasswordHash}, _) ->
find_password_hash(plain, #{<<"password">> := Password}, Algorithm) ->
emqx_authn_password_hashing:hash(Algorithm, Password);
find_password_hash(hash, _User, _) ->
error("hash_import_required_password_hash_field");
error("hash_import_requires_password_hash_field");
find_password_hash(plain, _User, _Algorithm) ->
error("plain_import_required_password_field");
error("plain_import_requires_password_field");
find_password_hash(_, _, _) ->
error(bad_format).

View File

@ -230,7 +230,7 @@ t_import_users(_) ->
),
%% import plain.json with hash method
?assertEqual(
{error, "hash_import_required_password_hash_field"},
{error, "hash_import_requires_password_hash_field"},
emqx_authn_mnesia:import_users(
sample_filename_and_data(hash, <<"user-credentials-plain.json">>),
State
@ -299,7 +299,7 @@ t_import_users_plain(_) ->
),
%% import hash.json with plain method
?assertEqual(
{error, "plain_import_required_password_field"},
{error, "plain_import_requires_password_field"},
emqx_authn_mnesia:import_users(
sample_filename_and_data(plain, <<"user-credentials.json">>),
State