Files
Heimdall/skills/release-api-responses/SKILL.md
T
arnaud.dartois 5bcd4968a8
Heimdall Gitea / Detect CI scope (push) Successful in 4s
Heimdall Gitea / Build and tests (push) Successful in 23m11s
Heimdall Gitea / Publish versioned release (push) Skipped
Heimdall Gitea / Build and scan server image (push) Successful in 8m52s
Heimdall Gitea / Build and scan agent image (push) Successful in 11m34s
Heimdall Gitea / Publish Docker Hub latest tags (push) Successful in 2m31s
Heimdall Gitea / Build and scan NVIDIA Agent image (push) Successful in 20m33s
Heimdall Gitea / CI policy (push) Successful in 1s
Handle invalid JSON from release API safely (HEIMDALL-D2) (#287)
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2026-11-07 19:22:21 +01:00

2.0 KiB

name, description
name description
release-api-responses Safely consume configured Forgejo release manifests in Heimdall Central.

Release API responses

The Central UpdatesController reads a configured Forgejo latest-release endpoint and serves the result to anonymous update checks and authenticated agents. Treat both the JSON document and subsequent release assets as untrusted network input.

Implementation

  • Keep the release endpoint HTTPS-only and preserve its current upstream failure behavior (null internally and HTTP 502 at the API boundary).
  • Read the release document with a fixed byte limit before deserialization. Check Content-Length as an early rejection, but enforce the limit while streaming because the header can be missing or incorrect.
  • Catch JsonException at the provider parsing boundary. Return unavailable data without logging response bodies; do not convert request cancellation into an ordinary provider failure.
  • Keep asset downloads independently bounded and digest-verified. Do not expand this change to provider retries, endpoint configuration, or public response contracts without a separate acceptance requirement.

Acceptance workflow

  1. Run dotnet test tests/Heimdall.Web.Tests/Heimdall.Web.Tests.csproj --no-restore for malformed HTML, invalid JSON, a valid release document, and the response size limit.
  2. Run the Web project build with the SDK pinned by global.json.
  3. Run the disposable Compose procedure in compose-disposable-recipe from the exact changed source. Configure a synthetic HTTPS provider endpoint that can return a valid Forgejo document and an HTML 200 response; probe the public update endpoint and verify valid data succeeds while malformed provider data yields the established 502 response.
  4. Record the unique Compose project, exact built image tag, sanitized HTTP outcomes, teardown verification for containers/volumes/networks, and tag absence in the linked Gitea issue. Never use production provider configuration or credentials.