Skip to content

Commit c026cdf

Browse files
committed
test docs: fix auth test cases — correct REST basic syntax, add non-interactive login
1 parent ebb9965 commit c026cdf

2 files changed

Lines changed: 17 additions & 14 deletions

File tree

docs/15-testing/cli-commands-test-cases.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -271,21 +271,29 @@ mxcli setup mxcli
271271

272272
## 7. mxcli auth
273273

274-
### 7.1 Login
274+
### 7.1 Login (interactive)
275275

276276
```bash
277277
mxcli auth login
278278
```
279279

280-
**Expected:** Opens browser for Mendix SSO. Stores token locally. Prints "Logged in as <email>". Exit code `0`.
280+
**Expected:** Prompts for PAT (or opens browser). Stores token locally. Prints confirmation. Exit code `0`.
281281

282-
### 7.2 Check status
282+
### 7.1b Login (non-interactive)
283+
284+
```bash
285+
mxcli auth login --token "$MENDIX_PAT"
286+
```
287+
288+
**Expected:** Validates token against marketplace API. Stores credential. Prints confirmation. Exit code `0`.
289+
290+
### 7.2 Check status (not authenticated)
283291

284292
```bash
285293
mxcli auth status
286294
```
287295

288-
**Expected:** Prints current auth state (logged in/out, username, token expiry). Exit code `0` if authenticated, `1` if not authenticated.
296+
**Expected:** Reports "no credential for profile". Exit code `1`.
289297

290298
### 7.3 List accounts
291299

@@ -301,7 +309,7 @@ mxcli auth list
301309
mxcli auth logout
302310
```
303311

304-
**Expected:** Removes stored token. Prints confirmation. Exit code `0`.
312+
**Expected:** Removes stored token. Prints "Removed profile". Exit code `0` (succeeds even when not logged in).
305313

306314
### 7.5 Status after logout
307315

docs/15-testing/integration-test-cases.md

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ create odata client MyModule.AuthClient (
123123
);
124124
```
125125

126-
**Expected:** Authentication set to basic. Roundtrips via DESCRIBE.
126+
**Expected:** OData client created (may warn about unreachable metadata URL). Note: `Authentication: basic` is accepted by the parser but not shown in DESCRIBE output — only Timeout appears.
127127

128128
### 3.4 Duplicate without OR MODIFY
129129

@@ -1156,16 +1156,11 @@ create rest client MyModule.ExternalAPI (
11561156
```
11571157
create rest client MyModule.AuthAPI (
11581158
BaseUrl: 'https://secure.example.com/api',
1159-
Authentication: basic
1160-
)
1161-
operation Ping
1162-
method GET
1163-
path '/ping'
1164-
timeout 10
1165-
end operation;
1159+
Authentication: basic (Username: 'user', Password: 'pass')
1160+
);
11661161
```
11671162

1168-
**Expected:** Authentication set to basic. Roundtrips via DESCRIBE.
1163+
**Expected:** REST client created with `Authentication: basic (...)`. Roundtrips via DESCRIBE.
11691164

11701165
### 29.3 With query parameters
11711166

0 commit comments

Comments
 (0)