Repository navigation
Port the service skeleton from standalone: config, logger, errors, gin router, container (T16) - #20
Merged
Merged
Conversation
RyazanovAlexander
commented
Oct 16, 2026
Contributor
- cmd/server: signals, errgroup, one report per failure, a stop during the start exits 0; the port is bound before the startup line.
- internal/config: viper over declared CANVAS_* variables only; CANVAS_ENV local by default and prod-only where K_SERVICE is set; the shutdown budget shared between drain and close.
- internal/logger, internal/apierror: Cloud Run keys; flat {code, message} with optional details.
- internal/transport/http: gin router, /health on GET and HEAD, 404 and 405 as apierror, LastResort, SecurityHeaders, RequestID (X-Request-Id), request log and panic recovery.
- internal/app: hand-written container closing in reverse order, also on a start that fails halfway; the server with its drain.
- Terraform sets CANVAS_ENV=prod; spec 8.3 and 15.4; .env.example, launch.json, THIRD_PARTY_LICENSES; RUN.md T16 done.
…n router, container (T16)
- cmd/server: signals, errgroup, one report per failure, a stop during the
start exits 0; the port is bound before the startup line.
- internal/config: viper over declared CANVAS_* variables only; CANVAS_ENV
local by default and prod-only where K_SERVICE is set; the shutdown budget
shared between drain and close.
- internal/logger, internal/apierror: Cloud Run keys; flat {code, message}
with optional details.
- internal/transport/http: gin router, /health on GET and HEAD, 404 and 405
as apierror, LastResort, SecurityHeaders, RequestID (X-Request-Id),
request log and panic recovery.
- internal/app: hand-written container closing in reverse order, also on a
start that fails halfway; the server with its drain.
- Terraform sets CANVAS_ENV=prod; spec 8.3 and 15.4; .env.example,
launch.json, THIRD_PARTY_LICENSES; RUN.md T16 done.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01U1MCDC5QUpgX5xmPSJYn5W
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… a closed set (T16, PR review) CodeQL flagged the request log and the last-resort line as carrying user input: the client's X-Request-Id and the request's method. No client of the service needs its id kept, so the header is no longer read; the method is written as one of the service's own words. Recorded as R68. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U1MCDC5QUpgX5xmPSJYn5W
CodeQL's gin model treats Context.FullPath as user input, so the four go/log-injection alerts stayed after the id and the method were fixed. The route is now written as a pattern from the table of routes the router registered, read once at the first request; the probe filter uses the same name. R68 and RUN.md say so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U1MCDC5QUpgX5xmPSJYn5W
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


