Skip to content

docs: complete the 0.18 migration guide - #531

Merged
uniqueg merged 4 commits into
devfrom
docs/migration-0.18
Oct 26, 2026
Merged

uniqueg merged 4 commits into
devfrom
docs/migration-0.18

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 26, 2026 •

Copy link
Copy Markdown
Member

Summary

Completes the 0.18 migration guide and the docs entry points, written after #515, #517, #518 and #519 were fixed (PRs #521, #525, #526, #527), so that they match the final behaviour.

docs/migration-0.18.md:

  • Intro: mentions gateway plugins, opt-in roles and the guarded HTTP client, and the new breaking cases.
  • Breaking changes: Section plugins validated (PluginsConfig, extra="forbid", also for apps that are no gateways); Gateway plugins (Foca(gateway=...), refusal of middlewares/custom.middlewares, one gateway app per process incl. the Celery worker note, client pipelines off by default, authenticated callers only, and where policy steps belong).
  • Other changes: Opt-in roles (feat(access-control): add opt-in roles #508: opt_in_roles, opt_in_header, startup errors, 400 from the permissions API, warning on stored rules, Vary, CORS); Guarded HTTP client and dependencies (GuardedClient, urllib3>=2.6,<3, packaging>=23); Image build contexts (allowlist .dockerignore files, fix: keep local files out of example images #513 and fix: close small pre-release review gaps #516).
  • "Group settings that cannot apply": an issuer's own claim_groups also satisfies the check (feat(auth): add per-issuer settings #514); same note in docs/configuration/access-control.md.

Also: README.md and docs/index.md link the 0.18 guide (0.17 in the chain); the README feature list (also the docs index synopsis) mentions gateway plugins and the guarded HTTP client; docs/plugins.md says the plugins section must be valid in apps that are no gateways, too.

Closes #523

Light lane: docs only (no code, config or CI changes); I reviewed the diff myself against the code (foca/models/config.py, foca/plugins/, foca/config/config_parser.py, register_access_control.py).

Verification

  • mkdocs build --strict (with anchor validation): passes.
  • pytest -m "not mongodb": 2822 passed, 1 skipped.
  • CI: all checks passed (26 pass, 3 intended skips).

🤖 Generated with Claude Code

Summary by Sourcery

Complete the 0.18 migration documentation and update documentation entry points to reflect the finalized release behavior.

Enhancements:

  • Complete the 0.18 migration guide with the finalized gateway plugin, opt-in role, guarded HTTP client, configuration validation, and image build context changes.
  • Clarify group settings behavior when group claims are defined by trusted issuers.
  • Document gateway plugin behavior, migration requirements, and per-request pipeline policies.

Documentation:

  • Update README and documentation entry points to link to the 0.18 migration guide and highlight gateway plugins and the guarded HTTP client.
  • Clarify that the plugins configuration is validated for non-gateway applications as well.

Add the missing sections: the validated top-level plugins section,
gateway plugins (Foca(gateway=...), refused middleware keys, one
gateway app per process, client pipelines off by default), opt-in
roles, GuardedClient and the new direct dependencies, and the
allowlisted image build contexts. Note that an issuer's claim_groups
satisfies the group claim check. Link the 0.18 guide from the README
and the docs index, and list gateway plugins and the guarded HTTP
client among the features.

Closes #523

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg added this to the v0.18.0 milestone Oct 26, 2026
@sourcery-ai

sourcery-ai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This documentation-only PR completes the 0.18 migration guide against the final implementation, covering plugin and gateway breaking changes plus opt-in roles, guarded HTTP requests, dependencies, and Docker build contexts. It also updates README/docs navigation and feature summaries so the new guide and capabilities are discoverable.

Sequence diagram for gateway plugin request processing

sequenceDiagram
    participant Client
    participant GatewayApp
    participant PluginEngine
    participant Backend

    Client->>GatewayApp: HTTP request
    GatewayApp->>PluginEngine: process request with plugins.pipeline
    PluginEngine->>Backend: route validated and sanitized request
    Backend-->>PluginEngine: response
    PluginEngine-->>GatewayApp: plugin-processed response
    GatewayApp-->>Client: HTTP response
Loading

Sequence diagram for guarded requests to untrusted URLs

sequenceDiagram
    participant Plugin as GatewayPlugin
    participant GuardedClient
    participant Target

    Plugin->>GuardedClient: request
    GuardedClient->>GuardedClient: validate public address
    GuardedClient->>Target: connect
    GuardedClient->>GuardedClient: check address after connecting
    alt valid response
        Target-->>GuardedClient: response within limits
        GuardedClient-->>Plugin: response
    else redirect or invalid response
        Target-->>GuardedClient: redirect or rejected response
        GuardedClient-->>Plugin: guarded result
    end
Loading

Flow diagram for gateway configuration validation and startup

flowchart TD
    Config["Configuration"] --> PluginsConfig["PluginsConfig validation"]
    PluginsConfig -->|"invalid keys"| ValidationError["ValidationError"]
    PluginsConfig --> GatewayCheck["Gateway app checks"]
    GatewayCheck -->|"middlewares or custom.middlewares"| StartupError["Startup ValueError"]
    GatewayCheck -->|"valid gateway configuration"| LoadPlugins["Load and check plugins"]
    LoadPlugins --> RunningGateway["Running gateway app"]
    PluginsConfig -->|"non-gateway app"| Warning["Warning; no plugins loaded"]
Loading

File-Level Changes

Change Details Files
Completes the 0.18 migration documentation with finalized breaking changes and upgrade guidance for plugin configuration, gateway applications, opt-in roles, guarded HTTP access, and image build contexts.
  • Documents validation and rejection behavior for the top-level plugins configuration, including non-gateway applications.
  • Explains gateway declaration, middleware migration, process-wide gateway constraints, client pipeline controls, authentication requirements, and policy placement.
  • Describes opt-in role configuration, validation, legacy stored-rule behavior, permissions API responses, Vary, and CORS implications.
  • Documents GuardedClient, SSRF protections, new dependency constraints, and Docker build-context allowlists.
  • Updates group-claim startup-check guidance to include trusted issuers.
docs/migration-0.18.md
docs/configuration/access-control.md
Updates documentation entry points and feature summaries to make the 0.18 migration guide and new capabilities discoverable.
  • Changes README and docs index migration links to lead with 0.18 and preserve the prior migration chain.
  • Adds gateway plugin and guarded HTTP client descriptions to the README/docs synopsis.
  • Clarifies that plugins remains validated even for non-gateway apps.
README.md
docs/index.md
docs/plugins.md

Assessment against linked issues

Issue Objective Addressed Explanation
#523 Complete docs/migration-0.18.md with the 0.18 changes and migration guidance: gateway plugin configuration and behavior, validation of the top-level plugins key, opt-in roles, the guarded HTTP client and dependencies, image build-context allowlists, and the updated group-claim startup check. ✅
#523 Update documentation entry points and feature summaries to link to the 0.18 migration guide and mention gateway plugins and the guarded HTTP client. ✅
#523 Clarify that the plugins section must be valid even for apps that are not gateways. ✅

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 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (1b3c20c) to head (e916fba).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #531   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           55        55           
  Lines         6667      6667           
=========================================
  Hits          6667      6667           
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 26, 2026 22:03

@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/migration-0.18.md" line_range="183" />
<code_context>
+  a request (tag `gateway.pipeline`) only if
+  `plugins.client_pipelines.enabled` is `true` (default: `false`), and
+  only when authenticated; backend
+  choices (`plugins.client_backends`) are on by default, as they only
+  narrow or reorder the candidates. A client pipeline or preset replaces
+  `plugins.pipeline`, framed by `client_pipelines.prepend` and `append`,
</code_context>
<issue_to_address>
**Anonymous backend choices fail**

When a caller uses `gateway.backends` without authenticating, `PluginHost.start()` rejects any supplied backend choice from an unauthenticated caller with `InvalidSelection` (`400`), so callers who read “on by default” as meaning they can use backend choices without authentication get rejected requests.

State explicitly that backend choices, like pipeline choices, require an authenticated caller, even though they are enabled by default.
</issue_to_address>

Sourcery assessment

Approved.


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

Comment thread docs/migration-0.18.md Resolved
uniqueg and others added 3 commits October 26, 2026 23:12
Address review: both client tags are refused from unauthenticated
callers.

Part of #523

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit b3f5d0a into dev Oct 26, 2026
30 checks passed
@uniqueg
uniqueg deleted the docs/migration-0.18 branch October 26, 2026 22:31
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.

docs: complete the 0.18 migration guide

1 participant