feat(signature): add a freshness and coverage policy for incoming signatures

Signature.check_signature_policy/2 requires date or (created) to be
signed and within signature_max_age (2 h) / signature_max_clock_skew
(1 h), and requires a signed, hashed digest for requests with a body.

Based on Akkoma's http_signatures fork (required headers, max_sig_age)
and Mastodon's SignedRequest (clock skew margin).
This commit is contained in:
Lain Soykaf 2026-10-27 21:46:40 +04:00
commit f57e97bf18
No known key found for this signature in database
5 changed files with 234 additions and 0 deletions

View file

@ -373,6 +373,9 @@ config :pleroma, :activitypub,
note_replies_output_limit: 5,
sign_object_fetches: true,
authorized_fetch_mode: false,
signature_policy: :enforce,
signature_max_age: 7200,
signature_max_clock_skew: 3600,
client_api_enabled: false,
anonymize_reporter: false,
anonymize_reporter_local_nickname: ""