Add site manager and initial validation
[arvados-workbench2.git] / src / validators / validators.tsx
index 37c1bd37458dc50cd293d4f9c9bf85ad2cb7311f..06f46219414317b94ebeb7d25a25810e750d8920 100644 (file)
@@ -4,6 +4,8 @@
 
 import { require } from './require';
 import { maxLength } from './max-length';
+import { isRsaKey } from './is-rsa-key';
+import { isRemoteHost } from "./is-remote-host";
 
 export const TAG_KEY_VALIDATION = [require, maxLength(255)];
 export const TAG_VALUE_VALIDATION = [require, maxLength(255)];
@@ -21,4 +23,9 @@ export const MOVE_TO_VALIDATION = [require];
 
 export const PROCESS_NAME_VALIDATION = [require, maxLength(255)];
 
-export const REPOSITORY_NAME_VALIDATION = [require, maxLength(255)];
\ No newline at end of file
+export const REPOSITORY_NAME_VALIDATION = [require, maxLength(255)];
+
+export const SSH_KEY_PUBLIC_VALIDATION = [require, isRsaKey, maxLength(1024)];
+export const SSH_KEY_NAME_VALIDATION = [require, maxLength(255)];
+
+export const SITE_MANAGER_REMOTE_HOST_VALIDATION = [require, isRemoteHost, maxLength(255)];