Auth fetch verification (cavage) works now
All checks were successful
/ docker (push) Successful in 4m14s

- Verifying inbound requests signed with Cavage are now checked as
  expected
- Fixed a bug where the signature header is not generated correctly
- Extended config to include settings for what requests to verify
- Fixed new server in main not using internal port from config
This commit is contained in:
Melody Becker 2025-04-22 15:27:24 +02:00
parent 271acc8d29
commit 627926460c
Signed by: mstar
SSH key fingerprint: SHA256:9VAo09aaVNTWKzPW7Hq2LW+ox9OdwmTSHRoD4mlz1yI
8 changed files with 90 additions and 36 deletions

View file

@ -6,6 +6,7 @@ import (
webutils "git.mstar.dev/mstar/goutils/http"
"git.mstar.dev/mstar/linstrom/config"
"git.mstar.dev/mstar/linstrom/web/public/api/activitypub"
webmiddleware "git.mstar.dev/mstar/linstrom/web/public/middleware"
)
@ -18,7 +19,10 @@ func BuildApiRouter() http.Handler {
"/activitypub",
webutils.ChainMiddlewares(
activitypub.BuildActivitypubRouter(),
webmiddleware.BuildAuthorizedFetchCheck(true, true),
webmiddleware.BuildAuthorizedFetchCheck(
config.GlobalConfig.Admin.AuthFetchForNonGet,
config.GlobalConfig.Admin.AuthFetchForGet,
),
),
),
)