Ensure that setConfig uses latest functionality (#6302)

This commit is contained in:
Harshavardhana
2018-08-17 18:51:34 -07:00
committed by kannappanr
parent 50a817e3d3
commit 9f14433cbd
13 changed files with 150 additions and 905 deletions

View File

@@ -19,7 +19,6 @@ package madmin
import (
"encoding/json"
"fmt"
"net/http"
)
@@ -38,15 +37,15 @@ func (adm *AdminClient) SetCredentials(access, secret string) error {
return err
}
// No TLS?
if !adm.secure {
return fmt.Errorf("credentials cannot be updated over an insecure connection")
ebody, err := EncryptServerConfigData(adm.secretAccessKey, body)
if err != nil {
return err
}
// Setup new request
reqData := requestData{
relPath: "/v1/config/credential",
content: body,
content: ebody,
}
// Execute GET on bucket to list objects.
@@ -62,5 +61,6 @@ func (adm *AdminClient) SetCredentials(access, secret string) error {
if resp.StatusCode != http.StatusOK {
return httpRespToErrorResponse(resp)
}
return nil
}