Do not save credentials in config.json (#16275)

This commit is contained in:
Anis Elleuch
2022-12-19 21:27:06 +01:00
committed by GitHub
parent b4f71362e9
commit e57e946206
7 changed files with 8 additions and 92 deletions

View File

@@ -17,31 +17,8 @@
package config
import "github.com/minio/minio/internal/auth"
// One time migration code section
// SetCredentials - One time migration code needed, for migrating from older config to new for server credentials.
func SetCredentials(c Config, cred auth.Credentials) {
creds, err := auth.CreateCredentials(cred.AccessKey, cred.SecretKey)
if err != nil {
return
}
if !creds.IsValid() {
return
}
c[CredentialsSubSys][Default] = KVS{
KV{
Key: AccessKey,
Value: cred.AccessKey,
},
KV{
Key: SecretKey,
Value: cred.SecretKey,
},
}
}
// SetRegion - One time migration code needed, for migrating from older config to new for server Region.
func SetRegion(c Config, name string) {
if name == "" {