Description
Bad escaped character in advanced user-to-dn mapping leads to confusing behavior - no error is displayed in UI. Console shows a stacktrace though, but it is not user friendly.
This could be a very annoying issue because it is very likely that something like "\." will be used in regular expressions (user by mistake uses single backslash instead of double backslash). At the same time it should be super easy to fix. Marking it critical for these two reasons.
How to reproduce:
1. Use "\." in advanced user mapping. For example:
[{"match": "(.+)@domain\.net", "substitution": "cn={0}"}]
|
2. Press "Test User Authentication"
3. UI doesn't complain (nothing happens) and stacktrace can be seen in the browser console.
Stacktrace:
index-729b989c.js:15574 SyntaxError: Bad escaped character in JSON at position 27 (line 3 column 23)
|
at JSON.parse (<anonymous>)
|
at getUserDnMapping (mn_add_ldap_dialog_controller.js:217:47)
|
at getAuthenticationSettings (mn_add_ldap_dialog_controller.js:261:30)
|
at mnAddLDAPDialogController.checkAuthentication (mn_add_ldap_dialog_controller.js:314:34)
|
at fn (eval at compile (index-729b989c.js:16425:15), <anonymous>:4:217)
|
at callback (index-729b989c.js:28958:13)
|
at ChildScope.$eval (index-729b989c.js:19400:23)
|
at ChildScope.$apply (index-729b989c.js:19499:25)
|
at HTMLButtonElement.<anonymous> (index-729b989c.js:28962:19)
|
at defaultHandlerWrapper (index-729b989c.js:3890:11) undefined
|
(anonymous) @ index-729b989c.js:15574
|
(anonymous) @ index-729b989c.js:11853
|
(anonymous) @ mn_exception_reporter.js:45
|
$apply @ index-729b989c.js:19504
|
(anonymous) @ index-729b989c.js:28962
|
defaultHandlerWrapper @ index-729b989c.js:3890
|
eventHandler @ index-729b989c.js:3878
|
e.invokeTask @ zone.js:19
|
onInvokeTask @ core.js:25903
|
e.invokeTask @ zone.js:19
|
t.runTask @ zone.js:19
|
t.invokeTask @ zone.js:19
|
_ @ zone.js:50
|
m @ zone.js:50
|
I think the correct behavior in this case is showing and error message about invalid json.
Attachments
For Gerrit Dashboard: MB-60050 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
203647,3 | MB-60050: add validation for advanced user-to-dn-mapping | 7.6.0 | ns_server | Status: MERGED | +2 | +1 |
203677,1 | Merge remote-tracking branch 'couchbase/7.6.0' | master | ns_server | Status: ABANDONED | 0 | -1 |
203750,1 | MB-60050: add validation for advanced user-to-dn-mapping | master | ns_server | Status: ABANDONED | 0 | 0 |
203761,1 | Merge remote-tracking branch 'couchbase/7.6.0' into trinity | trinity | ns_server | Status: MERGED | +2 | +1 |
203786,3 | Merge branch 'couchbase/trinity' into master | master | ns_server | Status: MERGED | +2 | +1 |