Validate that the APICreds has all its properties set
()
| 105 | |
| 106 | // Validate that the APICreds has all its properties set |
| 107 | func (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 | } |
no outgoing calls