Improve coverage of web-handlers.go (#3157)

This patch additionally relaxes the requirement for
accesskeys to be in a regexy set of values.

Fixes #3063
This commit is contained in:
Harshavardhana
2016-11-02 14:45:11 -07:00
committed by GitHub
parent f024deb1f8
commit d9674f7524
8 changed files with 211 additions and 128 deletions

View File

@@ -184,10 +184,10 @@ func Main() {
SecretAccessKey: secretKey,
})
}
if !isValidAccessKey.MatchString(serverConfig.GetCredential().AccessKeyID) {
if !isValidAccessKey(serverConfig.GetCredential().AccessKeyID) {
fatalIf(errInvalidArgument, "Invalid access key. Accept only a string starting with a alphabetic and containing from 5 to 20 characters.")
}
if !isValidSecretKey.MatchString(serverConfig.GetCredential().SecretAccessKey) {
if !isValidSecretKey(serverConfig.GetCredential().SecretAccessKey) {
fatalIf(errInvalidArgument, "Invalid secret key. Accept only a string containing from 8 to 40 characters.")
}