Skip to content

Commit 622c0e2

Browse files
authored
docs: correct setup-code expiry contract (#965)
1 parent 053501c commit 622c0e2

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎docs/gateway-node-integration.md‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@ explicit gateway policy matching the node's advertised commands.
207207

208208
1. Calls `issueDeviceBootstrapToken()` on the gateway
209209
2. Generates a **short-lived, single-use** `bootstrapToken`
210-
3. Encodes `{ url, bootstrapToken, expiresAtMs }` as base64url
210+
3. Encodes `{ url, urls?, bootstrapToken }` as base64url. The gateway enforces
211+
the 10-minute token lifetime; the payload does not include expiry metadata.
211212
4. Renders as QR code or pasteable setup code
212213

213214
### 4.2 bootstrapToken vs gateway.auth.token
@@ -238,7 +239,7 @@ The setup code and QR code are the same bootstrap concept in different packaging
238239
QR image
239240
-> decodes to setup code text
240241
-> decodes to JSON payload
241-
-> contains gateway URL + bootstrapToken + expiry
242+
-> contains gateway URL(s) + bootstrapToken
242243
```
243244

244245
Advanced users can drop into setup at any level:
@@ -255,7 +256,8 @@ The QR/setup-code path is preferred for first-time node onboarding because it av
255256

256257
The Windows Setup Wizard:
257258
1. Accepts a QR image, clipboard QR image, pasteable setup code, or manual gateway URL/token.
258-
2. For QR/setup-code input, decodes `{ url, bootstrapToken, expiresAtMs }`.
259+
2. For QR/setup-code input, decodes `{ url, bootstrapToken }`; the optional
260+
upstream `urls` fallback list is not used by the current decoder.
259261
3. Stores `bootstrapToken` in the active `GatewayRecord.BootstrapToken`; manual long-lived tokens are stored as `GatewayRecord.SharedGatewayToken`.
260262
4. Sends it as `auth.bootstrapToken` in the node connect handshake.
261263

@@ -279,7 +281,7 @@ Windows stores `hello-ok.auth.deviceToken` in the per-gateway device identity fi
279281
```
280282
1. User runs `openclaw qr` on gateway host
281283
2. User imports/scans QR image or pastes setup code into Windows Setup Wizard
282-
3. Wizard decodes → { url, bootstrapToken, expiresAtMs }
284+
3. Wizard decodes → { url, bootstrapToken }
283285
4. Node connects with: auth: { bootstrapToken: "<token>" }
284286
5. Gateway auto-approves pairing (bootstrap-token auth method)
285287
6. Gateway returns hello-ok with: auth: { deviceToken: "<token>" }
@@ -355,7 +357,6 @@ After changing either `gateway.nodes.allowCommands` or `gateway.nodes.denyComman
355357
- [x] Handle `hello-ok.auth.deviceToken` — save it for future connections
356358
- [x] Accept QR images and clipboard setup content as alternate ways to enter the same bootstrap payload
357359
- [x] Show "auto-paired!" vs "waiting for approval" based on auth method
358-
- [x] Handle bootstrap token expiry gracefully when setup code payloads include expiry metadata (`expiresAt`, `expires_at`, `expires`, `expiry`, or `exp`)
359360
- [x] Add Settings toggles for optional Windows node capability groups (`canvas`, `screen`, `camera`, `location`, `browser.proxy`)
360361

361362
### 5.4 Upstream Alignment

0 commit comments

Comments
 (0)