gitea: the Go bundles read a token from the vault alone, no token file stands in

G2 token-stand-in-goes (Go half): TokenFile, fromFile, DefaultStateDir, SourceFile, the
line at start naming the source and the two env lines go.

Builds: design 47 H2 H-A-575, H-A-602, H-A-642
This commit is contained in:
2026-11-25 17:07:30 +01:00
parent ce04011f96
commit c1abd7e210
5 changed files with 34 additions and 233 deletions
+2 -7
View File
@@ -374,14 +374,9 @@ test("the manifest hands the tools their account, and the Go forge bundle holds
const packages = manifest.build.artifacts.find((a: any) => a.name === "package-registry");
assert.equal(packages.env.MESH_GITEA_PACKAGES_USER, PACKAGES_ACCOUNT);
assert.equal(packages.env.MESH_GITEA_ADMIN_PASSWORD_FILE, undefined);
// H-A-564: until gitea runs as its own account, the Go bundles are handed the token files the TypeScript bundle keeps
// under its state directory, read when the vault refuses the caller's account; no other artifact is.
const files: Record<string, [string | undefined, string | undefined]> = {
forge: ["${dir:runtime-state}/token", undefined],
"package-registry": ["${dir:runtime-state}/token", "${dir:runtime-state}/packages-token"],
};
// H-A-575: the vault alone hands a token: no artifact is given a token file.
for (const a of manifest.build.artifacts) {
assert.deepEqual([a.env?.MESH_GITEA_TOKEN_FILE, a.env?.MESH_GITEA_PACKAGES_TOKEN_FILE], files[a.name] ?? [undefined, undefined],
assert.deepEqual([a.env?.MESH_GITEA_TOKEN_FILE, a.env?.MESH_GITEA_PACKAGES_TOKEN_FILE], [undefined, undefined],
`${a.name}'s token files`);
}
assert.ok(manifest.invokes.includes("seat:mesh-vault.own-put") && manifest.invokes.includes("seat:mesh-vault.get"), manifest.invokes.join(","));