Skip to content

files_routes

diapason.mesh.files_routes

File-transfer routes: offer, send, verify, publish.

Spatial Mesh, phase 3 — 25 August 2026. Four routes, one session, and a credential that is NOT the API key: the sending device does not have it.

  • POST /v1/mesh/files/offer — an Ed25519-signed envelope checked by the same verify_payload as presence beacons: seven checks, including revocation. Pairing is durable consent: a TRUSTED peer immediately receives a session without a second click for every file.
  • POST /v1/mesh/files/{id}/chunk — one encrypted chunk authorized by the session token. The signature guards the door; the token guards the hall.
  • POST /v1/mesh/files/{id}/finish — verifies the digest and exposes the file atomically.

The real ceiling on these routes is not a rate but a VOLUME, enforced here: bytes received per session and the number of simultaneous sessions. A request-rate limiter says nothing about body size.

Offre

Bases: BaseModel

A signed file announcement from an already trusted peer.

etat(session_id, request)

Ce qui manque encore — c'est là que vit la reprise.

finir(session_id, request)

Vérifier l'empreinte, puis rendre le fichier visible d'un seul coup.

morceau(session_id, index, request) async

Recevoir un morceau chiffré, à sa place exacte.

offrir(body)

Verify the offer and open a session for that already trusted peer.

reinitialiser_pour_tests()

Vider les sessions — les tests ne doivent pas se contaminer.