Origin/2378 Add expires_at on dcr client#2565
Conversation
Rebase & Review SummaryChanges made during rebase:
Code Review: ✅ ApprovedRFC 7591 Compliance: The implementation correctly uses
Security: No concerns - this is informational metadata only Performance: No impact - single dictionary lookup + conditional datetime conversion Consistency: Uses the same Tests: All 176 OAuth-related unit tests pass |
Final Review & Fixes SummaryRebased and significantly enhanced the original implementation with multiple rounds of review. Key Improvements Made:1. Type Safety & Coercion
2. Millisecond Timestamp Detection
3. Parse Failure Handling
4. Update Path Enhancement
5. Comprehensive Test Coverage (11 new tests)
Files Changed
Test Results✅ 41 DCR tests pass |
Complete Change SummaryOriginal PRAdded Enhancements Made During Review1. Type Safety & Error Handling
2. Millisecond Timestamp Detection
3. Tuple Return Pattern for Safe Updates (datetime, True) → Valid timestamp, update expires_at
(None, True) → Explicit 0 ("never expires"), set to None
(None, False) → Parse failed, preserve existing expires_at4. Update Path Enhancement
5. Test Coverage (11 new tests)
Files ChangedTest Results
|
Signed-off-by: hughhennnelly <hughhennelly06@gmail.com>
🐛 Bug-fix PR
Before opening this PR please:
make lint- passesruff,mypy,pylintmake test- all unit + integration tests greenmake coverage- ≥ 90 %make docker docker-run-sslormake podman podman-run-ssl📌 Summary
In DCRService.register_client, the registered client had
expires_atset to None, with a TODO thatclient_secret_expires_atshould be use to populate this field🔁 Reproduction Steps
🐞 Root Cause
The issue was the
expires_atwas set to None on all cases, with a TODO on what it should be next to it.💡 Fix Description
I used
client_secret_expires_atwhich is a RFC7591 key for DCR, to set our expires_at key.🧪 Verification
make lintmake testmake coverage📐 MCP Compliance (if relevant)
✅ Checklist
make black isort pre-commit)Solves [BUG][SONAR][LOW]: Missing expires_at calculation in DCR client registration