Coordinator: adapter.configuration hides which binding, reference and rule failed

未关闭
#2,747 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
70/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
rust
领域
backend

调研方向

Start in crates/registry-coordinator/src/adapters.rs at config_error() and list its 24 call sites, grouping them by which of the five causes each one represents. Follow the secret-reference path (resolve, read as UTF-8, parse the JWK, build the endpoint) to see which binding name and runtime-file key are in scope at each site, and read the wording used in #1433 and #977. Done looks like one message per failure naming the binding, the key such as authorization.signingKeyRef, and a value-free cause, with a test per cause and no secret bytes printed.

由索引模型根据 Issue 内容生成。

描述

area:coordinator bug

Problem

When a product binding cannot be built, Coordinator reports one message whatever the cause: adapter.configuration: product binding or secret-file configuration is invalid. It names neither the binding, the reference, nor the rule that failed.

Observed during the Stage 0 adopter run for #2745. coordinator serve on an example runtime file failed with that message. The cause was a missing private JWK file named by authorization.signingKeyRef. Finding it meant reading the runtime file against the secret root by hand.

Where it collapses

crates/registry-coordinator/src/adapters.rs defines config_error() and calls it from 24 sites with .map_err(|_| config_error()). These include:

  • resolving the secret reference;
  • reading it as UTF-8;
  • parsing the private JWK;
  • building the endpoint.

Proposal

Keep the adapter.configuration code. Make the message name:

  • the connection or binding name;
  • the runtime-file key, such as authorization.signingKeyRef;
  • one value-free cause, from a small closed set: missing file, refused file (mode, ownership or link), not UTF-8, not a valid private JWK, or invalid endpoint.

Never print the secret bytes. Casework and BReg do the same through #1433 and #977, so reuse their wording.

Add a test per cause.

主要语言
Rust
星标
2
派生
0
平均合并
9 小时 48 分钟
30 天内合并 PR
151

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

registrystack/registry-stack 的其他 Issue

查看 registrystack/registry-stack 的全部 Issue

相似的 Issue

更多 Rust Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。