fix(dgw): adopt recording file-type helpers - #1946
fix(dgw): adopt recording file-type helpers#1946Krista House (kristahouse) wants to merge 5 commits into
Conversation
Centralize recording extension handling in streaming through RecordingFileType so validation, stream routing, and terminal input selection are derived from a single mapping. Define concrete MIME values for WebM, TRP, Asciicast, and SLOG pull artifacts, and update PullRecordingFile OpenAPI annotations so generated spec output remains aligned with source declarations. Issue: DGW-406 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Let maintainers know that an action is required on their side
|
|
Implementation notes:
Testing:
Breaking changes:
Note Human-tuned, LLM-assisted content. |
There was a problem hiding this comment.
Pull request overview
Centralizes recording file-type handling and aligns download MIME types with the OpenAPI contract.
Changes:
- Adds MIME mappings for all recording formats.
- Routes streaming by
RecordingFileType. - Documents recording response media types and adds tests.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
devolutions-gateway/src/token.rs |
Defines centralized recording MIME mappings. |
devolutions-gateway/src/streaming.rs |
Derives streaming mode and terminal input type from recording type. |
devolutions-gateway/src/api/jrec.rs |
Applies MIME mappings to downloads and OpenAPI annotations. |
devolutions-gateway/openapi/gateway-api.yaml |
Adds generated response media types. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Address PR feedback by declaring application/json in PullRecordingFile response media types, matching routes that can serve recording.json. Regenerate gateway-api.yaml from source annotations to keep generated OpenAPI output synchronized with the contract definition. Issue: DGW-406 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Add a filename-driven streaming regression test that validates routing for .webm/.cast/.trp and rejection for unsupported or missing extensions. Expand recording content-type assertions with a table-driven check that covers supported artifacts and confirms recording.json falls back to ServeFile behavior. Issue: DGW-406 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Benoît Cortier (CBenoit)
left a comment
There was a problem hiding this comment.
Thank you!
Could you also add a streaming.intent.md file along the streaming.rs module and write some human-vetted invariants about the concrete invariants and intentions you encoded when authoring this PR?
Use application/octet-stream for TRP artifacts, make pull content type selection explicit with fallback behavior, and document streamability intent boundaries for /shadow streaming. Also update PullRecordingFile media types and add module-level streaming intent documentation requested in review. Issue: DGW-406 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Remove the redundant introductory sentence from streaming.intent.md so the document starts directly with scope, matching the intent-file convention feedback. Issue: DGW-406 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Follow-up changes requested during review of #1857.
Centralize recording extension handling in streaming through RecordingFileType so validation, stream routing, and terminal input selection are derived from one mapping.
Define explicit MIME mappings for WebM, TRP, Asciicast, and SLOG artifacts, and declare PullRecordingFile response media types in source annotations so generated OpenAPI output remains aligned and stable.
Issue: DGW-406
Co-authored-by: Copilot App 223556219+Copilot@users.noreply.github.com