Changeset d0cab9d in Klonkt
- Timestamp:
- 06/24/2026 03:59:47 PM (3 months ago)
- Branches:
- main
- Children:
- f5c3870
- Parents:
- 00f669b
- File:
-
- 1 edited
-
src/services/ActivityPubService.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
src/services/ActivityPubService.js
r00f669b rd0cab9d 358 358 const type = act.type; 359 359 const base = (process.env.PUBLIC_BASE_URL || `${req.protocol}://${req.get('host')}`).replace(/\/+$/, ''); 360 const verified = await verifyRequest(req).catch(() => null); // best-effort; not gating (MVP) 360 const verified = await verifyRequest(req).catch(() => null); 361 362 // ENFORCE HTTP signatures: a data-affecting activity must be signed by the very 363 // actor it claims to be. No valid signature, or signer ≠ actor → reject (no 364 // forged replies/likes/follows/timeline posts). GET/discovery stays open. 365 const claimedActor = typeof act.actor === 'string' ? act.actor : (act.actor && act.actor.id); 366 const GATED = ['Create', 'Like', 'Announce', 'Follow', 'Delete', 'Undo', 'Accept', 'Reject']; 367 if (GATED.includes(type)) { 368 if (!verified || !claimedActor || verified.id !== claimedActor) { 369 console.warn('[AP] inbox REJECTED (signature)', type, claimedActor || '?', verified ? '(signer mismatch)' : '(unsigned/invalid)'); 370 return 401; 371 } 372 } 361 373 362 374 if (type === 'Follow') {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)