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

Offen
#2,747 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
70/100
Issue-Typ
Refactoring
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
rust
Bereich
backend

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
Rust
Sterne
2
Forks
0
Ø Merge
9 Std. 48 Min.
Gemergte PRs (30 T.)
151

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus registrystack/registry-stack

Alle Issues in registrystack/registry-stack

Ähnliche Issues

Weitere Issues zu Rust

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.