Repository navigation
docs: align the 0.18 guide on opt-in roles - #535
Merged
Merged
Conversation
Since #533, opt-in roles that no group is mapped to are allowed, with a startup warning, instead of failing validation. Closes #534 Co-Authored-By: Claude Opus 5.5 <[email protected]>
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates the 0.18 migration guide to match current opt-in role validation: unmapped roles are permitted with startup warnings, while unsafe role definitions, invalid headers, and policy grants remain rejected. 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 #535 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 55 55
Lines 6667 6667
=========================================
Hits 6667 6667
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 23:27
There was a problem hiding this comment.
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="213-214" />
<code_context>
- it to another opt-in role), as the role would then apply without asking
- for it.
+ opt-in role is a `resource_roles` role or starts with a prefix of
+ subjects, if `opt_in_header` is no valid header name or equals
+ `security.auth.on_behalf_of_header`, or if a configured rule of
+ `policies` grants an opt-in role (e.g., `[g, "user:alice", admin]`,
+ also resource-scoped `g2` rules and rules granting it to another opt-in
</code_context>
<issue_to_address>
**Unused header clash falsely rejected**
When `opt_in_roles` is empty and `opt_in_header` matches `security.auth.on_behalf_of_header`, readers are told this configuration fails validation, but `SecurityConfig.validate_access_control()` checks the header clash only when `opt_in_roles` is nonempty; with no opt-in roles, the app starts successfully and the guide overstates the validation behavior.
Clarify that the header clash is rejected only when opt-in roles are configured.
</issue_to_address>Sourcery assessment
Approved.
Address review: the clash with the on-behalf-of header is only checked with opt-in roles set. Part of #534 Co-Authored-By: Claude Opus 5.5 <[email protected]>
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
Aligns the "Opt-in roles" section of
docs/migration-0.18.mdwith #533: opt-in roles that no group is mapped to yet are allowed, with a startup warning (and the advice to check it, as a misspelled opt-in role is only warned of); still refused on startup: opt-in roles that areresource_rolesor start with a subject prefix, an invalid or clashingopt_in_header, and configured rules granting opt-in roles.Closes #534
Light lane: docs only; reviewed the diff myself against
foca/models/config.pyand the docs changed by #533.Verification
mkdocs build --strict: passes.🤖 Generated with Claude Code
Summary by Sourcery
Documentation: