feat(api): harden the app and add deploy + e2e (M7) #72
No reviewers
Labels
No labels
area:backend
area:frontend
area:infra
area:ocr
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
phase:M1
phase:M2
phase:M3
phase:M4
phase:M5
phase:M6
phase:M7
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
TJC/bill-splitter!72
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/m7-hardening"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Test plan
Code review (medium effort) - fixes applied
Committed to this branch:
RateLimiting.cs): endpoint matching was ordinal, but ASP.NET routing is case-insensitive -GET /api/v1/Codes/ABCDEFreached the endpoint yet skipped the resolve buckets (10/min + 100/day), andPOST /api/v1/Sessionsdodged the 5/hour create cap. Now matched case-insensitively.Program.cs): unmatched/apiand/hubsGETs fell through toindex.html(200) in prod instead of 404. Added narrower fallbacks.Program.cs): the transport body cap read a duplicated10MBliteral; now derived fromSessionOptions.MaxUploadBytesso it cannot diverge from the per-image check.ForwardedHeadersConfiguration.cs):Enabled=truewith noKnownProxies/KnownNetworkstrusted nobody and collapsed every client onto the proxy IP (one shared bucket). Now fails fast at startup.ImageDimensions.cs): standalone 2-byte markers (TEM, RSTn, SOI/EOI) advanced the offset by 1, false-rejecting an otherwise valid header. Fixed;docs/04now records the dimension trigger for the 413.verify-ephemerality.sh): an unreachable redis/minio read as0and the gate printed PASS having verified nothing;dbsize+set -enow abort loudly.Dockerfile): now runs as the image's non-root user.Follow-ups (not fixed here)
minio-initmasksmc ilm rule addfailure with|| true; exit 0, so the 1-day expiry backstop can silently fail to install - needs an idempotent-but-loud install; skipped to avoid breaking redeploy idempotency untested.TRUSTED_PROXY_NETWORK=172.16.0.0/12trusts the whole Docker bridge; a co-located container (e.g. the OCR sidecar) could spoofX-Forwarded-For. Scope to the proxy's address in real deployments.connect-src 'self' wss:- the barewss:is broader than needed (SignalR is same-origin);'self'should cover it.Verified:
dotnet buildclean, scriptbash -nclean. Integration/e2e are CI-only in this devcontainer.