Skip to content

Commit

Permalink
Annotations: Allow @ in URLs.
Browse files Browse the repository at this point in the history
  • Loading branch information
pando85 committed Jan 7, 2025
1 parent 5b142ed commit 0d70ff4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion internal/ingress/annotations/parser/validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var (
alphaNumericChars = `\-\.\_\~a-zA-Z0-9\/:`
extendedAlphaNumeric = alphaNumericChars + ", "
regexEnabledChars = regexp.QuoteMeta(`^$[](){}*+?|&=\`)
urlEnabledChars = regexp.QuoteMeta(`,:?&=`)
urlEnabledChars = regexp.QuoteMeta(`@,:?&=`)
)

// IsValidRegex checks if the tested string can be used as a regex, but without any weird character.
Expand Down
5 changes: 5 additions & 0 deletions internal/ingress/annotations/parser/validators_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,11 @@ func TestValidateArrayOfServerName(t *testing.T) {
value: "https://oauth.example/oauth2/auth?allowed_groups=gid1,gid2",
wantErr: false,
},
{
name: "should allow at in query params",
value: "https://oauth.example/oauth2/[email protected],[email protected]",
wantErr: false,
},
{
name: "should deny names with weird characters",
value: "something.com,lolo;xpto.com,nothing.com",
Expand Down

0 comments on commit 0d70ff4

Please sign in to comment.