validateAPIIdentifier returns an error if identifier is not a valid http:// or https:// URL.
(identifier string)
| 1414 | |
| 1415 | // validateAPIIdentifier returns an error if identifier is not a valid http:// or https:// URL. |
| 1416 | func validateAPIIdentifier(identifier string) error { |
| 1417 | u, err := url.ParseRequestURI(identifier) |
| 1418 | if err != nil { |
| 1419 | return fmt.Errorf("invalid API identifier %q: must be a valid URI (e.g. https://my-api)", identifier) |
| 1420 | } |
| 1421 | if u.Scheme == "" || u.Host == "" { |
| 1422 | return fmt.Errorf("invalid API identifier %q: must include a scheme and host (e.g. https://my-api)", identifier) |
| 1423 | } |
| 1424 | return nil |
| 1425 | } |
| 1426 | |
| 1427 | func generateClient(input SetupInputs, reqParams auth0.RequestParams) (*management.Client, error) { |
| 1428 | if input.Name == "" { |