[ARVADOS] created: 1.1.4-188-g4e8add2
Git user
git at public.curoverse.com
Thu May 3 17:01:42 EDT 2018
at 4e8add21a993ea539c1f141453e6118a353f8e33 (commit)
commit 4e8add21a993ea539c1f141453e6118a353f8e33
Author: Tom Clegg <tclegg at veritasgenetics.com>
Date: Thu May 3 16:58:31 2018 -0400
6318: Fix locator regexp: disallow uppercase letters in hash.
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tclegg at veritasgenetics.com>
diff --git a/sdk/go/blockdigest/blockdigest.go b/sdk/go/blockdigest/blockdigest.go
index b9ecc45..f4c8aa6 100644
--- a/sdk/go/blockdigest/blockdigest.go
+++ b/sdk/go/blockdigest/blockdigest.go
@@ -13,7 +13,7 @@ import (
)
var LocatorPattern = regexp.MustCompile(
- "^[0-9a-fA-F]{32}\\+[0-9]+(\\+[A-Z][A-Za-z0-9 at _-]*)*$")
+ "^[0-9a-f]{32}\\+[0-9]+(\\+[A-Z][A-Za-z0-9 at _-]*)*$")
// Stores a Block Locator Digest compactly, up to 128 bits.
// Can be used as a map key.
diff --git a/sdk/go/blockdigest/blockdigest_test.go b/sdk/go/blockdigest/blockdigest_test.go
index a9994f7..b16a08a 100644
--- a/sdk/go/blockdigest/blockdigest_test.go
+++ b/sdk/go/blockdigest/blockdigest_test.go
@@ -141,7 +141,6 @@ func TestBlockDigestGetsPrettyPrintedByPrintfInNestedStructs(t *testing.T) {
func TestLocatorPatternBasic(t *testing.T) {
expectLocatorPatternMatch(t, "12345678901234567890123456789012+12345")
- expectLocatorPatternMatch(t, "A2345678901234abcdefababdeffdfdf+12345")
expectLocatorPatternMatch(t, "12345678901234567890123456789012+12345+A1")
expectLocatorPatternMatch(t,
"12345678901234567890123456789012+12345+A1+B123wxyz at _-")
@@ -153,6 +152,7 @@ func TestLocatorPatternBasic(t *testing.T) {
expectLocatorPatternFail(t, "12345678901234567890123456789012")
expectLocatorPatternFail(t, "12345678901234567890123456789012+")
+ expectLocatorPatternFail(t, "A2345678901234abcdefababdeffdfdf+12345")
expectLocatorPatternFail(t, "12345678901234567890123456789012+12345+")
expectLocatorPatternFail(t, "1234567890123456789012345678901+12345")
expectLocatorPatternFail(t, "123456789012345678901234567890123+12345")
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list