Verify inherited credential safety
This commit is contained in:
@@ -432,7 +432,7 @@ func TestPipelineOverlayDoesNotRequireUnusedBaseCredentials(t *testing.T) {
|
||||
for _, credential := range []string{testingKey, "null"} {
|
||||
t.Run(credential, func(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
root := writePipelineFixture(t, dir, "pipeline.yml", "whisperx:\n transcribe_url: https://transcription.example.test/transcribe\naudita:\n credentials: ["+production+"]\n")
|
||||
root := writePipelineFixture(t, dir, "pipeline.yml", "whisperx:\n transcribe_url: https://transcription.example.test/transcribe\naudita:\n credentials: ["+production+"]\nscriptorium:\n extends: audita\n")
|
||||
selected := "[" + credential + "]"
|
||||
if credential == "null" {
|
||||
selected = credential
|
||||
@@ -447,8 +447,13 @@ func TestPipelineOverlayDoesNotRequireUnusedBaseCredentials(t *testing.T) {
|
||||
if len(cfg.Audita.Credentials) != 0 {
|
||||
t.Fatal("profile did not remove the base credential")
|
||||
}
|
||||
if len(cfg.Scriptorium.Credentials) != 0 {
|
||||
t.Fatal("inherited profile credential was not removed")
|
||||
}
|
||||
} else if len(cfg.Audita.Credentials) != 1 || cfg.Audita.Credentials[0].EnvName() != testingKey || !cfg.Audita.Credentials[0].IsResolved() {
|
||||
t.Fatal("profile credential was not resolved")
|
||||
} else if len(cfg.Scriptorium.Credentials) != 1 || cfg.Scriptorium.Credentials[0].EnvName() != testingKey || cfg.Scriptorium.Credentials[0].Value() != "synthetic-test-key" {
|
||||
t.Fatal("inherited profile credential was not resolved")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user