fix: redact secretKey from printed on screen (#4526)

This commit is contained in:
Allan Roger Reid
2023-03-28 12:50:57 -07:00
committed by GitHub
parent 81453d7c8f
commit ada99298b2
2 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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
View File
@@ -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,