aboutsummaryrefslogtreecommitdiff
path: root/src/ejabberd_options.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/ejabberd_options.erl')
-rw-r--r--src/ejabberd_options.erl24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/ejabberd_options.erl b/src/ejabberd_options.erl
index d1019dd62..e8b8cb890 100644
--- a/src/ejabberd_options.erl
+++ b/src/ejabberd_options.erl
@@ -1,5 +1,5 @@
%%%----------------------------------------------------------------------
-%%% ejabberd, Copyright (C) 2002-2019 ProcessOne
+%%% ejabberd, Copyright (C) 2002-2020 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public License as
@@ -19,7 +19,7 @@
-module(ejabberd_options).
-behaviour(ejabberd_config).
--export([opt_type/1, options/0, globals/0]).
+-export([opt_type/1, options/0, globals/0, doc/0]).
-ifdef(NEW_SQL_SCHEMA).
-define(USE_NEW_SQL_SCHEMA_DEFAULT, true).
@@ -62,6 +62,21 @@ opt_type(auth_cache_size) ->
econf:pos_int(infinity);
opt_type(auth_method) ->
econf:list_or_single(econf:db_type(ejabberd_auth));
+opt_type(auth_opts) ->
+ fun(L) when is_list(L) ->
+ lists:map(
+ fun({host, V}) when is_binary(V) ->
+ {host, V};
+ ({connection_pool_size, V}) when is_integer(V) ->
+ {connection_pool_size, V};
+ ({connection_opts, V}) when is_list(V) ->
+ {connection_opts, V};
+ ({basic_auth, V}) when is_binary(V) ->
+ {basic_auth, V};
+ ({path_prefix, V}) when is_binary(V) ->
+ {path_prefix, V}
+ end, L)
+ end;
opt_type(auth_password_format) ->
econf:enum([plain, scram]);
opt_type(auth_use_cache) ->
@@ -443,6 +458,7 @@ opt_type(jwt_auth_only_rule) ->
{disable_sasl_mechanisms, [binary()]} |
{s2s_zlib, boolean()} |
{loglevel, ejabberd_logger:loglevel()} |
+ {auth_opts, [{any(), any()}]} |
{listen, [ejabberd_listener:listener()]} |
{modules, [{module(), gen_mod:opts(), integer()}]} |
{ldap_uids, [{binary(), binary()}]} |
@@ -493,6 +509,7 @@ options() ->
fun(Host) -> ejabberd_config:get_option({cache_size, Host}) end},
{auth_method,
fun(Host) -> [ejabberd_config:default_db(Host, ejabberd_auth)] end},
+ {auth_opts, []},
{auth_password_format, plain},
{auth_use_cache,
fun(Host) -> ejabberd_config:get_option({use_cache, Host}) end},
@@ -730,6 +747,9 @@ globals() ->
websocket_ping_interval,
websocket_timeout].
+doc() ->
+ ejabberd_options_doc:doc().
+
%%%===================================================================
%%% Internal functions
%%%===================================================================