Reduce Minio access key minimum length to 3 (#5478)

This is a generic minimum value. The current reason is to support
Azure blob storage accounts name whose length is less than 5. 3 is the
minimum length for Azure.
This commit is contained in:
A. Elleuch 2018-02-02 04:43:30 +01:00 committed by Nitish Tiwari
parent 2afd196c83
commit da2faa19a1
5 changed files with 7 additions and 7 deletions

View File

@ -39,8 +39,8 @@ func testAuthenticate(authType string, t *testing.T) {
secretKey string
expectedErr error
}{
// Access key (less than 5 chrs) too small.
{"user", cred.SecretKey, auth.ErrInvalidAccessKeyLength},
// Access key (less than 3 chrs) too small.
{"u1", cred.SecretKey, auth.ErrInvalidAccessKeyLength},
// Secret key (less than 8 chrs) too small.
{cred.AccessKey, "pass", auth.ErrInvalidSecretKeyLength},
// Authentication error.

View File

@ -53,7 +53,7 @@ FLAGS:
{{end}}{{end}}
ENVIRONMENT VARIABLES:
ACCESS:
MINIO_ACCESS_KEY: Custom username or access key of minimum 5 characters in length.
MINIO_ACCESS_KEY: Custom username or access key of minimum 3 characters in length.
MINIO_SECRET_KEY: Custom password or secret key of minimum 8 characters in length.
BROWSER:

View File

@ -116,10 +116,10 @@ func TestParseCredentialHeader(t *testing.T) {
expectedErrCode: ErrCredMalformed,
},
// Test Case - 4.
// Test case with AccessKey of length 4.
// Test case with AccessKey of length 2.
{
inputCredentialStr: generateCredentialStr(
"^#@.",
"^#",
UTCNow().Format(yyyymmdd),
"ABCD",
"ABCD",

View File

@ -34,7 +34,7 @@ $ tree ~/.minio
|Field|Type|Description|
|:---|:---|:---|
|``credential``| | Auth credential for object storage and web access.|
|``credential.accessKey`` | _string_ | Access key of minimum 5 characters in length. You may override this field with `MINIO_ACCESS_KEY` environment variable.|
|``credential.accessKey`` | _string_ | Access key of minimum 3 characters in length. You may override this field with `MINIO_ACCESS_KEY` environment variable.|
|``credential.secretKey`` | _string_ | Secret key of minimum 8 characters in length. You may override this field with `MINIO_SECRET_KEY` environment variable.|
Example:

View File

@ -25,7 +25,7 @@ import (
const (
// Minimum length for Minio access key.
accessKeyMinLen = 5
accessKeyMinLen = 3
// Maximum length for Minio access key.
// There is no max length enforcement for access keys