Mercurial > prosody-modules
annotate mod_s2s_auth_compat/mod_s2s_auth_compat.lua @ 5617:d8622797e315
mod_http_oauth2: Shorten default token validity periods
With refresh tokens, short lifetime for access tokens is not a problem.
The arbitrary choice of one hour seems reasonable. RFC 6749 has it as
example value.
One week for refresh tokens matching the default archive retention
period. This means that a client that remains unused for one week will
have to sign in again. An actively used client will continually push
that forward with each used refresh token.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 24 Jul 2023 01:30:14 +0200 |
parents | 21e81fcb8896 |
children |
rev | line source |
---|---|
944
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
1 -- COMPAT for Openfire sending stream headers without to or from. |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
2 |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
3 module:set_global(); |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
4 |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
5 module:hook("s2s-check-certificate", function(event) |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
6 local session, host = event.session, event.host; |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
7 if not event.host then |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
8 (session.log or module._log)("warn", "Invalid stream header, certificate will not be trusted") |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
9 session.cert_chain_status = "invalid" |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
10 return true |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
11 end |
21e81fcb8896
mod_s2s_auth_compat: Workaround for Openfire doing EXTERNAL without proper stream headers
Kim Alvefur <zash@zash.se>
parents:
diff
changeset
|
12 end, 100); |