Supersede #2792 (tsk-iqk2bn): registry-JWT unknown-route + off-allowlist hardening must extend dev's shipped check_agent_identity/_any_route_matches mechanism, not ship a second one - #2828
Conversation
Port TestRegistryJwtUnknownRouteDispatch (8 tests) onto dev's check_agent_identity + _any_route_matches mechanism, extending _any_route_matches with a match_method parameter so the 404/401 split keys off path existence (whatever the method) rather than method+path match. A wrong verb on an existing URL now falls through to the session gate's 401 instead of being misreported as a wrong URL. One pre-existing dev test (test_checklist_delete_requires_session) updated to match the corrected behavior. Step-1 red line: 1 failed, 9 passed (before fix) Step-2 green line: 139 passed (after fix, across test_auth_middleware.py + test_agent_scope_requests.py + test_token_rotation.py)
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 4 included reviews per hour; 0 remain after this review. 📝 WalkthroughWalkthroughRegistry JWT dispatch now returns 404 for unknown paths and 401 for known paths with unsupported methods or invalid credentials. Middleware route matching, regression tests, agent API documentation, and the changelog were updated. ChangesRegistry JWT dispatch
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to Registry JWT requests now receive 404 only for genuinely unknown paths, while requests using unsupported methods on known paths proceed to the session gate and return 401. The behavior is covered by targeted regression tests and is ready to merge. Sequence Diagram(s)sequenceDiagram
participant Request
participant AuthMiddleware
participant RouteMatcher
participant SessionGate
Request->>AuthMiddleware: present registry JWT
AuthMiddleware->>RouteMatcher: check path existence without method
RouteMatcher-->>AuthMiddleware: unknown path or registered path
alt unknown path
AuthMiddleware-->>Request: 404 Not Found
else registered path
AuthMiddleware->>SessionGate: apply session authentication
SessionGate-->>Request: 401 Authentication required
end
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 78.57% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 14 functions across 2 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 2📝 Generate docstrings 💡
🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Kilo Code Review could not run — your account is out of credits. Add credits or switch to a free model to enable reviews on this change. |
CARD TITLE (intent, not commit subject): Supersede #2792 (tsk-iqk2bn): registry-JWT unknown-route + off-allowlist hardening must extend dev's shipped check_agent_identity/_any_route_matches mechanism, not ship a second one
Autonomous build of board card tsk-etzofb.
Port TestRegistryJwtUnknownRouteDispatch (8 tests) onto dev's check_agent_identity + _any_route_matches mechanism, extending _any_route_matches with a match_method parameter so the 404/401 split keys off path existence (whatever the method) rather than method+path match. A wrong verb on an existing URL now falls through to the session gate's 401 instead of being misreported as a wrong URL. One pre-existing dev test (test_checklist_delete_requires_session) updated to match the corrected behavior.
Step-1 red line: 1 failed, 9 passed (before fix)
Step-2 green line: 139 passed (after fix, across test_auth_middleware.py + test_agent_scope_requests.py + test_token_rotation.py)
Files:
.../tsk-etzofb-registry-jwt-unknown-route.md | 2 +
docs/agent-coordination.md | 27 ++-
tests/test_auth_middleware.py | 244 ++++++++++++++++++++-
tinyagentos/auth_middleware.py | 6 +-
4 files changed, 265 insertions(+), 14 deletions(-)
Summary by CodeRabbit
Bug Fixes
Documentation