Repository navigation
Conversation
Add a regression test, a Hypothesis property over generated queries and credentials, and an OpenAPI check that no anonymous v2 operation returns a list of households. All three fail against the current route. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GET /v2/households returned complete stored households page by page with no credential, and no client calls it. Remove the route with its response models, query model, service method and paging read. Creating a household and reading one by ID are unchanged; GET /v2/households now reaches the v2 not-found handler. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4032 +/- ##
===========================================
+ Coverage 50.96% 87.78% +36.82%
===========================================
Files 242 258 +16
Lines 14527 15911 +1384
Branches 2334 2614 +280
===========================================
+ Hits 7403 13968 +6565
+ Misses 6501 1277 -5224
- Partials 623 666 +43 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The OpenAPI check skipped any operation that declared security, but the signed-out header carries a UUID the caller generates, so a route that accepts it alone is open to anyone. It also matched only a direct items reference, missing list[HouseholdItem | None], maps and wrapped items. Follow element schemas through references and composition, treat signed-out-header-only alternatives as open, and add positive controls for each list and credential shape. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Delete only the removed name, so the import keeps its existing form. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
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.
Fixes #4031
Summary
GET /v2/households. It returned stored households with their full inputs, page by page, without a credential. Nothing calls it: app-v2 reads households by ID, and a GitHub code search finds no other caller. Its response models, query model, service method and paging read go with it.POST /v2/householdsandGET /v2/households/{household_id}are unchanged. A GET on the collection path now gets the v2 404.hypothesisto the dev extra, with the samepyproject.toml,uv.lockand.gitignorelines as Remove the v1 user routes and keep complete simulation and report results final #4029.What stays open
GET /{country_id}/household/{id}still reads any household by its integer ID without a credential.POST /v2/user-householdswith alegacy_household_idalso returns the v2 ID of that household's copy to any caller, including one with only the signed-out header. app-v2 loads saved and shared households through the v1 route, so closing these needs an app change first.GET /v2/policiesis still an anonymous list. Policies hold parameter values, not household inputs.Testing
masterand pass here:country_id,offset,limit,default_year, extra parameters) and credentials (none, a bearer token, the signed-out header): the collection path never returns household content and never reaches the service, even one that would return a page;HouseholdItem. "Open" means no security requirement, or one met by the signed-out header alone, which the caller generates. A fourth test gives it positive controls for each list and credential shape.scripts/run_quality_guards.py,scripts/export_migration_contracts.py, mypy,ruff format --check .andruff check .pass. Themake testsuite (tests/to_refactor tests/unit tests/contract) passes locally: 3383 tests.Review
A GPT-6.1 Sol review of
877b1e04requested changes. It found that the OpenAPI check skipped routes gated only by the signed-out header and missed composed list items such aslist[HouseholdItem | None];889a072dfixes both, and both of the reviewer's mutants now fail it. It also found the legacy-ID path through/v2/user-households, which predates this PR and is listed above.axiom: n/a: API route removal, no policy change
🤖 Generated with Claude Code