s3: Add warning if key ID or secret is empty

Also add debug message if no credential types are available.

Closes #2388
This commit is contained in:
Garry McNulty 2021-09-30 19:45:31 +01:00
parent 24088f8307
commit 708d7a2574
3 changed files with 22 additions and 0 deletions

View file

@ -69,6 +69,15 @@ func open(ctx context.Context, cfg Config, rt http.RoundTripper) (*Backend, erro
},
})
c, err := creds.Get()
if err != nil {
return nil, errors.Wrap(err, "creds.Get")
}
if c.SignerType == credentials.SignatureAnonymous {
debug.Log("using anonymous access for %#v", cfg.Endpoint)
}
options := &minio.Options{
Creds: creds,
Secure: !cfg.UseHTTP,