MCPcopy
hub / github.com/minio/minio-go / RetrieveWithCredContext

Method RetrieveWithCredContext

pkg/credentials/chain.go:59–74  ·  view source on GitHub ↗

RetrieveWithCredContext is like Retrieve with CredContext

(cc *CredContext)

Source from the content-addressed store, hash-verified

57
58// RetrieveWithCredContext is like Retrieve with CredContext
59func (c *Chain) RetrieveWithCredContext(cc *CredContext) (Value, error) {
60 for _, p := range c.Providers {
61 creds, _ := p.RetrieveWithCredContext(cc)
62 // Always prioritize non-anonymous providers, if any.
63 if creds.AccessKeyID == "" && creds.SecretAccessKey == "" {
64 continue
65 }
66 c.curr = p
67 return creds, nil
68 }
69 // At this point we have exhausted all the providers and
70 // are left without any credentials return anonymous.
71 return Value{
72 SignerType: SignatureAnonymous,
73 }, nil
74}
75
76// Retrieve returns the credentials value, returns no credentials(anonymous)
77// if no credentials provider returned any value.

Callers 4

TestChainGetFunction · 0.95
TestChainIsExpiredFunction · 0.95
TestChainWithNoProviderFunction · 0.95

Calls 1

Tested by 4

TestChainGetFunction · 0.76
TestChainIsExpiredFunction · 0.76
TestChainWithNoProviderFunction · 0.76