Skip to content

Commit

Permalink
add = character to tag validation regex
Browse files Browse the repository at this point in the history
  • Loading branch information
cvignal committed Oct 11, 2024
1 parent cca4103 commit c514bc6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/tags/tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ const (
// https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Using_Tags.html#tag-restrictions
// borrowed from this article and also testing various ASCII characters following regex
// is supported by AWS S3 for both tags and values.
var validTagKeyValue = regexp.MustCompile(`^[a-zA-Z0-9-+\-._:/@ ]+$`)
var validTagKeyValue = regexp.MustCompile(`^[a-zA-Z0-9-+\-._:/@ =]+$`)

func checkKey(key string) error {
if len(key) == 0 {
Expand Down
5 changes: 5 additions & 0 deletions pkg/tags/tags_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ func TestParseTags(t *testing.T) {
false,
2,
},
{
"key=value=",
false,
1,
},
{
fmt.Sprintf("%0128d=%0256d", 1, 1),
false,
Expand Down

0 comments on commit c514bc6

Please sign in to comment.