in config/endpoint.go [108:124]
func (e *ServiceControlEndpoint) Validate(c *Config) error {
if err := validateGcpKey(c.Identities, "servicecontrol", e.Identity); err != nil {
return err
}
if e.ServiceName == "" {
return errors.New("servicecontrol: missing service name")
}
if e.ConsumerId == "" {
return errors.New("servicecontrol: missing consumer ID")
}
if !(strings.HasPrefix(e.ConsumerId, "project:") ||
strings.HasPrefix(e.ConsumerId, "project_number:") ||
strings.HasPrefix(e.ConsumerId, "apiKey:")) {
return errors.New(`servicecontrol: invalid consumer ID (must start with "project:", "projectNumber:", or "apiKey:")`)
}
return nil
}