Preview Artifact Metadata
const url = 'https://example.com/api/firmware/preview-artifact';const form = new FormData();form.append('file', 'file');
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/firmware/preview-artifact \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form file=@filePreview metadata from an OTA-Pulse artifact without saving it.
This endpoint reads the artifact metadata (artifact_name, device_types) from an artifact file and returns it to help auto-fill upload forms.
The file is saved temporarily and deleted after reading.
GC-BE-10: the body is parsed with streaming_multipart straight from
request.stream() (like the two upload routes) instead of a
file: UploadFile = File(...) parameter. FastAPI resolves that
parameter by parsing the WHOLE multipart body — before the auth
dependency, before any size check — into a spooled temp file, so an
unauthenticated caller could make this process buffer an arbitrarily
large body. Now authentication runs first (the body is untouched on a
401/403), an oversize Content-Length is refused before a byte is
read, and the size cap is enforced as the bytes stream in (the partial
temp file is unlinked on every failure path).
Authorizations
Section titled “ Authorizations ”Request Bodyrequired
Section titled “ Request Bodyrequired ”object
Responses
Section titled “ Responses ”Successful Response
Example generated
example