s3: emit a debug message if anonymous credentials are in use

This can indicate the user is expecting `env_auth=true` to be the
default so we say that in the debug message.

See: https://forum.rclone.org/t/rclone-with-amazon-s3-access-point/42411
This commit is contained in:
Nick Craig-Wood 2023-10-19 16:51:15 +01:00
parent 53868ef4e1
commit 6092fe2aaa

View File

@ -2896,6 +2896,7 @@ func s3Connection(ctx context.Context, opt *Options, client *http.Client) (*s3.S
case v.AccessKeyID == "" && v.SecretAccessKey == "":
// if no access key/secret and iam is explicitly disabled then fall back to anon interaction
cred = credentials.AnonymousCredentials
fs.Debugf(nil, "Using anonymous credentials - did you mean to set env_auth=true?")
case v.AccessKeyID == "":
return nil, nil, errors.New("access_key_id not found")
case v.SecretAccessKey == "":