issue 1025: the operator's Approve of a reviewed group registers a moved module from its new repository (ADR 0420 §7)

This commit is contained in:
2026-10-17 15:56:49 +02:00
parent 085b661936
commit 81715273d3
18 changed files with 686 additions and 27 deletions
+2 -19
View File
@@ -15,7 +15,6 @@ package main
import (
"context"
"encoding/json"
"errors"
"flag"
"fmt"
@@ -64,24 +63,8 @@ func warrantedAct(asker, ask, caller, state string, w *asks.Warrant) (link.HandA
// readRouterRecord reads the router's record of one asker's ask: its state and warrant, or "" when there is none.
// The controller's grant reaches the JetStream API whole (`$JS.API.>`), so it reads any asker's record.
func readRouterRecord(ctx context.Context, conn *nats.Conn, bucket, asker, ask string) (string, *asks.Warrant, error) {
reply, err := conn.RequestWithContext(ctx, "$JS.API.DIRECT.GET.KV_"+bucket+".$KV."+bucket+"."+asker+"."+ask, nil)
if err != nil {
return "", nil, err
}
if status := reply.Header.Get("Status"); status != "" {
if status == "404" {
return "", nil, nil
}
return "", nil, fmt.Errorf("the router's record could not be read: %s %s", status, reply.Header.Get("Description"))
}
var rec struct {
State string `json:"state"`
Warrant *asks.Warrant `json:"warrant"`
}
if err := json.Unmarshal(reply.Data, &rec); err != nil {
return "", nil, fmt.Errorf("the router's record of %s's ask %s cannot be read: %w", asker, ask, err)
}
return rec.State, rec.Warrant, nil
state, _, w, err := readRouterEntry(ctx, conn, bucket, asker, ask)
return state, w, err
}
func handActWarrantCommand(ctx context.Context, args []string) error {