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

@@ -18,6 +18,7 @@
package cmd
import (
"errors"
"fmt"
"net/url"
"strings"
@@ -35,6 +36,15 @@ type warmBackendMinIO struct {
var _ WarmBackend = (*warmBackendMinIO)(nil)
func newWarmBackendMinIO(conf madmin.TierMinIO, tier string) (*warmBackendMinIO, error) {
// Validation of credentials
if conf.AccessKey == "" || conf.SecretKey == "" {
return nil, errors.New("both access and secret keys are requied")
}
if conf.Bucket == "" {
return nil, errors.New("no bucket name was provided")
}
u, err := url.Parse(conf.Endpoint)
if err != nil {
return nil, err