Commit 2abe6ad
fix: REST client BASIC auth uses Rest\$ConstantValue with correct BSON key (#200)
Three root causes found and fixed:
1. Studio Pro requires Rest\$ConstantValue for BASIC auth credentials,
not Rest\$StringValue. Using StringValue causes InvalidCastException
when opening the document and 401 at runtime because the auth header
is never sent.
2. The BSON field name for the constant reference is "Value" (matching
the metamodel), not "Constant" (which was an incorrect guess). With
the wrong key, Mendix can't resolve the constant → CE7073.
3. When literal strings are provided for auth credentials (e.g.,
Password: 'secret'), the executor now auto-creates string constants
(Module.ClientName_Username / _Password) so the BSON always contains
Rest\$ConstantValue references. This is transparent to the user.
Also adds missing ExportLevel, Tags, Timeout, BaseUrlParameter, and
OpenApiFile fields that Studio Pro always populates on REST clients.
Test case: mdl-examples/bug-tests/200-basic-auth-rest-client.mdl
creates a REST client pointing at httpbin.org/basic-auth with a test
page for side-by-side comparison of REST client auth vs inline REST
CALL auth.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 8b44a5a commit 2abe6ad
File tree
6 files changed
+3914
-3853
lines changed- mdl-examples/bug-tests
- mdl
- executor
- grammar
- parser
- visitor
6 files changed
+3914
-3853
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
124 | | - | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
| |||
545 | 547 | | |
546 | 548 | | |
547 | 549 | | |
| 550 | + | |
548 | 551 | | |
549 | 552 | | |
550 | | - | |
| 553 | + | |
551 | 554 | | |
552 | 555 | | |
553 | 556 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2427 | 2427 | | |
2428 | 2428 | | |
2429 | 2429 | | |
2430 | | - | |
| 2430 | + | |
| 2431 | + | |
2431 | 2432 | | |
2432 | 2433 | | |
2433 | 2434 | | |
| |||
Large diffs are not rendered by default.
0 commit comments