Remove API key scope enforcement and strict mode toggles#334
Merged
MaxEriksson2000 merged 6 commits intodevelopfrom Apr 10, 2026
Merged
Remove API key scope enforcement and strict mode toggles#334MaxEriksson2000 merged 6 commits intodevelopfrom
MaxEriksson2000 merged 6 commits intodevelopfrom
Conversation
Scope enforcement and strict mode are now always active — API keys are always restricted to resources within their configured scope. This removes the tenant-level feature flags, env kill-switch, admin UI toggles, and the two PATCH settings endpoints that previously allowed disabling scope boundaries. Migration 202604091000 deletes the feature flag rows from the database.
Strict mode blocks list endpoints entirely when scope can't be deterministically proven via path parameter. Scope enforcement without strict mode already filters list results correctly.
The strict_mode parameter in _enforce_api_key_scope() was always False and the conditional block was never reached. Remove the parameter, the strict mode block, the _strict_scope_hint helper, and all related tests (strict mode matrix, strict mode wiring, strict mode deny tests). Tenant credential strict_mode (separate feature) is untouched.
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
/settings/scope-enforcementand/settings/strict-modeendpoints (breaking API change)202604091000cleans up the feature flag rows from the databaseremove/as allowed branch name prefix in CITest plan
pytest tests/unit/test_api_key_scope_enforcement.py— all passpytest tests/unit/test_setting_service_audit.py— all pass