Initial Commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
# Drive Transport HTTPS — Spec Delta (drive-transport-https-port)
|
||||
|
||||
## ADDED Requirements
|
||||
|
||||
### TRANSPORT-HTTPS-01 — DriveTransport contract
|
||||
|
||||
`httpsTransport(options)` MUST return an object satisfying the `DriveTransport` interface from `@suaveplan/drive-mesh`. `advertise` and `onAdvertisement` MUST be no-ops (HTTPS is unidirectional). `peers()` MUST return a single synthetic `PeerInfo` representing the server.
|
||||
|
||||
**Verified by:** `src/transport.spec-conformance.test.ts` (`TRANSPORT-HTTPS-01`).
|
||||
|
||||
### TRANSPORT-HTTPS-02 — Chunk fetch URL and body
|
||||
|
||||
`requestChunk(peerId, fileId, chunkId)` MUST issue `GET <baseUrl>/v1/chunks/<fileId-hex>/<chunkId>` via the injected `fetch` and yield the response body as `AsyncIterable<Uint8Array>`. Response body bytes MUST be passed through unmodified (the chunks plugin's sig-verify will validate them).
|
||||
|
||||
**Verified by:** `src/transport.spec-conformance.test.ts` (`TRANSPORT-HTTPS-02`).
|
||||
|
||||
### TRANSPORT-HTTPS-03 — Range requests for partial reads
|
||||
|
||||
When `requestChunk` is called with a byte range, the transport MUST issue an HTTP `Range: bytes=<start>-<end>` header. Responses with status `206 Partial Content` MUST be honoured.
|
||||
|
||||
**Verified by:** `src/transport.spec-conformance.test.ts` (`TRANSPORT-HTTPS-03`).
|
||||
|
||||
### TRANSPORT-HTTPS-04 — Error code mapping
|
||||
|
||||
HTTP `404` MUST surface as `MeshError(MESH.MANIFEST_FETCH_FAILED)` for manifest endpoints or `MeshError(MESH.NO_PEERS_AVAILABLE)` for chunk endpoints. `5xx` MUST surface as `MeshError(MESH.TRANSPORT_ERROR)`. `401`/`403` MUST surface as `MeshError(MESH.TRANSPORT_ERROR)` with code-string `auth-failed` in the cause.
|
||||
|
||||
**Verified by:** `src/transport.spec-conformance.test.ts` (`TRANSPORT-HTTPS-04`).
|
||||
Reference in New Issue
Block a user