[20.0][MIG] auth_api_key: Migration to 20.0 #1071
All Vouch review confidence checks passed
Residual risk 0.39 = Change Risk (0.73) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.73 · 614 lines diff across 7 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.384
Shallow Review Depth
shallow_review_depth
0.344
Sensitive Paths
sensitive_paths
0.073
Real PR Conversation Timeline
1 comments
"Review active on #1071"
general
weight: 0.35
thomaspaulb
Migration changes
- Bump version to
20.0.1.0.0.- Convert
ir.model.access.csvto the newsecurity/ir.access.csv(same rights:base.group_system,crud).-
_auth_method_api_keynow takes theroutingargument passed byir.http._authenticate_explicit.- Import
Dispatcherfromodoo.http.dispatcher(no longer re-exported byodoo.http).- Replace removed
registry.clear_cache()withenv.transaction.invalidate_ormcache()(model and tests).- Use
api.ormcacheinstead of deprecatedtools.ormcache.- Remove
readme/CREDITS.md(past migration funding note), per 20.0 guidelines.- Lint fixes required by the 20.0 pre-commit config (single-line manifest summary, ruff C419).
### Fix included
The API key lookup cache was only cleared when
keyoruser_idchanged, so a deleted or archived key could keep authenticating until the cache was cleared by something else. The model now uses_clear_cache_name/
_clear_cache_on_fields = ("key", "user_id", "active"), so the ORM clears the cache on create, unlink and on writes of those fields. Two tests added (archive, unlink).### Known issues (pre-existing, not addressed here)
1. Toggling "Disable API key for archived user" on a company does not clear the cache. Turning the option on recomputes
active = Falseon keys of already-archived users, but the recompute does not go throughwrite(), so a cached key keeps working until the cache is cleared. Note that the field help says the option is not retroactive, while the stored compute (dependson the company option) does make it retroactive —maintainers' input welcome on the intended behavior.
2.
_compute_activereadsself.user_id.company_id.archived_user_disable_auth_api_keyon the whole recordset, which may raise "Expected singleton" when keys of users from different companies are recomputed together(not reproduced).
### Tests
15 tests, 0 failures (local run).