Changeset e61c289 in Klonkt for src/routes


Ignore:
Timestamp:
07/24/2026 05:03:34 PM (7 weeks ago)
Author:
Robin Genis <roboburr@…>
Branches:
main
Children:
318d0c2
Parents:
6b5d7da
Message:

Guardian-queues als C2S-routes + push-typen help/guardian

De drie shaer:queues-collecties uit het actor-doc zijn nu echte owner-only
routes (Bearer, zelfde patroon als /blocked): offers, follows (leeg tot
gated follows bestaan) en wards. Contract gelijk aan de Shaer test-daemon,
dus de iOS/Android-dashboards lezen ze ongewijzigd.

Web-push kent twee nieuwe alert-typen: 'help' (hulpvraag van een ward,
niet gethrottled, standaard aan) en 'guardian' (adoptieverkeer). Teksten in
nl/en/de.

Changed files:
src/routes/activitypub.js

  • GET /ap/users/:slug/queues/{offers,follows,wards}, owner-only

src/services/PushService.js

  • alert-typen help + guardian (defaults aan, throttle 0/30s)

src/services/i18n.js

  • push.n_help_*, push.n_guard_* in nl/en/de

New file:
test/guardianship.test.js

  • pint het module-oppervlak: actor-props, handshake C2S+S2S beide kanten, queue-shapes, ward-mag-niet-guarden, helpRequest-props

-robo
Co-Authored-By: Claude Opus 4.8 <noreply@…>

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/routes/activitypub.js

    r6b5d7da re61c289  
    1919import { apEnabled } from '../services/SettingsService.js';
    2020import OAuth from '../services/OAuthService.js';
     21import * as Guardianship from '../services/guardianship/index.js';
    2122import multer from 'multer';
    2223import path from 'path';
     
    108109  });
    109110});
     111
     112// ── Guardian queues (owner only, FEP-633c, shaer:queues) ──────────
     113// The dashboard collections the Shaer clients read: pending adoption offers,
     114// gated follows (empty in Klonkt for now) and the guardian's wards. Same
     115// contract as the Shaer test daemon.
     116function queueRoute(name, build) {
     117  router.get(`/ap/users/:slug/queues/${name}`, (req, res) => {
     118    const auth = OAuth.verifyBearer(req.headers.authorization);
     119    if (!auth || auth.site.slug !== req.params.slug) return res.status(403).end();
     120    const base = baseUrl(req);
     121    const me = `${base}/ap/users/${auth.site.slug}`;
     122    AP.sendAP(res, { '@context': AP.AP_CONTEXT, ...build(`${me}/queues/${name}`, auth.site.slug, me) });
     123  });
     124}
     125queueRoute('offers', (id, slug, me) => Guardianship.offersCollection(id, slug, me));
     126queueRoute('follows', (id) => Guardianship.followsCollection(id));
     127queueRoute('wards', (id, slug) => Guardianship.wardsCollection(id, slug));
    110128
    111129// ── Inbox read (owner only, AP C2S) ───────────────────────────────
Note: See TracChangeset for help on using the changeset viewer.