diff --git a/pkg/util/util.go b/pkg/util/util.go index b3d0baaf..fff9c2e4 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -12,7 +12,7 @@ import ( var ( keyLengthLimit = 63 - keyRegex = regexp.MustCompile(`^[\w\d-]+$`) + keyRegex = regexp.MustCompile(`^[\w\d-/]+$`) randomKeyCharset = []byte("123456789abcdefghijkmnopqrstuvwxyz") randomKeyPrefix = "k" diff --git a/pkg/util/util_test.go b/pkg/util/util_test.go index 87adda69..3de72f86 100644 --- a/pkg/util/util_test.go +++ b/pkg/util/util_test.go @@ -96,6 +96,10 @@ func TestIsSafeKey(t *testing.T) { b, msg = IsSafeKey(strings.Repeat("a", 64)) assert.False(t, b) assert.NotEmpty(t, msg) + + b, msg = IsSafeKey("slashes/are/valid") + assert.True(t, b) + assert.Empty(t, msg) } func TestPtrs(t *testing.T) {