diff options
author | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-27 15:22:27 +0300 |
---|---|---|
committer | Evgeny Khramtsov <ekhramtsov@process-one.net> | 2019-06-27 15:22:27 +0300 |
commit | 39cf8d86d62defcbeba5e6935c8b19ee3df1dd76 (patch) | |
tree | 0db2a22a394752d0532afc1fff5a988947326513 /src/ejabberd_auth.erl | |
parent | Use correct rr_type() (diff) |
Avoid using broad map() type wherever possible
Diffstat (limited to 'src/ejabberd_auth.erl')
-rw-r--r-- | src/ejabberd_auth.erl | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/ejabberd_auth.erl b/src/ejabberd_auth.erl index 33e0d118..fff63e81 100644 --- a/src/ejabberd_auth.erl +++ b/src/ejabberd_auth.erl @@ -53,8 +53,9 @@ -define(SALT_LENGTH, 16). --record(state, {host_modules = #{} :: map()}). +-record(state, {host_modules = #{} :: host_modules()}). +-type host_modules() :: #{binary => [module()]}. -type password() :: binary() | #scram{}. -type digest_fun() :: fun((binary()) -> binary()). -export_type([password/0]). @@ -751,7 +752,7 @@ password_to_scram(Password, IterationCount) -> %%%---------------------------------------------------------------------- %%% Cache stuff %%%---------------------------------------------------------------------- --spec init_cache(map()) -> ok. +-spec init_cache(host_modules()) -> ok. init_cache(HostModules) -> CacheOpts = cache_opts(), {True, False} = use_cache(HostModules), @@ -771,7 +772,7 @@ cache_opts() -> LifeTime = ejabberd_option:auth_cache_life_time(), [{max_size, MaxSize}, {cache_missed, CacheMissed}, {life_time, LifeTime}]. --spec use_cache(map()) -> {True :: [module()], False :: [module()]}. +-spec use_cache(host_modules()) -> {True :: [module()], False :: [module()]}. use_cache(HostModules) -> {Enabled, Disabled} = maps:fold( |