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:
@@ -694,13 +694,6 @@ 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 {
|
||||
@@ -720,9 +713,10 @@ 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)
|
||||
}
|
||||
}
|
||||
// H-A-575: the vault alone hands a token; no bundle is given a token file.
|
||||
for _, k := range []string{"MESH_GITEA_TOKEN_FILE", "MESH_GITEA_PACKAGES_TOKEN_FILE"} {
|
||||
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])
|
||||
if a.Env[k] != "" {
|
||||
t.Errorf("%s is given %s %q: a token is read from the vault alone (H-A-575)", a.From, k, a.Env[k])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user