feat: Update policy server implementation to match latest spec #1487

Merged
nex merged 17 commits from nex/feat/policy-servers-2-electric-boogaloo into main 2026-05-25 17:48:17 +00:00

17 commits

Author SHA1 Message Date
b771b9d160
style: Fix typo
Some checks failed
Checks / Prek / Check changed files (pull_request) Successful in 8s
Documentation / Build and Deploy Documentation (pull_request) Successful in 1m20s
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 10s
Checks / Prek / Clippy and Cargo Tests (pull_request) Successful in 8m59s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 21m14s
Checks / Prek / Check changed files (push) Successful in 32s
Documentation / Build and Deploy Documentation (push) Successful in 1m15s
Checks / Prek / Pre-commit & Formatting (push) Successful in 1m31s
Checks / Prek / Clippy and Cargo Tests (push) Successful in 8m36s
Release Docker Image / Build linux-arm64 (release) (push) Successful in 56m31s
Release Docker Image / Build linux-amd64 (release) (push) Successful in 57m29s
Release Docker Image / Create Multi-arch Release Manifest (push) Successful in 10m0s
Release Docker Image / Create Max-Perf Manifest (push) Has been cancelled
Release Docker Image / Release Binaries (push) Has been cancelled
Release Docker Image / Mirror Images (push) Has been cancelled
Release Docker Image / Build linux-arm64 (max-perf) (push) Has been cancelled
Release Docker Image / Build linux-amd64 (max-perf) (push) Has been cancelled
2026-05-25 18:26:48 +01:00
eb829c2951
fix: Ensure event_id is correctly stripped before verifying policy server signature
Some checks failed
Checks / Changelog / Check changelog is added (pull_request_target) Successful in 7s
Checks / Prek / Pre-commit & Formatting (pull_request) Successful in 1m41s
Checks / Prek / Check changed files (pull_request) Successful in 8s
Checks / Prek / Clippy and Cargo Tests (pull_request) Has been cancelled
Documentation / Build and Deploy Documentation (pull_request) Has been cancelled
2026-05-25 18:20:57 +01:00
d32b39181a
fix: Don't return early if the policy server does something stupid
Spec compliance is for nerds I guess
2026-05-25 18:17:41 +01:00
72b99a1f84
style: Reformat 2026-05-25 18:17:40 +01:00
ae37f218a2
perf: Avoid cloning incoming PDUs to check them
Also allows us to store signatures on PDUs received over federation that we got a fresh signature for
2026-05-25 18:17:29 +01:00
40cecca103
feat: Add extract_signature helper 2026-05-25 18:17:13 +01:00
2a80a82f74
style: Document functions 2026-05-25 18:17:13 +01:00
fbf4eac2dc
fix: Ensure event_id is removed before policy-checking event 2026-05-25 18:17:13 +01:00
4784010702
fix: Ensure policy server signed with the correct key 2026-05-25 18:17:13 +01:00
1c88854a54
feat: Enable shutdown interrupt in ratelimit handler 2026-05-25 18:17:12 +01:00
e0fe71c708
feat: Follow spec more closely, code clean up, use ruma request type 2026-05-25 18:17:12 +01:00
0f0dcb4f58
fix: Return Forbidden instead of internal error when PS doesn't sign 2026-05-25 18:17:12 +01:00
367c42ad28
fix: Treat malformed policy config events as missing 2026-05-25 18:17:12 +01:00
c8e0f7ebd3
style: Reformat 2026-05-25 18:17:10 +01:00
fdc9aec534
fix: Verify policy server signatures on all events, not just timeline ones
style: Clarifications

style: Clippy
2026-05-25 18:16:55 +01:00
5f9cc83b18
feat: Support advertising a policy server public key in well-known
# Conflicts:
#	src/api/client/well_known.rs
#	src/core/config/mod.rs
2026-05-25 18:14:58 +01:00
47051af392
feat: Update policy server implementation to be closer to latest spec
Untested

chore: Add news fragment

feat: Support stable policy servers

feat: Don't attempt erroneous loopback federation for policy server checks

refactor: Update PS upgrade to use new ruma

fix: Only check loopback via after attempting incoming verification
2026-05-25 18:14:54 +01:00