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

Method Validate

pkg/blobmanager/s3/provider.go:107–122  ·  view source on GitHub ↗

Validate that the APICreds has all its properties set

()

Source from the content-addressed store, hash-verified

105
106// Validate that the APICreds has all its properties set
107func (c *Credentials) Validate() error {
108 if c.AccessKeyID == "" {
109 return fmt.Errorf("%w: missing accessKeyID", backend.ErrValidation)
110 }
111
112 if c.SecretAccessKey == "" {
113 return fmt.Errorf("%w: missing secretAccessKey", backend.ErrValidation)
114 }
115
116 // BucketName is deprecated, we should use Location instead
117 if c.Location == "" && c.BucketName == "" {
118 return fmt.Errorf("%w: missing bucket and location", backend.ErrValidation)
119 }
120
121 return nil
122}

Callers 4

FromCredentialsMethod · 0.95
extractCredsFunction · 0.95
NewBackendFunction · 0.45
TestValidateFunction · 0.45

Calls

no outgoing calls

Tested by 1

TestValidateFunction · 0.36