You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
validateRegistrationToken() // Validates JWT registration tokens for satellite pairing
241
244
```
242
245
243
246
### Dual Authentication Support
@@ -342,6 +345,44 @@ interface SatelliteContext {
342
345
-**Key Rotation**: New API key generated on each satellite registration
343
346
-**Scope Isolation**: Satellites can only access their own resources and endpoints
344
347
348
+
### Registration Token Authentication
349
+
350
+
For satellite registration security, the system uses specialized JWT-based registration tokens that follow a different security model than regular user authentication.
351
+
352
+
#### Registration Token Middleware
353
+
354
+
The `validateRegistrationToken()` middleware (located in `src/middleware/registrationTokenMiddleware.ts`) provides secure satellite registration through:
355
+
356
+
-**JWT Validation**: Cryptographically signed tokens with HMAC-SHA256
357
+
-**Single-Use Enforcement**: Tokens consumed after successful registration
358
+
-**Scope Validation**: Global vs team token verification
359
+
-**Security Event Logging**: Failed attempts monitored and logged
360
+
361
+
#### Token Format and Usage
362
+
363
+
Registration tokens follow specific prefixes:
364
+
-`deploystack_satellite_global_` for DeployStack-operated satellites
365
+
-`deploystack_satellite_team_` for customer-deployed team satellites
366
+
367
+
Tokens are passed via standard Authorization header: `Bearer deploystack_satellite_*`
368
+
369
+
#### Error Response Pattern
370
+
371
+
Unlike regular authentication errors, registration token failures provide specific instructions:
372
+
373
+
```typescript
374
+
{
375
+
"success": false,
376
+
"error": "registration_token_required",
377
+
"message": "Registration token required in Authorization header",
Registration token authentication is exclusively used for the `/api/satellites/register` endpoint. It should not be used for regular API endpoints, which use the standard authentication methods above.
385
+
345
386
### Team-Aware Permission System
346
387
347
388
For endpoints that operate within team contexts (e.g., `/teams/:teamId/resource`), use the team-aware permission middleware:
0 commit comments