Skip to content

Add download for a device - #33

Open
siliconwitch wants to merge 3 commits into
mainfrom
dev
Open

siliconwitch wants to merge 3 commits into
mainfrom
dev

Conversation

@siliconwitch

Copy link
Copy Markdown
Member

download <imei> <path> fetches the bundle the server holds for a device through GET /devices/{imei}/files and writes it into a new or empty directory. It never reads the device. A fleet id is refused, because a fleet upload is a shortcut that pushes one bundle to every device and there is nothing fleet-level to return.

Every bundle path is checked before anything is written, so a bad response cannot escape the target directory. The response is decoded under the existing 32 MiB cap.

CGO_ENABLED=0 go build, go vet and go test ./... pass, gofmt -l . prints nothing and go mod tidy changes nothing. No third-party dependency and no version change. Ship after the server route deploys.

Download fetches the bundle the server holds for a device and writes it into a new or empty directory. It never reads the device.
Download accepted only an empty or new directory. It now writes into any directory, lists the bundle files that already exist there, and asks once before replacing them.
The fixture combined each call with its error test, which the coding rules forbid.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant