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
Co-authored-by: Arnaud Dartois <admin@tordais.cc>
2.0 KiB
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 (
nullinternally and HTTP 502 at the API boundary). - Read the release document with a fixed byte limit before deserialization. Check
Content-Lengthas an early rejection, but enforce the limit while streaming because the header can be missing or incorrect. - Catch
JsonExceptionat 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
- Run
dotnet test tests/Heimdall.Web.Tests/Heimdall.Web.Tests.csproj --no-restorefor malformed HTML, invalid JSON, a valid release document, and the response size limit. - Run the Web project build with the SDK pinned by
global.json. - Run the disposable Compose procedure in
compose-disposable-recipefrom 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. - 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.