Repository navigation
fix: close small pre-release review gaps - #522
Merged
Merged
Conversation
ipaddress.is_global is True for the deprecated site-local range fec0::/10, so the SSRF guard of GuardedClient treated such addresses as public. Reject them explicitly. Part of #516 Co-Authored-By: Claude Opus 5.5 <[email protected]>
The root .dockerignore excluded only examples/, so local files such as foca/.env or __pycache__ directories went into the published base image. Allow only the files docker/Dockerfile copies, and exclude .env files (except .env.example) and bytecode inside them. Part of #516 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Since #454, running apps ignore rules changed in the database directly until they restart. Recommend the permissions API (or group mappings for the first admin) in the petstore-access-control example, and say that direct database edits need a restart. Part of #516 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Files copied by docker/Dockerfile must also be allowed in .dockerignore. Part of #516 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's GuideCloses pre-release review gaps by hardening IPv6 SSRF checks, isolating Docker builds from unintended local files with an allowlisted context, and correcting petstore access-control administration guidance. Sequence diagram for guarded public-address validationsequenceDiagram
participant GuardedClient
participant is_public_address
participant ipaddress
GuardedClient->>is_public_address: is_public_address(address)
is_public_address->>ipaddress: address.is_site_local
alt IPv6 site-local address
is_public_address-->>GuardedClient: False
else Other address
is_public_address->>ipaddress: address.is_global
is_public_address-->>GuardedClient: is_global and not multicast
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #522 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 55 55
Lines 6609 6611 +2
=========================================
+ Hits 6609 6611 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
uniqueg
marked this pull request as ready for review
October 26, 2026 17:48
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.
Summary
Small findings of the v0.18.0 pre-release review:
is_public_address()(and thusGuardedClient) now rejects IPv6 site-local addresses (fec0::/10), whichipaddress.is_globalreports as globally reachable. Regression test added;docs/utilities.mdupdated..dockerignoreis now an allowlist of the filesdocker/Dockerfilecopies (pyproject.toml,MANIFEST.in,README.md,LICENSE,foca/), and excludes.env*(except.env.example),__pycache__and bytecode inside them, so local files can't end up in the published base image. The Dockerfile points to the allowlist.Closes #516
Verification
pytest tests/utils/test_http.py: the new casefec0::1failed before the fix, 70 passed after.coverage run -m pytest -m "not mongodb"): 2789 passed, 1 skipped, 100% coverage. MongoDB-marked tests not run locally (no mongod); the change doesn't touch them, CI runs them.ruff check,ruff format --check,mypy,ast-grep scan,semgrep scan --config .semgrep --error,mkdocs build --strict: all pass..dockerignore: no Docker daemon available locally. Checked with an emulation of Docker's matching rules (allowlisted files included;foca/.env,foca/**/.env.local,__pycache__,.git,docs/,tests/excluded;foca/.env.exampleincluded), and built a wheel from only the allowlisted files (uv build --wheel, OK). The CI image builds verify it for real.Declined review findings
__pycache__/bytecode patterns duplicateMANIFEST.in'sglobal-exclude. Kept: the build context is a separate boundary from the sdist, and the reviewer also suggested keeping them.🤖 Generated with Claude Code
Summary by Sourcery
Close pre-release security, container build-context, and access-control documentation gaps.
Bug Fixes:
Build:
Documentation:
Tests: