MCPcopy Index your code
hub / github.com/coder/coder / validateBedrockCredentials

Function validateBedrockCredentials

cli/server.go:3332–3343  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

3330// secrets are paired correctly (same count) and that each list is
3331// well-formed.
3332func 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
3345var reInvalidPortAfterHost = regexp.MustCompile(`invalid port ".+" after host`)
3346

Callers 1

ReadAIProvidersFromEnvFunction · 0.85

Calls 2

ErrorfMethod · 0.45

Tested by

no test coverage detected