Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions mod_unified_push/src/mod_unified_push.erl
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,7 @@ get_jwk(Host) ->

-spec mod_opt_type(atom()) -> econf:validator().
mod_opt_type(expiration) ->
%% TODO is there an upper bound for the validity of the JWT token?
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR and sorry for being a buzzkill, but I would rather not drop this TODO (or any of the other TODOs) without giving an answer in the commit message or related pull request.

econf:int(0, 86400); %% 60 * 60 * 24
econf:int(0, 5184000); %% 86400 * 60
mod_opt_type(jwk) ->
econf:map(econf:binary(), econf:either(econf:binary(), econf:int()));
mod_opt_type(push_url) ->
Expand All @@ -248,7 +247,7 @@ mod_opt_type(push_url) ->
-spec mod_options(binary()) -> [{atom(), any()}].
mod_options(_Host) ->
[
{expiration, 60 * 15},
{expiration, 86400 * 7},
{jwk, jose_jwk:to_map(jose_jwk:generate_key({oct, 128}))},
{push_url, <<"auto">>}
].
Expand Down Expand Up @@ -281,7 +280,7 @@ mod_doc() ->
?T(
"Every generated push URL will be valid only "
"for the specified interval, in seconds. "
"The default value is 15 minutes: '900'"
"The default value is 7 days: '604800'"
)
}},
{jwk, #{
Expand Down Expand Up @@ -315,7 +314,7 @@ mod_doc() ->
"",
"modules:",
" mod_unified_push:",
" expiration: 120",
" expiration: 259200",
" jwk: {\"k\" => \"a4-...\",\"kty\" => \"oct\"}"
]
}.