Honor envs properly for access and secret key. (#3703)
Also changes the behavior of `secretKeyHash` which is not necessary to be sent over the network, each node has its own secretKeyHash to validate. Fixes #3696 Partial(fix) #3700 (More changes needed with some code cleanup)
This commit is contained in:
@@ -119,17 +119,13 @@ func TestDoesPresignedV2SignatureMatch(t *testing.T) {
|
||||
|
||||
// TestValidateV2AuthHeader - Tests validate the logic of V2 Authorization header validator.
|
||||
func TestValidateV2AuthHeader(t *testing.T) {
|
||||
// Initialize server config.
|
||||
if _, err := initConfig(); err != nil {
|
||||
t.Fatal(err)
|
||||
root, err := newTestConfig(globalMinioDefaultRegion)
|
||||
if err != nil {
|
||||
t.Fatal("Unable to initialize test config.")
|
||||
}
|
||||
defer removeAll(root)
|
||||
|
||||
// Save config.
|
||||
if err := serverConfig.Save(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
accessID := serverConfig.GetCredential().AccessKey
|
||||
|
||||
testCases := []struct {
|
||||
authString string
|
||||
expectedError APIErrorCode
|
||||
@@ -194,13 +190,11 @@ func TestValidateV2AuthHeader(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDoesPolicySignatureV2Match(t *testing.T) {
|
||||
if _, err := initConfig(); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
if err := serverConfig.Save(); err != nil {
|
||||
t.Fatal(err)
|
||||
root, err := newTestConfig(globalMinioDefaultRegion)
|
||||
if err != nil {
|
||||
t.Fatal("Unable to initialize test config.")
|
||||
}
|
||||
defer removeAll(root)
|
||||
creds := serverConfig.GetCredential()
|
||||
policy := "policy"
|
||||
testCases := []struct {
|
||||
|
||||
Reference in New Issue
Block a user