chore: apply suggestions from code review
Co-authored-by: Zaiming (Stone) Shi <zmstone@gmail.com>
This commit is contained in:
parent
4f12d45436
commit
2a2da3766e
|
@ -528,9 +528,9 @@ find_password_hash(hash, User = #{<<"password_hash">> := PasswordHash}, _) ->
|
||||||
find_password_hash(plain, #{<<"password">> := Password}, Algorithm) ->
|
find_password_hash(plain, #{<<"password">> := Password}, Algorithm) ->
|
||||||
emqx_authn_password_hashing:hash(Algorithm, Password);
|
emqx_authn_password_hashing:hash(Algorithm, Password);
|
||||||
find_password_hash(hash, _User, _) ->
|
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) ->
|
find_password_hash(plain, _User, _Algorithm) ->
|
||||||
error("plain_import_required_password_field");
|
error("plain_import_requires_password_field");
|
||||||
find_password_hash(_, _, _) ->
|
find_password_hash(_, _, _) ->
|
||||||
error(bad_format).
|
error(bad_format).
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ t_import_users(_) ->
|
||||||
),
|
),
|
||||||
%% import plain.json with hash method
|
%% import plain.json with hash method
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
{error, "hash_import_required_password_hash_field"},
|
{error, "hash_import_requires_password_hash_field"},
|
||||||
emqx_authn_mnesia:import_users(
|
emqx_authn_mnesia:import_users(
|
||||||
sample_filename_and_data(hash, <<"user-credentials-plain.json">>),
|
sample_filename_and_data(hash, <<"user-credentials-plain.json">>),
|
||||||
State
|
State
|
||||||
|
@ -299,7 +299,7 @@ t_import_users_plain(_) ->
|
||||||
),
|
),
|
||||||
%% import hash.json with plain method
|
%% import hash.json with plain method
|
||||||
?assertEqual(
|
?assertEqual(
|
||||||
{error, "plain_import_required_password_field"},
|
{error, "plain_import_requires_password_field"},
|
||||||
emqx_authn_mnesia:import_users(
|
emqx_authn_mnesia:import_users(
|
||||||
sample_filename_and_data(plain, <<"user-credentials.json">>),
|
sample_filename_and_data(plain, <<"user-credentials.json">>),
|
||||||
State
|
State
|
||||||
|
|
Loading…
Reference in New Issue