gitea: the Go bundles read the token gitea keeps when the vault refuses their account
Every package publish fails since about 11:45 CET: the package-registry and forge bundles ask the vault for module/gitea/* from inside the tool runner, whose account the vault refuses (no module's account), and the manifest since C4 hands them no token file. Until gitea runs as its own account, a bundle the vault refuses reads the token gitea's TypeScript bundle keeps under its state directory (token, packages-token, each with its scopes line naming the account), says once at start which source each token came from, and reads the file again at each call. The manifest hands the two bundles MESH_GITEA_TOKEN_FILE and MESH_GITEA_PACKAGES_TOKEN_FILE again. The fallback ends with gitea's own account. Builds: design 47 H2 H-A-564 (hq 1b286366), H-A-543
This commit is contained in:
@@ -694,6 +694,13 @@ func TestToolsAreTheOnesTheReadmeNamesAndTheManifestBuilds(t *testing.T) {
|
||||
"cmd/forge": {"MESH_GITEA_URL", "MESH_GITEA_TOOLS_USER"},
|
||||
"cmd/package-registry": {"MESH_GITEA_URL", "MESH_GITEA_TOOLS_USER", "MESH_GITEA_PACKAGES_USER"},
|
||||
}
|
||||
// H-A-564: until gitea runs as its own account, each Go bundle is handed the token files gitea's TypeScript bundle
|
||||
// keeps under its state directory, read when the vault refuses the caller's account.
|
||||
files := map[string]map[string]string{
|
||||
"cmd/forge": {"MESH_GITEA_TOKEN_FILE": "${dir:runtime-state}/token"},
|
||||
"cmd/package-registry": {"MESH_GITEA_TOKEN_FILE": "${dir:runtime-state}/token",
|
||||
"MESH_GITEA_PACKAGES_TOKEN_FILE": "${dir:runtime-state}/packages-token"},
|
||||
}
|
||||
for _, a := range m.Build.Artifacts {
|
||||
want, ok := wants[a.From]
|
||||
if !ok {
|
||||
@@ -713,10 +720,9 @@ func TestToolsAreTheOnesTheReadmeNamesAndTheManifestBuilds(t *testing.T) {
|
||||
t.Errorf("%s is given %s: it acts as an account of its own, not the administrator", a.From, k)
|
||||
}
|
||||
}
|
||||
// Design 47 H2 §808, H-A-422 (1): the token is read through the vault seat's get, never from a file.
|
||||
for _, k := range []string{"MESH_GITEA_TOKEN_FILE", "MESH_GITEA_PACKAGES_TOKEN_FILE"} {
|
||||
if a.Env[k] != "" {
|
||||
t.Errorf("%s is given %s: its token is read from the vault", a.From, k)
|
||||
if a.Env[k] != files[a.From][k] {
|
||||
t.Errorf("%s is given %s %q, want %q (H-A-564)", a.From, k, a.Env[k], files[a.From][k])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user