Skip to content

func-api-devices-backup-get ​

Description ​

Retrieves the stored encrypted configuration backup for a device. Returns the raw FFCE-format ciphertext blob from S3. The caller (the FireFly Controller firmware) decrypts the blob on-device with key_backup (HKDF-derived from the eFuse master key with label firefly-backup-v1) and writes the plaintext to backup.json on the config file system.

This endpoint has no Cognito JWT authorizer — it is authenticated solely by the device's cryptographic signature.

Invocation ​

Invoked by API Gateway on an HTTP GET /devices/{uuid}/backup request (no JWT authorizer).

Sequence Diagram ​

Sequence Diagram

API Endpoints ​

MethodPathAuthDescription
GET/devices/{uuid}/backupDevice signature (headers)Retrieve encrypted configuration backup

Request Headers ​

HeaderRequiredDescription
X-Device-UUIDYesMust match the {uuid} path parameter
X-Device-NonceYesBase64-encoded 32-byte random nonce
X-Device-TimestampYesISO 8601 UTC timestamp (e.g. 2025-05-09T12:00:00Z)
X-Device-SignatureYesBase64-encoded DER ECDSA P-256 signature over SHA-256(nonce || timestamp)

Response Body ​

Raw FFCE-format encrypted binary blob (base64-encoded in the Lambda response body; decoded by API Gateway before delivery). The Content-Type header is application/octet-stream.

Response Codes ​

CodeReason
200 OKBackup retrieved successfully
400 Bad RequestMissing/invalid headers or invalid Base64
401 UnauthorizedDevice UUID not found, signature invalid, or timestamp outside the acceptance window
403 ForbiddenX-Device-UUID header does not match {uuid} path parameter
404 Not FoundNo backup exists for this device
500 Internal Server ErrorUnhandled exception

See the API Reference for full schema documentation.

Deployment ​

See the deployment workflow documentation for workflow steps, infrastructure dependencies, and failure scenarios.