%%%----------------------------------------------------------------------
%%% API
%%%----------------------------------------------------------------------
-start(_Host) -> ok.
+start(Host) ->
+ case ejabberd_option:jwt_key(Host) of
+ undefined ->
+ ?ERROR_MSG("Option jwt_key is not configured for ~s: "
+ "JWT authentication won't work", [Host]);
+ _ ->
+ ok
+ end.
stop(_Host) -> ok.
include_config_file(Host) ->
ejabberd_config:get_option({include_config_file, Host}).
--spec jwt_key() -> jose_jwk:key().
+-spec jwt_key() -> jose_jwk:key() | 'undefined'.
jwt_key() ->
jwt_key(global).
--spec jwt_key(global | binary()) -> jose_jwk:key().
+-spec jwt_key(global | binary()) -> jose_jwk:key() | 'undefined'.
jwt_key(Host) ->
ejabberd_config:get_option({jwt_key, Host}).
{shaper, #{atom() => ejabberd_shaper:shaper_rate()}} |
{shaper_rules, [{atom(), [ejabberd_shaper:shaper_rule()]}]} |
{api_permissions, [ejabberd_access_permissions:permission()]} |
- {jwt_key, jose_jwk:key()} |
+ {jwt_key, jose_jwk:key() | undefined} |
{append_host_config, [{binary(), any()}]} |
{host_config, [{binary(), any()}]} |
{define_macro, any()} |
{websocket_origin, []},
{websocket_ping_interval, timer:seconds(60)},
{websocket_timeout, timer:minutes(5)},
- {jwt_key, <<"">>}].
+ {jwt_key, undefined}].
-spec globals() -> [atom()].
globals() ->