From 8a65626225c0facf47f5af153d96ca2283dff2c7 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Sun, 16 Nov 2025 22:04:12 +0100 Subject: [PATCH] Update README with secret field documentation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Document secret parameter in POST /offers endpoint - Document secret parameter in POST /offers/:offerId/answer endpoint - Document hasSecret flag in GET /offers/by-topic response - Add Protected Offers feature to features list 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- README.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e64383d..7391c97 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ Scalable peer-to-peer connection establishment with topic-based discovery, state - **Topic-Based Discovery**: Tag offers with topics (e.g., torrent infohashes) for efficient peer finding - **Stateless Authentication**: AES-256-GCM encrypted credentials, no server-side sessions +- **Protected Offers**: Optional secret field for access-controlled peer connections - **Bloom Filters**: Client-side peer exclusion for efficient discovery - **Multi-Offer Support**: Create multiple offers per peer simultaneously - **Complete WebRTC Signaling**: Offer/answer exchange and ICE candidate relay @@ -95,7 +96,8 @@ Find offers by topic with optional bloom filter exclusion "sdp": "v=0...", "topics": ["movie-xyz", "hd-content"], "expiresAt": 1234567890, - "lastSeen": 1234567890 + "lastSeen": 1234567890, + "hasSecret": true // Indicates if secret is required to answer } ], "total": 42, @@ -103,6 +105,9 @@ Find offers by topic with optional bloom filter exclusion } ``` +**Notes:** +- `hasSecret`: Boolean flag indicating whether a secret is required to answer this offer. The actual secret is never exposed in public endpoints. + #### `GET /peers/:peerId/offers` View all offers from a specific peer @@ -120,12 +125,16 @@ Create one or more offers { "sdp": "v=0...", "topics": ["movie-xyz", "hd-content"], - "ttl": 300000 + "ttl": 300000, + "secret": "my-secret-password" // Optional: protect offer (max 128 chars) } ] } ``` +**Notes:** +- `secret` (optional): Protect the offer with a secret. Answerers must provide the correct secret to connect. + #### `GET /offers/mine` List all offers owned by authenticated peer @@ -141,10 +150,14 @@ Answer an offer (locks it to answerer) **Request:** ```json { - "sdp": "v=0..." + "sdp": "v=0...", + "secret": "my-secret-password" // Required if offer is protected } ``` +**Notes:** +- `secret` (optional): Required if the offer was created with a secret. Must match the offer's secret. + #### `GET /offers/answers` Poll for answers to your offers