diff --git a/auth.go b/auth.go index f97d6a72..8ca2e451 100644 --- a/auth.go +++ b/auth.go @@ -27,6 +27,5 @@ func isValidSecretKey(secretAccessKey string) bool { // isValidAccessKey - validate access key func isValidAccessKey(accessKeyID string) bool { regex := regexp.MustCompile("^[A-Z0-9\\-\\.\\_\\~]{20}$") - regex.MatchString(accessKeyID) return regex.MatchString(accessKeyID) } diff --git a/auth_test.go b/auth_test.go index 337cb542..82284cad 100644 --- a/auth_test.go +++ b/auth_test.go @@ -35,6 +35,7 @@ func (s *AuthSuite) TestAuthAccessKeyLength(c *C) { result = isValidSecretKey("1234567890123456789012345678901234567890") c.Assert(result, Equals, true) } + func (s *AuthSuite) TestValidAccessKeyLength(c *C) { // short result := isValidAccessKey("1234567890123456789")