check / check (push) Failing after 15m59s
The example secret name in the uppercase-name test contained the name of one of our servers. It now uses host1; the rest of the name, including the uppercase key ID, is unchanged. Model: opus-5-5
48 lines
1.0 KiB
Go
48 lines
1.0 KiB
Go
//nolint:testpackage // white-box test of unexported isValidSecretName
|
|
package vault
|
|
|
|
import "testing"
|
|
|
|
func TestIsValidSecretNameUppercase(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
tests := []struct {
|
|
name string
|
|
valid bool
|
|
}{
|
|
// Lowercase (existing behavior)
|
|
{"valid-name", true},
|
|
{"valid.name", true},
|
|
{"valid_name", true},
|
|
{"valid/path/name", true},
|
|
{"123valid", true},
|
|
|
|
// Uppercase (new behavior - issue #2)
|
|
{"Valid-Upper-Name", true},
|
|
{"2025-11-21-host1-vaultik-test-bucket-AKI", true},
|
|
{"MixedCase/Path/Name", true},
|
|
{"ALLUPPERCASE", true},
|
|
{"ABC123", true},
|
|
|
|
// Still invalid
|
|
{"", false},
|
|
{"invalid name", false},
|
|
{"invalid@name", false},
|
|
{".dotstart", false},
|
|
{"/leading-slash", false},
|
|
{"trailing-slash/", false},
|
|
{"double//slash", false},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
result := isValidSecretName(tt.name)
|
|
if result != tt.valid {
|
|
t.Errorf("isValidSecretName(%q) = %v, want %v", tt.name, result, tt.valid)
|
|
}
|
|
})
|
|
}
|
|
}
|