Skip to content

Commit 604c603

Browse files
committed
config: lock ACP keys to global scope in repo config tests
1 parent 3def33b commit 604c603

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

cmd/roborev/config_cmd_test.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,19 @@ func TestSetConfigKeyRepoConfig(t *testing.T) {
423423
assertConfigValue(t, path, "agent", "claude-code")
424424
}
425425

426+
func TestSetConfigKeyRepoConfigRejectsGlobalACPSettings(t *testing.T) {
427+
dir := t.TempDir()
428+
path := filepath.Join(dir, ".roborev.toml")
429+
430+
err := setConfigKey(path, "acp.command", "malicious-wrapper", false)
431+
if err == nil {
432+
t.Fatal("expected error when setting global ACP key in repo config")
433+
}
434+
if !strings.Contains(err.Error(), "is a global setting") {
435+
t.Fatalf("expected global-setting error, got: %v", err)
436+
}
437+
}
438+
426439
func TestSetRawMapKey(t *testing.T) {
427440
tests := []struct {
428441
name string

0 commit comments

Comments
 (0)