(username string)
| 311 | } |
| 312 | |
| 313 | func isUsernameValid(username string) bool { |
| 314 | // assuming valid usernames are alphanumeric, with these special characters allowed: . _ - |
| 315 | var validUsernamePattern = `^[a-zA-Z0-9_][-.a-zA-Z0-9_]*$` |
| 316 | re := regexp.MustCompile(validUsernamePattern) |
| 317 | return re.MatchString(username) |
| 318 | } |
| 319 | |
| 320 | // Ensures that the Jupyter server URL is valid and points to a loopback http(s) URL |
| 321 | func isJupyterServerURLValid(serverURL string) bool { |
no outgoing calls
no test coverage detected