Add site manager and initial validation
[arvados-workbench2.git] / src / validators / is-remote-host.tsx
diff --git a/src/validators/is-remote-host.tsx b/src/validators/is-remote-host.tsx
new file mode 100644 (file)
index 0000000..b5e2231
--- /dev/null
@@ -0,0 +1,10 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+
+const ERROR_MESSAGE = 'Remote host is invalid';
+
+export const isRemoteHost = (value: string) => {
+    return value.match(/\w+\.\w+\.\w+/i) ? undefined : ERROR_MESSAGE;
+};