Repository navigation
refactor(drogon): share token grant response presentation - #346
Conversation
必须处理项评审基于 本轮未发现需要阻断合并的新增缺陷。 逐分支对照原回调与新 helper:完整 JSON/扩展字段、错误状态映射、成功 no-store/pragma、直接 grant 错误与入口认证错误的头部差异、以状态值递增的旧 counter,以及仅授权码成功时更新 gauge 的行为均保留。helper 同步返回,回调所有权仍在原位置,没有引入异步捕获或 token/事务编排变化。源码自动收集和私有头非安装边界也已核对。 当前 head 的三平台、ASan+UBSan、SDK smoke 均成功;单元测试覆盖 Int64 序列化、扩展字段、缺省 metrics、异常/空 error 成员,HTTP 测试覆盖真实授权码与 refresh 流程。HTTP 用例在 PostgreSQL 不可用时返回,因此不把所有平台 CI 成功解读为都执行了真实 PostgreSQL 链路。本轮未本地重编;严格 coverage gate/nightly TSan 未运行。 |
建议处理项评审基于 暂无独立、可执行的非阻断问题需要追加。现有单元测试与 HTTP characterization 已覆盖本次抽取的主要差异;不建议为这次行为保持型重构顺带改变旧 metrics 语义、统一两类错误响应头,或扩大到其他 grant,这些会改变已明确冻结的行为范围。 |
2d0e2fa to
e78b384
Compare
Deep review follow-up: P2 (Minor) findingsFull behavior-parity and architecture review of Four P2 items remain — none blocks merging; all tracked in #359:
Verdict: mergeable; P2 cleanup can land as follow-ups per #359. |
Extract authorization-code and refresh-token HTTP result presentation into a private synchronous adapter with explicit metrics. Preserve JSON, status/header differences and grant-specific metric behavior while retaining the original callbacks and authentication/storage flows. Protect the extraction with real HTTP characterization executed before and after refactoring, plus response and FakeMetrics unit coverage.
e78b384 to
70e9038
Compare
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Summary
Authorization-code and refresh-token completion callbacks duplicated JSON/status/header and metrics presentation. Extract that responsibility into a private synchronous adapter with explicit IMetrics, while keeping the original callbacks and authentication/rotation/storage orchestration in place.
The adapter preserves full JSON (including extensions), catalog status mapping, direct-result error headers, status-valued counters and the authorization-code-only success gauge. It does not change public headers, API/SDK contracts or other grants.
Type of change
Validation
Independent design and implementation review completed locally. This is the first S08 refactoring slice; client-credentials/device payload extraction and Session responsibility work remain separate batches. S07 formal capacity testing remains blocked by persistent disk space; these functional results do not establish capacity. No merge or deployment is included.
Checklist