Skip to content

docs: address 0.17.0 pre-release review - #424

Merged
uniqueg merged 17 commits into
devfrom
docs/prr-0.17-fixes
Oct 23, 2026
Merged

uniqueg merged 17 commits into
devfrom
docs/prr-0.17-fixes

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Summary

Fixes findings of the 0.17.0 pre-release review (closes #417 by hand after merge, as dev is not the default branch).

  • Recipe "Requiring login for reads" (medium add .gitignore #1): the overlay gave every authenticated user GET on /api/*, which also allows owner-only reads and permission listings. Now one rule per read that the patch protects (/api/items, /api/items/:id), with a warning about wildcard objects; tests/test_recipes.py checks that a protected read stays 403 for other users (and that /api/* does allow it, as warned).
  • Deployment guide (medium Add Travis CI config #3): "lists are replaced" now explains named entries for api.specs and security.access_control.policies, links to the named-entries section and mentions the startup error when an overlay switches a list to named entries.
  • Migration notes (medium add Travis CI config #4): new docs/migration-0.17.md (images without setuptools/wheel; chart 0.2.0 upgrade checklist; one-time loss of queued broker tasks on the Deployment to StatefulSet switch; claim lifecycle on uninstall, rollback and changes; grant_role() semantics; named entries, patches, Gateway API, supply chain verification, citation; dependency floors; MongoDB persistence of feat(chart): add persistence settings for MongoDB #422; the breaking change of configured policies of fix(access-control)!: replace policies atomically #423), linked from the changelog, the docs navigation, the docs index and the README.
  • Lows:
    • Helm null across values files documented in helm-chart.md (Values); the sentence in configuration/index.md points there.
    • Image scan claim in deployment.md reworded: the published images are rebuilt, not the scanned builds. A real fix (scan by digest before signing) is larger and left for a follow-up.
    • Dependency floors raised, with advisories checked against OSV: pymongo>=4.18.2 (CVE-2026-88029, CVE-2026-96747, CVE-2026-96748, CVE-2026-96749), requests>=2.33.0 (CVE-2026-25645), Werkzeug>=3.1.9 (CVE-2026-27199, CVE-2026-102598).
    • Credentials of persisted databases and brokers: pointer in deployment.md, user-name rotation of the bundled RabbitMQ in helm-chart.md.
    • Both petstore examples use named specs and policies (README table with the rule names).
    • Inline patches with the chart documented; "unpublished until its first release" text updated.
    • scan.yml takes the image from the variable DOCKERHUB_ORG (default elixircloud) and GITHUB_REPOSITORY (scheduled runs have no event payload).
    • Stale _broker.tpl comment; the disable_auth warning logs the spec label.
    • MANIFEST.in prunes .semgrep/, .ast-grep/ and sgconfig.yml (from ci: add semgrep and ast-grep rules #416); checked with python -m build --sdist.
    • Sourcery: broker passwords are passed to rabbitmqctl via standard input, not as arguments.

Verification

  • ruff check, ruff format --check, mypy: pass.
  • coverage run -m pytest (Python 3.13, MongoDB on port 12345): 1808 passed (after merging dev), coverage 100%.
  • Lowest direct dependencies (uv pip install --resolution lowest-direct -e .[dev], Python 3.11, resolves pymongo 4.18.2, requests 2.33.0, Werkzeug 3.1.9): 1744 passed, 1 skipped.
  • mkdocs build --strict: no warnings.
  • pre-commit run --all-files: pass before merging ci: add semgrep and ast-grep rules #416; afterwards ast-grep scan and ast-grep test pass, the semgrep hook could not be installed locally (proxy), so semgrep runs in CI only.
  • Helm v3.22.1: helm lint --strict of the library and the petstore chart with all CI values, pytest charts/foca-common/tests: 193 passed (after merging dev).
  • Not run locally: Docker builds, docker-compose integration tests, kind installs (no Docker socket).
  • CI (before the last merge of dev): all checks pass (unit tests on Python 3.11 to 3.14 with MongoDB 7.0 and 8.0, lowest dependencies, lint/type-check/docs/build, image scans, integration tests, chart lint/tests and kind install, Read the Docs, Codecov).

Declined review findings

  • Use one mechanism (secret or variable) for DOCKERHUB_ORG in all workflows: the weekly scan needs no secrets, so it uses the variable; docs/contributing.md and the workflow comment explain the difference.
  • Read the recipe overlay from the docs in the test: a comment asks to keep both in sync instead, as the test uses its own spec and names.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 11 commits October 23, 2026 03:06
The recipe allowed GET on /api/* for any authenticated user, which also
allows owner-only reads and permission listings. Give one rule per read
that the patch protects, warn about wildcard objects, and test that a
protected read stays 403 for other users (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
pymongo>=4.18.2 (CVE-2026-88029, CVE-2026-96747, CVE-2026-96748,
CVE-2026-96749), requests>=2.33.0 (CVE-2026-25645) and Werkzeug>=3.1.9
(CVE-2026-27199, CVE-2026-102598), as checked against OSV (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Name the spec as other startup logs do, i.e., by its name if it has
one, instead of listing its paths (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The weekly scan hard-coded elixircloud/foca; use the repository
variable DOCKERHUB_ORG (default elixircloud) and the repository name,
so that forks scan their own images (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Documented named overlays failed on the list-form examples; give their
specs and policies as named entries, as the app template does (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Images without setuptools and wheel, chart 0.2.0 upgrade checklist,
broker StatefulSet and claim lifecycle, grant_role() semantics, new
features and dependency floors; linked from the changelog, the docs
navigation and the README (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- deployment: named entries instead of "lists are replaced" for specs
  and policies; credentials of persisted databases and brokers; what
  the image scans cover.
- chart: null across values files, inline patches, publication on GHCR,
  user name rotation of the bundled broker, first upgrade loses queued
  tasks; fix a stale template comment (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Scheduled runs have no event payload, so github.event.repository.name
is empty there; take the name from GITHUB_REPOSITORY. Document that
the scan takes the organization from a variable, the publishing
workflows from a secret (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mention result-backend when renaming the broker user, reflow a
paragraph, keep the pymongo comment above its line, and build the
recipe test's path parameter per use (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Mention the result-backend key when changing the broker password, too,
and reflow the user name paragraph (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@sourcery-ai

sourcery-ai Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR addresses the 0.17.0 pre-release review by narrowing the access-control recipe, adding and cross-linking migration and deployment guidance, making examples overlay-friendly through named entries, improving scheduled image-scan portability, and updating dependency and operational documentation with targeted tests.

Sequence diagram for named configuration overlay merging

sequenceDiagram
    participant BaseConfig
    participant Overlay
    participant FOCA
    participant App
    BaseConfig->>FOCA: load_config()
    Overlay->>FOCA: merge named api.specs and policies
    FOCA->>FOCA: validate_config()
    alt named entries are compatible
        FOCA->>App: start with merged configuration
    else overlay switches a non-empty list to named entries
        FOCA-->>App: refuse to start
    end
Loading

Sequence diagram for narrowed authenticated read access

sequenceDiagram
    actor User
    participant API
    participant AccessControl
    User->>API: GET /api/items/:id
    API->>AccessControl: authorize GET /api/items/:id
    AccessControl-->>API: allow authenticated user
    API-->>User: 200 response
    User->>API: GET /api/items/:id/permissions
    API->>AccessControl: authorize GET /api/items/:id/permissions
    AccessControl-->>API: deny without owner role
    API-->>User: 403 response
Loading

File-Level Changes

Change Details Files
Tighten the login-for-reads recipe so overlays grant access only to the operations they protect, with explicit coverage for owner-only reads.
  • Replace the broad API wildcard policy with separate collection and item-read policies.
  • Document wildcard-object risks and path-segment matching.
  • Add regression tests for protected reads, safe recipe behavior, and intentionally permissive wildcard behavior.
docs/access-control.md
tests/test_recipes.py
Add comprehensive 0.17.0 migration guidance and connect it throughout the documentation.
  • Document image dependency changes, Helm 0.2.0 upgrade steps, broker migration and persistence lifecycle, ownership-helper semantics, named entries, patches, Gateway API, supply-chain verification, citation, and dependency floors.
  • Link the migration guide from the changelog, README, documentation navigation, and index.
  • Clarify named-list replacement behavior, Helm null handling, inline patches, credential rotation, and image scanning claims.
docs/migration-0.17.md
docs/changelog.md
docs/index.md
README.md
docs/configuration/index.md
docs/deployment.md
docs/helm-chart.md
docs/contributing.md
Convert both petstore examples to named specifications and access-control policies for overlay-friendly configuration.
  • Assign stable names to specs and policy rules.
  • Update example documentation and configuration comments to explain per-entry overlays.
examples/petstore/config.yaml
examples/petstore-access-control/config.yaml
examples/petstore-access-control/README.md
Update release-image scanning to resolve the Docker Hub organization and repository dynamically.
  • Use the DOCKERHUB_ORG repository variable with an elixircloud default.
  • Derive the image repository from GITHUB_REPOSITORY for scheduled runs.
.github/workflows/scan.yml
Raise vulnerable dependency floors and make small operational and logging corrections.
  • Raise pymongo, requests, and Werkzeug minimum versions.
  • Update the broker template comment for StatefulSet usage.
  • Log the OpenAPI spec label in the disable_auth warning and extend its test coverage.
pyproject.toml
charts/foca-common/templates/_broker.tpl
foca/api/register_openapi.py
tests/api/test_register_openapi.py

Possibly linked issues


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (600b8cb) to head (d7b7f89).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #424   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           27        27           
  Lines         2869      2869           
=========================================
  Hits          2869      2869           
Flag Coverage Δ
test_unit 100.00% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@uniqueg
uniqueg marked this pull request as ready for review October 23, 2026 01:50

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/helm-chart.md" line_range="576" />
<code_context>
+
+    ```bash
+    kubectl exec statefulset/my-app-broker -- \
+        rabbitmqctl add_user my-app-2 "${password}"
+    kubectl exec statefulset/my-app-broker -- \
+        rabbitmqctl set_permissions -p / my-app-2 ".*" ".*" ".*"
</code_context>
<issue_to_address>
**Broker password enters audit logs**

When an operator runs the username-rotation command and process listings or Kubernetes exec audit records are accessible to other readers, `kubectl exec` passes the expanded `${password}` to `rabbitmqctl add_user` as a command-line argument, exposing the credential in process listings and Kubernetes exec audit records to readers who lack Secret access.

Use a supported mechanism that supplies the password through stdin or a protected file instead of a command-line argument.
</issue_to_address>

Sourcery assessment

Approval pending. 1 finding to address first.

Blocking findings: docs/helm-chart.md:576


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/helm-chart.md Resolved
uniqueg and others added 3 commits October 23, 2026 03:59
rabbitmqctl reads the password from standard input if it is not given,
so that it does not show up in process listings and Kubernetes exec
audit logs (Sourcery review of #424).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Cover mongodb.persistence of foca-common 0.2.0 (#422): replacing
volumeSize in app charts and deployments, and keeping the claim when
switching to an existing claim (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

uniqueg and others added 3 commits October 23, 2026 04:06
The semgrep and ast-grep rules (with deliberately insecure test
fixtures) and sgconfig.yml are not needed to build or test the package
(#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Breaking change of #423: stored configured rules are removed when
policies is not set; atomic replacement, shared collections, rules of
the permissions API, rolling updates and downgrades (#417).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit 29af8a6 into dev Oct 23, 2026
23 checks passed
@uniqueg
uniqueg deleted the docs/prr-0.17-fixes branch October 23, 2026 02:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant