Skip to content

fix: remove requirement that cred aliases be alphanumeric #580

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions pkg/types/tool.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"encoding/json"
"fmt"
"path/filepath"
"regexp"
"slices"
"sort"
"strings"
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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)
}
Loading