Browse Source

Add field validation

 * LDAP domain
 * LDAP URL
 * LDAP User Password

Change-Id: Idaf3e0ed28eb1134eb20f4c9f1818cb7efce4002
vsaienko 3 years ago
parent
commit
3390610008
1 changed files with 9 additions and 0 deletions
  1. 9
    0
      environment_config.yaml

+ 9
- 0
environment_config.yaml View File

@@ -5,12 +5,18 @@ attributes:
5 5
     description: 'LDAP domain name'
6 6
     weight: 20
7 7
     type: "text"
8
+    regex:
9
+      source: '^[a-zA-Z0-9._-]+$'
10
+      error: "Domain do not match regex, e.g.: 'example.com' ."
8 11
   url:
9 12
     value: ''
10 13
     label: 'LDAP URL'
11 14
     description: 'URL for connecting to the LDAP server.'
12 15
     weight: 25
13 16
     type: "text"
17
+    regex:
18
+      source: '^ldap:\/\/([a-zA-Z0-9._-]+)(:[0-9]+)?$'
19
+      error: "LDAP URL do not match regex, e.g.: 'ldap://example.com' ."
14 20
   suffix:
15 21
     value: 'cn=example,cn=com'
16 22
     label: 'LDAP Suffix'
@@ -29,6 +35,9 @@ attributes:
29 35
     description: 'Password for the BindDN to query the LDAP server.'
30 36
     weight: 35
31 37
     type: "password"
38
+    regex:
39
+      source: '^\S+$'
40
+      error: "Plesase remove spaces."
32 41
   query_scope:
33 42
     value: 'one'
34 43
     label: 'LDAP Query Scope'

Loading…
Cancel
Save