fix: redact secretKey from printed on screen (#4526)
This commit is contained in:
+2
-2
@@ -95,8 +95,8 @@ func checkCredentialsSyntax(credentials aliasConfigV10) {
|
||||
}
|
||||
|
||||
if !isValidSecretKey(credentials.SecretKey) {
|
||||
fatalIf(errInvalidArgument().Trace(credentials.SecretKey),
|
||||
"Invalid secret key `"+credentials.SecretKey+"`.")
|
||||
fatalIf(errInvalidArgument().Trace(),
|
||||
"Invalid secret key.")
|
||||
}
|
||||
|
||||
if credentials.API != "" && !isValidAPI(credentials.API) { // Empty value set to default "S3v4".
|
||||
|
||||
+3
-3
@@ -256,7 +256,7 @@ func BuildS3Config(ctx context.Context, url, accessKey, secretKey, api, path str
|
||||
// Probe S3 signature version
|
||||
api, err := probeS3Signature(ctx, accessKey, secretKey, url, peerCert)
|
||||
if err != nil {
|
||||
return nil, err.Trace(url, accessKey, secretKey, api, path)
|
||||
return nil, err.Trace(url, accessKey, api, path)
|
||||
}
|
||||
|
||||
s3Config.Signature = api
|
||||
@@ -336,11 +336,11 @@ func mainAliasSet(cli *cli.Context, deprecated bool) error {
|
||||
|
||||
if !globalInsecure && !globalJSON && term.IsTerminal(int(os.Stdout.Fd())) {
|
||||
peerCert, err = promptTrustSelfSignedCert(ctx, url, alias)
|
||||
fatalIf(err.Trace(cli.Args()...), "Unable to initialize new alias from the provided credentials.")
|
||||
fatalIf(err.Trace(alias, url, accessKey), "Unable to initialize new alias from the provided credentials.")
|
||||
}
|
||||
|
||||
s3Config, err := BuildS3Config(ctx, url, accessKey, secretKey, api, path, peerCert)
|
||||
fatalIf(err.Trace(cli.Args()...), "Unable to initialize new alias from the provided credentials.")
|
||||
fatalIf(err.Trace(alias, url, accessKey), "Unable to initialize new alias from the provided credentials.")
|
||||
|
||||
msg := setAlias(alias, aliasConfigV10{
|
||||
URL: s3Config.HostURL,
|
||||
|
||||
Reference in New Issue
Block a user