fix(reliability): restack limiter JSON protocol on protected main - #305
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthrough
ChangesJSON 미디어 타입 검증
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This localized protocol-hardening change has no actionable merge-blocking risk remaining and is merge-ready after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant NoemaRateLimiter
participant DurableObject
participant ResponseValidator
NoemaRateLimiter->>DurableObject: 분산 rate-limit 요청
DurableObject-->>ResponseValidator: HTTP 상태 코드와 Content-Type
ResponseValidator->>ResponseValidator: HTTP 200 및 JSON 미디어 타입 확인
ResponseValidator-->>NoemaRateLimiter: 결정 반환 또는 DistributedRateLimitUnavailable 오류
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 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 |
Purpose
Restack only the still-valid rate-limiter JSON media-type/protocol hardening from #269 onto the current protected-main lineage without reusing predecessor CI/review/scanner authority.
Test-first construction
mainimmediately before branch creation:10f7874f309cb120bc57b8c0cb637d1292650fe0;591a8988894fdef3f98b98c1e1ae6e70c60137dc;9aedfb8c43d0c8854de086c50f62f6e0f06c0e97;src/rate-limit.tsblob is byte-identical to fix(reliability): harden limiter JSON protocol #269's merge-base blobe5b0708ec260a0d52706eae52adc274313bbc56a;test/rate-limit-media-type.test.ts, whose import ofisJsonMediaTypeintentionally fails against unchanged protected source.The predecessor's CodeRabbit finding was validated and resolved on #269, but its COMMENTED review and all predecessor checks remain historical only. This successor will preserve both focused regression files and the narrow production delta only after the RED is observed.
Intended GREEN
The final source must parse only the media-type token, accept exact
application/jsoncase-insensitively with ordinary parameters, reject misleading values such astext/plain; profile=application/json, accept limiter decisions only on exact HTTP 200 plus JSON media type, and keep existing decision-schema/fail-closed behavior. No rate-limit semantics or persistence contract changes.Evidence boundary
Keep Draft through RED→GREEN. Before each write refetch current protected main, exact branch/ref/blob/review/writer state. After GREEN require fresh exact-head application
ci,reviewer-ci, protected-base-eligible centralSecurity Scan, 100% configured owned production statement/branch/function/line coverage, and zero valid unresolved findings. Pending/queued/skipped/absent/neutral/failed/cancelled/stale/predecessor/status-only/model-only/rate-limited evidence is non-passing.No protection weakening, force push, self-approval, repair/self-modifying workflow, release/deployment claim, secret/reviewer invention, or outbound-license decision.
Summary by CodeRabbit
버그 수정
charset을 고려해 정확히 검증합니다.415오류와 일관된 JSON 오류 응답을 반환합니다.200및 유효한 JSON 콘텐츠 타입일 때만 처리합니다.테스트