Feat/agnosticism#19
Conversation
|
@copilot review |
Here's a review of the PR changes. All checks pass locally ( 🔴 Issues (should fix)1. Unsafe controller_cls = getattr(route_contract, "controller_cls") # raises AttributeError if missing
"route": f"{getattr(route_contract, 'method')} {getattr(route_contract, 'path')}", # same
"operation": f"{controller_cls.__name__}.{getattr(route_contract, 'handler_name')}", # sameLine 116 already uses a safe 2. Unsafe binding_plan = getattr(route_contract, "binding_plan") # AttributeError if not present
🟡 Warnings (worth addressing)3. Breaking lifecycle hook renames not backward-compatible 4. 5. scoped = ModuleRef(self._application) # passes Application to __init__ expecting Annotated[object, Inject(APPLICATION)]
scoped._module_key = ... # mutates private state after constructionThis works in practice because 6. 🔵 Nitpicks7. 8. 9. Missing trailing newlines Overall: the framework-agnostic refactor is well-designed and the new abstractions ( |
|
@copilot do a thorough review again, be explicit about
|
Thorough security and quality review below. 🔴 Security Issues1. Internal error messages leak to HTTP 500 responses
response = HttpResponse.json({"detail": str(exc)}, status_code=500)This is the fallback path reached when 2. Internal exception detail exposed in
|
| except (NameError, TypeError): | ||
| return declared_type | ||
|
|
||
| return declared_type |
| "use_factory": lambda storage, configured_ttl, configured_limit, configured_key_resolver: ThrottlerGuard( | ||
| storage, | ||
| configured_ttl, | ||
| configured_limit, | ||
| configured_key_resolver, | ||
| ), |
Summary
Describe the problem and the change.
Validation
uv run ruff check .uv run ty check src tests examples scriptsuv run pytestDocs
Release Notes