tier: Allow edit of the new Azure and AWS auth params (#18690)

Allow editing for the service principal credentials from Azure
and the web identity token for AWS;

Also, more validation of input parameters.
This commit is contained in:
Anis Eleuch
2023-12-21 16:58:10 -08:00
committed by GitHub
parent eba23bbac4
commit 22f8e39b58
7 changed files with 68 additions and 13 deletions

View File

@@ -19,6 +19,7 @@ package cmd
import (
"context"
"errors"
"fmt"
"io"
@@ -102,6 +103,15 @@ func (gcs *warmBackendGCS) InUse(ctx context.Context) (bool, error) {
}
func newWarmBackendGCS(conf madmin.TierGCS, _ string) (*warmBackendGCS, error) {
// Validation code
if conf.Creds == "" {
return nil, errors.New("empty credentials unsupported")
}
if conf.Bucket == "" {
return nil, errors.New("no bucket name was provided")
}
credsJSON, err := conf.GetCredentialJSON()
if err != nil {
return nil, err