MCPcopy Create free account
hub / github.com/chainloop-dev/chainloop / extractCreds

Function extractCreds

pkg/blobmanager/s3/provider.go:75–89  ·  view source on GitHub ↗
(location string, credsJSON []byte)

Source from the content-addressed store, hash-verified

73}
74
75func extractCreds(location string, credsJSON []byte) (*Credentials, error) {
76 var creds *Credentials
77 if err := json.Unmarshal(credsJSON, &creds); err != nil {
78 return nil, fmt.Errorf("unmarshaling credentials: %w", err)
79 }
80
81 // We do not allow overriding the location
82 creds.Location = location
83
84 if err := creds.Validate(); err != nil {
85 return nil, fmt.Errorf("invalid credentials: %w", err)
86 }
87
88 return creds, nil
89}
90
91type Credentials struct {
92 // AWS Access Key ID

Callers 2

TestExtractCredsFunction · 0.70

Calls 1

ValidateMethod · 0.95

Tested by 1

TestExtractCredsFunction · 0.56