refactor: rename whitelist_hosts config key to allowlist_hosts
All checks were successful
check / check (push) Successful in 4s
All checks were successful
check / check (push) Successful in 4s
This commit is contained in:
@@ -14,7 +14,7 @@ func TestGetStringSlice_YAMLList(t *testing.T) {
|
||||
configPath := filepath.Join(tmpDir, "config.yml")
|
||||
|
||||
yamlContent := `
|
||||
whitelist_hosts:
|
||||
allowlist_hosts:
|
||||
- static.sneak.cloud
|
||||
- sneak.berlin
|
||||
- s3.sneak.cloud
|
||||
@@ -31,7 +31,7 @@ whitelist_hosts:
|
||||
}
|
||||
|
||||
// Test that getStringSlice correctly parses YAML list
|
||||
hosts := getStringSlice(sc, "whitelist_hosts")
|
||||
hosts := getStringSlice(sc, "allowlist_hosts")
|
||||
|
||||
if len(hosts) != 3 {
|
||||
t.Errorf("expected 3 hosts, got %d: %v", len(hosts), hosts)
|
||||
@@ -54,7 +54,7 @@ func TestGetStringSlice_CommaSeparated(t *testing.T) {
|
||||
tmpDir := t.TempDir()
|
||||
configPath := filepath.Join(tmpDir, "config.yml")
|
||||
|
||||
yamlContent := `whitelist_hosts: "static.sneak.cloud, sneak.berlin, s3.sneak.cloud"`
|
||||
yamlContent := `allowlist_hosts: "static.sneak.cloud, sneak.berlin, s3.sneak.cloud"`
|
||||
|
||||
err := os.WriteFile(configPath, []byte(yamlContent), 0644)
|
||||
if err != nil {
|
||||
@@ -66,7 +66,7 @@ func TestGetStringSlice_CommaSeparated(t *testing.T) {
|
||||
t.Fatalf("failed to load config: %v", err)
|
||||
}
|
||||
|
||||
hosts := getStringSlice(sc, "whitelist_hosts")
|
||||
hosts := getStringSlice(sc, "allowlist_hosts")
|
||||
|
||||
if len(hosts) != 3 {
|
||||
t.Errorf("expected 3 hosts, got %d: %v", len(hosts), hosts)
|
||||
@@ -100,7 +100,7 @@ func TestGetStringSlice_Empty(t *testing.T) {
|
||||
t.Fatalf("failed to load config: %v", err)
|
||||
}
|
||||
|
||||
hosts := getStringSlice(sc, "whitelist_hosts")
|
||||
hosts := getStringSlice(sc, "allowlist_hosts")
|
||||
|
||||
if hosts != nil && len(hosts) != 0 {
|
||||
t.Errorf("expected nil or empty slice, got %v", hosts)
|
||||
|
||||
Reference in New Issue
Block a user