Pin non-development startup refusal and no-CORS posture (#9) #56
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
primatekuntech/rag-rust!56
Loading…
Reference in a new issue
No description provided.
Delete branch "test/9-startup-cors"
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?
Refs #9 (F04). Test-only; no production code changes.
An acceptance audit of the M1 issues found two small gaps against #9's criteria. This PR closes them:
startup_refuses_an_unset_or_non_development_environmentruns the realrag-apibinary withRAG_ENVunset,production,stagingand empty. Each must exit non-zero with the "production identity startup" message, before any configuration or database access.cross_origin_requests_get_no_cors_grantsends a preflight and anOriginGET to the public health router. Neither response may carry anyaccess-control-*header.Limits
main.rsand are not exercised, so a CORS layer added only there would not be caught. The test comment says this.Verification
cargo test -p rag-api --locked --test startup --test cors: 4 passedcargo fmtandcargo clippy -p rag-api --all-targets -- -D warnings: cleanbash scripts/coverage.sh rust): 93.61% line coverage (minimum 80%), unchanged3facfd6; correctness pass found no Critical or Important issues🤖 Generated with Claude Code