From 7a030a5a2a2d3275e65df8c8fb94310d12953fb5 Mon Sep 17 00:00:00 2001 From: Grant Linville Date: Thu, 27 Jun 2024 17:21:40 -0400 Subject: [PATCH] fix: remove requirement that cred aliases be alphanumeric Signed-off-by: Grant Linville --- pkg/types/tool.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/pkg/types/tool.go b/pkg/types/tool.go index e7af756f..b0af5183 100644 --- a/pkg/types/tool.go +++ b/pkg/types/tool.go @@ -5,7 +5,6 @@ import ( "encoding/json" "fmt" "path/filepath" - "regexp" "slices" "sort" "strings" @@ -284,10 +283,6 @@ func ParseCredentialArgs(toolName string, input string) (string, string, map[str fields = fields[2:] } - if alias != "" && !isAlphaNumeric(alias) { - return "", "", nil, fmt.Errorf("credential alias must be alphanumeric") - } - if len(fields) == 0 { // Nothing left, so just return return originalName, alias, nil, nil } @@ -785,7 +780,3 @@ func FirstSet[T comparable](in ...T) (result T) { } return } - -func isAlphaNumeric(s string) bool { - return regexp.MustCompile(`^[a-zA-Z0-9_.]+$`).MatchString(s) -}