validateBedrockCredentials checks that Bedrock access keys and secrets are paired correctly (same count) and that each list is well-formed.
(providerIndex int, providerType string, accessKeys, secrets []string)
| 3330 | // secrets are paired correctly (same count) and that each list is |
| 3331 | // well-formed. |
| 3332 | func validateBedrockCredentials(providerIndex int, providerType string, accessKeys, secrets []string) error { |
| 3333 | if len(accessKeys) != len(secrets) { |
| 3334 | return xerrors.Errorf("provider %d (%s): BEDROCK_ACCESS_KEYS count (%d) must match BEDROCK_ACCESS_KEY_SECRETS count (%d)", |
| 3335 | providerIndex, providerType, len(accessKeys), len(secrets)) |
| 3336 | } |
| 3337 | |
| 3338 | if err := validateProviderCredentialList(providerIndex, providerType, accessKeys); err != nil { |
| 3339 | return err |
| 3340 | } |
| 3341 | |
| 3342 | return validateProviderCredentialList(providerIndex, providerType, secrets) |
| 3343 | } |
| 3344 | |
| 3345 | var reInvalidPortAfterHost = regexp.MustCompile(`invalid port ".+" after host`) |
| 3346 |
no test coverage detected