|
|
@ -311,11 +311,11 @@ func (web *webAPI) SetAuth(r *http.Request, args *SetAuthArgs, reply *SetAuthRep |
|
|
|
if !isJWTReqAuthenticated(r) { |
|
|
|
if !isJWTReqAuthenticated(r) { |
|
|
|
return &json2.Error{Message: "Unauthorized request"} |
|
|
|
return &json2.Error{Message: "Unauthorized request"} |
|
|
|
} |
|
|
|
} |
|
|
|
if args.AccessKey == "" { |
|
|
|
if !isValidAccessKey.MatchString(args.AccessKey) { |
|
|
|
return &json2.Error{Message: "Empty access key not allowed"} |
|
|
|
return &json2.Error{Message: "Invalid Access Key"} |
|
|
|
} |
|
|
|
} |
|
|
|
if args.SecretKey == "" { |
|
|
|
if !isValidSecretKey.MatchString(args.SecretKey) { |
|
|
|
return &json2.Error{Message: "Empty secret key not allowed"} |
|
|
|
return &json2.Error{Message: "Invalid Secret Key"} |
|
|
|
} |
|
|
|
} |
|
|
|
cred := credential{args.AccessKey, args.SecretKey} |
|
|
|
cred := credential{args.AccessKey, args.SecretKey} |
|
|
|
serverConfig.SetCredential(cred) |
|
|
|
serverConfig.SetCredential(cred) |
|
|
|