Skip to content

Commit

Permalink
Annotations: Allow commas in URLs. (#11887)
Browse files Browse the repository at this point in the history
Signed-off-by: James Strong <strong.james.e@gmail.com>
Co-authored-by: James Strong <strong.james.e@gmail.com>
  • Loading branch information
k8s-infra-cherrypick-robot and strongjz authored Aug 27, 2024
1 parent 2421dd5 commit 13719ac
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 @@ -55,6 +55,11 @@ func TestValidateArrayOfServerName(t *testing.T) {
value: "*.so*mething.com,bla.com",
wantErr: false,
},
{
name: "should allow comma separated query params",
value: "https://oauth.example/oauth2/auth?allowed_groups=gid1,gid2",
wantErr: false,
},
{
name: "should deny names with weird characters",
value: "something.com,lolo;xpto.com,nothing.com",
Expand Down

0 comments on commit 13719ac

Please sign in to comment.