Changeset 834bcc3 in Klonkt for src/routes/federation.js
- Timestamp:
- 06/23/2026 06:14:27 PM (3 months ago)
- Branches:
- main
- Children:
- d774679
- Parents:
- bb42dfb
- File:
-
- 1 edited
-
src/routes/federation.js (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/routes/federation.js
rbb42dfb r834bcc3 1 // routes/federation.js — publi eke Cirkels-endpoints (v1, publicatie-kant).1 // routes/federation.js — public Cirkels endpoints (v1, publication side). 2 2 // 3 // GET /.klonkt/actor.json — ActivityStreams -actor + Ed25519-pubkey4 // GET /.klonkt/outbox.json — publi eke posts als AS Create-objecten,5 // getekend via de Klonkt-Signature-header3 // GET /.klonkt/actor.json — ActivityStreams actor + Ed25519 public key 4 // GET /.klonkt/outbox.json — public posts as AS Create objects, 5 // signed via the Klonkt-Signature header 6 6 // 7 // Site-agnosti sch en zonder auth — alleen lezen. Zie docs/cirkels-v1-spec.md.7 // Site-agnostic and unauthenticated — read-only. See docs/cirkels-v1-spec.md. 8 8 9 9 import express from 'express'; … … 18 18 } 19 19 20 // De proto die de consument zegt te draaien (uit z'n request-header), of0.20 // The proto the consumer claims to be running (from their request header), or 0. 21 21 function consumerProto(req) { 22 22 return parseInt(req.get('Klonkt-Proto') || '0', 10) || 0; … … 24 24 25 25 router.get('/.klonkt/actor.json', (req, res) => { 26 // Cir kels = solo-naar-solo; hubs publiceren geen federatie-actor.26 // Circles = solo-to-solo; hubs do not publish a federation actor. 27 27 if (getTenancy() === 'hub') return res.status(404).type('text/plain').send('Niet beschikbaar in hub-modus'); 28 // De actor serveren we ALTIJD (ook aan oudere consumenten) zodat zij onze proto29 // kunnen lezen en een nette "update vereist"-melding kunnen tonen.28 // We ALWAYS serve the actor (including to older consumers) so they can read our 29 // proto and show a clean "update required" message. 30 30 const body = JSON.stringify(buildActor(baseUrl(req)), null, 2); 31 31 res.type('application/activity+json; charset=utf-8'); … … 38 38 if (getTenancy() === 'hub') return res.status(404).type('text/plain').send('Niet beschikbaar in hub-modus'); 39 39 res.set('Klonkt-Proto', String(KLONKT_PROTO)); 40 // Te-oude consument? Weiger met 426 Upgrade Required (de crypto-binding sluit 'm41 // sowieso al uit; dit geeft een expliciet, leesbaar signaal). proto 0 = geen42 // header (bv. een browser/curl) → toestaan, die verifieert toch niet.40 // Consumer too old? Reject with 426 Upgrade Required (the crypto binding already 41 // excludes them; this gives an explicit, readable signal). proto 0 = no header 42 // (e.g. a browser/curl) → allow, they won't verify anyway. 43 43 const cp = consumerProto(req); 44 44 if (cp && cp < MIN_PROTO) {
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)