@sasjs/api 0.21.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/build/browser.js +1639 -1605
- package/build/cjs/corpus/identity.js +17 -13
- package/build/cjs/corpus/records.js +46 -26
- package/build/cjs/identity/fixture.js +6 -6
- package/build/cjs/index.js +21 -8
- package/build/esm/corpus/identity.d.ts.map +1 -1
- package/build/esm/corpus/identity.js +17 -13
- package/build/esm/corpus/records.d.ts.map +1 -1
- package/build/esm/corpus/records.js +46 -26
- package/build/esm/identity/fixture.js +6 -6
- package/build/esm/index.d.ts +6 -0
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js +3 -0
- package/package.json +1 -1
|
@@ -7,26 +7,30 @@ exports.SIGNED_IN = {
|
|
|
7
7
|
...fixture_js_1.DEFAULT_IDENTITY,
|
|
8
8
|
tokens: [
|
|
9
9
|
{
|
|
10
|
-
username: '
|
|
10
|
+
username: 'sasjsuser',
|
|
11
11
|
clientId: 'web_app',
|
|
12
12
|
accessToken: 'seed-access',
|
|
13
13
|
refreshToken: 'seed-refresh'
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
|
-
username: '
|
|
16
|
+
username: 'sasjsadmin',
|
|
17
17
|
clientId: 'removed_client',
|
|
18
18
|
accessToken: 'seed-access-orphan',
|
|
19
19
|
refreshToken: 'seed-refresh-orphan'
|
|
20
20
|
}
|
|
21
21
|
],
|
|
22
22
|
codes: [
|
|
23
|
-
{ code: 'seed-code', username: '
|
|
24
|
-
{
|
|
23
|
+
{ code: 'seed-code', username: 'sasjsuser', clientId: 'web_app' },
|
|
24
|
+
{
|
|
25
|
+
code: 'seed-orphan-code',
|
|
26
|
+
username: 'sasjsuser',
|
|
27
|
+
clientId: 'removed_client'
|
|
28
|
+
},
|
|
25
29
|
// the same shape with a pair already issued: the exchange must still refuse,
|
|
26
30
|
// rather than handing back tokens that belong to a client that is gone
|
|
27
31
|
{
|
|
28
32
|
code: 'seed-orphan-pair-code',
|
|
29
|
-
username: '
|
|
33
|
+
username: 'sasjsadmin',
|
|
30
34
|
clientId: 'removed_client'
|
|
31
35
|
}
|
|
32
36
|
]
|
|
@@ -34,11 +38,11 @@ exports.SIGNED_IN = {
|
|
|
34
38
|
/** The same identity, with the restricted user switched off. */
|
|
35
39
|
exports.DEACTIVATED = {
|
|
36
40
|
...exports.SIGNED_IN,
|
|
37
|
-
users: exports.SIGNED_IN.users.map((user) => user.username === '
|
|
41
|
+
users: exports.SIGNED_IN.users.map((user) => user.username === 'sasjsuser' ? { ...user, isActive: false } : user)
|
|
38
42
|
};
|
|
39
43
|
/** The user the seeded session belongs to, without the host's own identifier. */
|
|
40
44
|
const user2 = {
|
|
41
|
-
username: '
|
|
45
|
+
username: 'sasjsuser',
|
|
42
46
|
displayName: 'Demo User',
|
|
43
47
|
isAdmin: false,
|
|
44
48
|
needsToUpdatePassword: false
|
|
@@ -48,13 +52,13 @@ exports.IDENTITY_CORPUS = [
|
|
|
48
52
|
id: 'login',
|
|
49
53
|
route: 'POST /SASLogon/login',
|
|
50
54
|
description: 'signs a seeded user in',
|
|
51
|
-
request: { body: { username: '
|
|
55
|
+
request: { body: { username: 'sasjsadmin', password: 'Orion123' } },
|
|
52
56
|
expect: {
|
|
53
57
|
status: 200,
|
|
54
58
|
partial: {
|
|
55
59
|
loggedIn: true,
|
|
56
60
|
user: {
|
|
57
|
-
username: '
|
|
61
|
+
username: 'sasjsadmin',
|
|
58
62
|
displayName: 'Demo Admin',
|
|
59
63
|
isAdmin: true,
|
|
60
64
|
needsToUpdatePassword: false
|
|
@@ -66,7 +70,7 @@ exports.IDENTITY_CORPUS = [
|
|
|
66
70
|
id: 'login-missing-username',
|
|
67
71
|
route: 'POST /SASLogon/login',
|
|
68
72
|
description: 'refuses a sign-in with no username as 400, naming the field',
|
|
69
|
-
request: { body: { password: '
|
|
73
|
+
request: { body: { password: 'Orion123' } },
|
|
70
74
|
expect: { status: 400, error: '"username" is required' }
|
|
71
75
|
},
|
|
72
76
|
{
|
|
@@ -74,21 +78,21 @@ exports.IDENTITY_CORPUS = [
|
|
|
74
78
|
route: 'POST /SASLogon/login',
|
|
75
79
|
description: 'refuses a deactivated account, naming it',
|
|
76
80
|
identity: exports.DEACTIVATED,
|
|
77
|
-
request: { body: { username: '
|
|
81
|
+
request: { body: { username: 'sasjsuser', password: 'Orion123' } },
|
|
78
82
|
expect: { status: 401, error: 'This account is not active.' }
|
|
79
83
|
},
|
|
80
84
|
{
|
|
81
85
|
id: 'login-wrong-password',
|
|
82
86
|
route: 'POST /SASLogon/login',
|
|
83
87
|
description: 'refuses a wrong password as 401, naming it',
|
|
84
|
-
request: { body: { username: '
|
|
88
|
+
request: { body: { username: 'sasjsadmin', password: 'wrong123' } },
|
|
85
89
|
expect: { status: 401, error: 'Invalid Password.' }
|
|
86
90
|
},
|
|
87
91
|
{
|
|
88
92
|
id: 'login-unknown-user',
|
|
89
93
|
route: 'POST /SASLogon/login',
|
|
90
94
|
description: 'refuses an unknown username as 401, naming it',
|
|
91
|
-
request: { body: { username: 'nobody', password: '
|
|
95
|
+
request: { body: { username: 'nobody', password: 'Orion123' } },
|
|
92
96
|
expect: { status: 401, error: 'Username is not found.' }
|
|
93
97
|
},
|
|
94
98
|
{
|
|
@@ -5,13 +5,13 @@ const fixture_js_1 = require("../identity/fixture.js");
|
|
|
5
5
|
/** The admin and the restricted user, signed in. */
|
|
6
6
|
const SIGNED_IN_TOKENS = [
|
|
7
7
|
{
|
|
8
|
-
username: '
|
|
8
|
+
username: 'sasjsadmin',
|
|
9
9
|
clientId: 'web_app',
|
|
10
10
|
accessToken: 'admin-access',
|
|
11
11
|
refreshToken: 'admin-refresh'
|
|
12
12
|
},
|
|
13
13
|
{
|
|
14
|
-
username: '
|
|
14
|
+
username: 'sasjsuser',
|
|
15
15
|
clientId: 'web_app',
|
|
16
16
|
accessToken: 'user-access',
|
|
17
17
|
refreshToken: 'user-refresh'
|
|
@@ -86,13 +86,13 @@ exports.RECORD_CORPUS = [
|
|
|
86
86
|
body: [
|
|
87
87
|
{
|
|
88
88
|
uid: ADMIN_UID,
|
|
89
|
-
username: '
|
|
89
|
+
username: 'sasjsadmin',
|
|
90
90
|
displayName: 'Demo Admin',
|
|
91
91
|
isAdmin: true
|
|
92
92
|
},
|
|
93
93
|
{
|
|
94
94
|
uid: RESTRICTED_UID,
|
|
95
|
-
username: '
|
|
95
|
+
username: 'sasjsuser',
|
|
96
96
|
displayName: 'Demo User',
|
|
97
97
|
isAdmin: false
|
|
98
98
|
}
|
|
@@ -109,7 +109,7 @@ exports.RECORD_CORPUS = [
|
|
|
109
109
|
status: 200,
|
|
110
110
|
partial: {
|
|
111
111
|
uid: RESTRICTED_UID,
|
|
112
|
-
username: '
|
|
112
|
+
username: 'sasjsuser',
|
|
113
113
|
isActive: true,
|
|
114
114
|
isAdmin: false,
|
|
115
115
|
autoExec: ''
|
|
@@ -137,10 +137,10 @@ exports.RECORD_CORPUS = [
|
|
|
137
137
|
route: 'GET /SASjsApi/user/by/username/{username}',
|
|
138
138
|
description: 'finds an account by username',
|
|
139
139
|
identity: exports.ADMIN_SIGNED_IN,
|
|
140
|
-
request: { token: ADMIN, params: { username: '
|
|
140
|
+
request: { token: ADMIN, params: { username: 'sasjsuser' } },
|
|
141
141
|
expect: {
|
|
142
142
|
status: 200,
|
|
143
|
-
partial: { uid: RESTRICTED_UID, username: '
|
|
143
|
+
partial: { uid: RESTRICTED_UID, username: 'sasjsuser', isAdmin: false }
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
146
|
{
|
|
@@ -148,7 +148,7 @@ exports.RECORD_CORPUS = [
|
|
|
148
148
|
route: 'GET /SASjsApi/user/by/username/{username}',
|
|
149
149
|
description: 'refuses the by-username read with no caller',
|
|
150
150
|
identity: exports.ADMIN_SIGNED_IN,
|
|
151
|
-
request: { params: { username: '
|
|
151
|
+
request: { params: { username: 'sasjsuser' } },
|
|
152
152
|
expect: { status: 401, error: 'Unauthorized' }
|
|
153
153
|
},
|
|
154
154
|
{
|
|
@@ -214,7 +214,11 @@ exports.RECORD_CORPUS = [
|
|
|
214
214
|
identity: exports.ADMIN_SIGNED_IN,
|
|
215
215
|
request: {
|
|
216
216
|
token: ADMIN,
|
|
217
|
-
body: {
|
|
217
|
+
body: {
|
|
218
|
+
username: 'sasjsuser',
|
|
219
|
+
displayName: 'Another',
|
|
220
|
+
password: 'newpass'
|
|
221
|
+
}
|
|
218
222
|
},
|
|
219
223
|
expect: { status: 409, error: 'Username already exists.' }
|
|
220
224
|
},
|
|
@@ -228,8 +232,8 @@ exports.RECORD_CORPUS = [
|
|
|
228
232
|
params: { uid: RESTRICTED_UID },
|
|
229
233
|
body: {
|
|
230
234
|
displayName: 'Renamed User',
|
|
231
|
-
username: '
|
|
232
|
-
password: '
|
|
235
|
+
username: 'sasjsuser',
|
|
236
|
+
password: 'Orion123'
|
|
233
237
|
}
|
|
234
238
|
},
|
|
235
239
|
expect: {
|
|
@@ -245,7 +249,11 @@ exports.RECORD_CORPUS = [
|
|
|
245
249
|
request: {
|
|
246
250
|
token: RESTRICTED,
|
|
247
251
|
params: { uid: ADMIN_UID },
|
|
248
|
-
body: {
|
|
252
|
+
body: {
|
|
253
|
+
displayName: 'Hijacked',
|
|
254
|
+
username: 'sasjsadmin',
|
|
255
|
+
password: 'Orion123'
|
|
256
|
+
}
|
|
249
257
|
},
|
|
250
258
|
expect: { status: 401, error: 'Admin account required' }
|
|
251
259
|
},
|
|
@@ -288,7 +296,11 @@ exports.RECORD_CORPUS = [
|
|
|
288
296
|
request: {
|
|
289
297
|
token: ADMIN,
|
|
290
298
|
params: { uid: RESTRICTED_UID },
|
|
291
|
-
body: {
|
|
299
|
+
body: {
|
|
300
|
+
username: 'sasjsadmin',
|
|
301
|
+
displayName: 'Demo User',
|
|
302
|
+
password: 'Orion123'
|
|
303
|
+
}
|
|
292
304
|
},
|
|
293
305
|
expect: { status: 409, error: 'Username already exists.' }
|
|
294
306
|
},
|
|
@@ -299,15 +311,15 @@ exports.RECORD_CORPUS = [
|
|
|
299
311
|
identity: exports.ADMIN_SIGNED_IN,
|
|
300
312
|
request: {
|
|
301
313
|
token: ADMIN,
|
|
302
|
-
params: { username: '
|
|
314
|
+
params: { username: 'sasjsuser' },
|
|
303
315
|
body: {
|
|
304
316
|
isActive: false,
|
|
305
|
-
username: '
|
|
317
|
+
username: 'sasjsuser',
|
|
306
318
|
displayName: 'Demo User',
|
|
307
|
-
password: '
|
|
319
|
+
password: 'Orion123'
|
|
308
320
|
}
|
|
309
321
|
},
|
|
310
|
-
expect: { status: 200, partial: { username: '
|
|
322
|
+
expect: { status: 200, partial: { username: 'sasjsuser', isActive: false } }
|
|
311
323
|
},
|
|
312
324
|
{
|
|
313
325
|
id: 'update-user-by-username-not-admin',
|
|
@@ -316,8 +328,12 @@ exports.RECORD_CORPUS = [
|
|
|
316
328
|
identity: exports.ADMIN_SIGNED_IN,
|
|
317
329
|
request: {
|
|
318
330
|
token: RESTRICTED,
|
|
319
|
-
params: { username: '
|
|
320
|
-
body: {
|
|
331
|
+
params: { username: 'sasjsadmin' },
|
|
332
|
+
body: {
|
|
333
|
+
displayName: 'Hijacked',
|
|
334
|
+
username: 'sasjsadmin',
|
|
335
|
+
password: 'Orion123'
|
|
336
|
+
}
|
|
321
337
|
},
|
|
322
338
|
expect: { status: 401, error: 'Admin account required' }
|
|
323
339
|
},
|
|
@@ -355,8 +371,12 @@ exports.RECORD_CORPUS = [
|
|
|
355
371
|
identity: exports.ADMIN_SIGNED_IN,
|
|
356
372
|
request: {
|
|
357
373
|
token: ADMIN,
|
|
358
|
-
params: { username: '
|
|
359
|
-
body: {
|
|
374
|
+
params: { username: 'sasjsuser' },
|
|
375
|
+
body: {
|
|
376
|
+
username: 'sasjsadmin',
|
|
377
|
+
displayName: 'Demo User',
|
|
378
|
+
password: 'Orion123'
|
|
379
|
+
}
|
|
360
380
|
},
|
|
361
381
|
expect: { status: 409, error: 'Username already exists.' }
|
|
362
382
|
},
|
|
@@ -391,7 +411,7 @@ exports.RECORD_CORPUS = [
|
|
|
391
411
|
identity: exports.ADMIN_SIGNED_IN,
|
|
392
412
|
request: {
|
|
393
413
|
token: ADMIN,
|
|
394
|
-
params: { username: '
|
|
414
|
+
params: { username: 'sasjsuser' },
|
|
395
415
|
body: {}
|
|
396
416
|
},
|
|
397
417
|
expect: { status: 200, body: 'Account Deleted!' }
|
|
@@ -403,7 +423,7 @@ exports.RECORD_CORPUS = [
|
|
|
403
423
|
identity: exports.ADMIN_SIGNED_IN,
|
|
404
424
|
request: {
|
|
405
425
|
token: RESTRICTED,
|
|
406
|
-
params: { username: '
|
|
426
|
+
params: { username: 'sasjsuser' },
|
|
407
427
|
body: { password: 'wrong123' }
|
|
408
428
|
},
|
|
409
429
|
expect: { status: 401, error: 'Invalid password.' }
|
|
@@ -454,7 +474,7 @@ exports.RECORD_CORPUS = [
|
|
|
454
474
|
users: [
|
|
455
475
|
{
|
|
456
476
|
uid: ADMIN_UID,
|
|
457
|
-
username: '
|
|
477
|
+
username: 'sasjsadmin',
|
|
458
478
|
displayName: 'Demo Admin',
|
|
459
479
|
isAdmin: true
|
|
460
480
|
}
|
|
@@ -1182,7 +1202,7 @@ exports.RECORD_CORPUS = [
|
|
|
1182
1202
|
identity: exports.ADMIN_SIGNED_IN,
|
|
1183
1203
|
request: {
|
|
1184
1204
|
token: RESTRICTED,
|
|
1185
|
-
body: { currentPassword: '
|
|
1205
|
+
body: { currentPassword: 'Orion123', newPassword: 'changed123' }
|
|
1186
1206
|
},
|
|
1187
1207
|
expect: { status: 204 }
|
|
1188
1208
|
},
|
|
@@ -1200,7 +1220,7 @@ exports.RECORD_CORPUS = [
|
|
|
1200
1220
|
description: 'refuses the change with no caller',
|
|
1201
1221
|
identity: exports.ADMIN_SIGNED_IN,
|
|
1202
1222
|
request: {
|
|
1203
|
-
body: { currentPassword: '
|
|
1223
|
+
body: { currentPassword: 'Orion123', newPassword: 'changed123' }
|
|
1204
1224
|
},
|
|
1205
1225
|
expect: { status: 401, error: 'Unauthorized' }
|
|
1206
1226
|
},
|
|
@@ -19,20 +19,20 @@ exports.DEFAULT_IDENTITY = {
|
|
|
19
19
|
users: [
|
|
20
20
|
{
|
|
21
21
|
uid: 'user-admin',
|
|
22
|
-
username: '
|
|
22
|
+
username: 'sasjsadmin',
|
|
23
23
|
displayName: 'Demo Admin',
|
|
24
24
|
// long enough to pass the API's own password rule (six characters), so a
|
|
25
25
|
// demo can sign in against a real server as well as a mock
|
|
26
|
-
password: '
|
|
26
|
+
password: 'Orion123',
|
|
27
27
|
isAdmin: true,
|
|
28
28
|
isActive: true,
|
|
29
29
|
needsToUpdatePassword: false
|
|
30
30
|
},
|
|
31
31
|
{
|
|
32
32
|
uid: 'user-restricted',
|
|
33
|
-
username: '
|
|
33
|
+
username: 'sasjsuser',
|
|
34
34
|
displayName: 'Demo User',
|
|
35
|
-
password: '
|
|
35
|
+
password: 'Orion123',
|
|
36
36
|
isAdmin: false,
|
|
37
37
|
isActive: true,
|
|
38
38
|
needsToUpdatePassword: false
|
|
@@ -44,14 +44,14 @@ exports.DEFAULT_IDENTITY = {
|
|
|
44
44
|
name: 'DCGroup',
|
|
45
45
|
description: 'Data Controller users',
|
|
46
46
|
isActive: true,
|
|
47
|
-
users: ['
|
|
47
|
+
users: ['sasjsuser']
|
|
48
48
|
},
|
|
49
49
|
{
|
|
50
50
|
uid: 'group-admins',
|
|
51
51
|
name: 'Admins',
|
|
52
52
|
description: 'Everything the API offers',
|
|
53
53
|
isActive: true,
|
|
54
|
-
users: ['
|
|
54
|
+
users: ['sasjsadmin']
|
|
55
55
|
}
|
|
56
56
|
],
|
|
57
57
|
permissions: [
|
package/build/cjs/index.js
CHANGED
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.
|
|
18
|
-
exports.servicesFor = exports.runCase = exports.PROVIDER_MANAGED = exports.ADMIN_SIGNED_IN = exports.RECORD_CORPUS = exports.unpublishAppStream = exports.MemoryAppStreamRegistry = exports.RUNTIME_CORPUS = exports.MemorySessionRunner = exports.createRuntimeService = exports.DOCUMENTED_RUN_TIMES = void 0;
|
|
17
|
+
exports.DEFAULT_IDENTITY = exports.MemoryIdentityStore = exports.createDirectoryService = exports.normaliseLogFiles = exports.normaliseDiagnostics = exports.logLines = exports.createAdminService = exports.checkLogFileName = exports.MAX_LOG_LINES = exports.DEFAULT_LOG_LINES = exports.normaliseAuthConfig = exports.createAuthConfigService = exports.normaliseInfo = exports.createInfoService = exports.BROWSER_INFO = exports.withBundleVersion = exports.createHomeService = exports.NO_WEB_BUILD = exports.BUNDLE_NAME = exports.HOME_CORPUS = exports.DIRECTORY_CORPUS = exports.AUTH_CONFIG_CORPUS = exports.ADMIN_CORPUS = exports.INFO_CORPUS = exports.CODE_CORPUS = exports.sanitiseDisplayName = exports.createRecordService = exports.createIdentityService = exports.HANDLED_ROUTES = exports.dispatch = exports.TAG_CAPABILITIES = exports.OVERLAY = exports.findRoute = exports.routeById = exports.ROUTES = exports.MemoryDriveStore = exports.measureDeployTree = exports.isDeployTree = exports.deployTree = exports.decodeBase64 = exports.checkDeployTree = exports.DEPLOY_SUCCESS = exports.DEPLOY_PAYLOAD_BYTES = exports.DEPLOY_LIMITS = exports.createDriveService = exports.isRoot = exports.basename = exports.dirname = exports.hasBlockedExtension = exports.normaliseDrivePath = void 0;
|
|
18
|
+
exports.servicesFor = exports.runCase = exports.PROVIDER_MANAGED = exports.ADMIN_SIGNED_IN = exports.RECORD_CORPUS = exports.unpublishAppStream = exports.MemoryAppStreamRegistry = exports.RUNTIME_CORPUS = exports.MemorySessionRunner = exports.createRuntimeService = exports.DOCUMENTED_RUN_TIMES = exports.CODE_DEBUG = exports.MemorySessionHost = exports.DEFAULT_SESSIONS = exports.createSessionService = exports.SESSION_CORPUS = exports.DEPLOY_CORPUS = exports.IDENTITY_CORPUS = exports.DRIVE_CORPUS = exports.parseIdentity = exports.IDENTITY_FORMAT = void 0;
|
|
19
19
|
/**
|
|
20
20
|
* `@sasjs/api` - the SASjs Server API described once.
|
|
21
21
|
*
|
|
@@ -89,6 +89,19 @@ var service_js_4 = require("./info/service.js");
|
|
|
89
89
|
Object.defineProperty(exports, "BROWSER_INFO", { enumerable: true, get: function () { return service_js_4.BROWSER_INFO; } });
|
|
90
90
|
Object.defineProperty(exports, "createInfoService", { enumerable: true, get: function () { return service_js_4.createInfoService; } });
|
|
91
91
|
Object.defineProperty(exports, "normaliseInfo", { enumerable: true, get: function () { return service_js_4.normaliseInfo; } });
|
|
92
|
+
var service_js_5 = require("./authconfig/service.js");
|
|
93
|
+
Object.defineProperty(exports, "createAuthConfigService", { enumerable: true, get: function () { return service_js_5.createAuthConfigService; } });
|
|
94
|
+
Object.defineProperty(exports, "normaliseAuthConfig", { enumerable: true, get: function () { return service_js_5.normaliseAuthConfig; } });
|
|
95
|
+
var service_js_6 = require("./admin/service.js");
|
|
96
|
+
Object.defineProperty(exports, "DEFAULT_LOG_LINES", { enumerable: true, get: function () { return service_js_6.DEFAULT_LOG_LINES; } });
|
|
97
|
+
Object.defineProperty(exports, "MAX_LOG_LINES", { enumerable: true, get: function () { return service_js_6.MAX_LOG_LINES; } });
|
|
98
|
+
Object.defineProperty(exports, "checkLogFileName", { enumerable: true, get: function () { return service_js_6.checkLogFileName; } });
|
|
99
|
+
Object.defineProperty(exports, "createAdminService", { enumerable: true, get: function () { return service_js_6.createAdminService; } });
|
|
100
|
+
Object.defineProperty(exports, "logLines", { enumerable: true, get: function () { return service_js_6.logLines; } });
|
|
101
|
+
Object.defineProperty(exports, "normaliseDiagnostics", { enumerable: true, get: function () { return service_js_6.normaliseDiagnostics; } });
|
|
102
|
+
Object.defineProperty(exports, "normaliseLogFiles", { enumerable: true, get: function () { return service_js_6.normaliseLogFiles; } });
|
|
103
|
+
var service_js_7 = require("./directory/service.js");
|
|
104
|
+
Object.defineProperty(exports, "createDirectoryService", { enumerable: true, get: function () { return service_js_7.createDirectoryService; } });
|
|
92
105
|
var memory_store_js_2 = require("./identity/memory-store.js");
|
|
93
106
|
Object.defineProperty(exports, "MemoryIdentityStore", { enumerable: true, get: function () { return memory_store_js_2.MemoryIdentityStore; } });
|
|
94
107
|
var fixture_js_1 = require("./identity/fixture.js");
|
|
@@ -103,15 +116,15 @@ var deploy_js_2 = require("./corpus/deploy.js");
|
|
|
103
116
|
Object.defineProperty(exports, "DEPLOY_CORPUS", { enumerable: true, get: function () { return deploy_js_2.DEPLOY_CORPUS; } });
|
|
104
117
|
var session_js_1 = require("./corpus/session.js");
|
|
105
118
|
Object.defineProperty(exports, "SESSION_CORPUS", { enumerable: true, get: function () { return session_js_1.SESSION_CORPUS; } });
|
|
106
|
-
var
|
|
107
|
-
Object.defineProperty(exports, "createSessionService", { enumerable: true, get: function () { return
|
|
119
|
+
var service_js_8 = require("./session/service.js");
|
|
120
|
+
Object.defineProperty(exports, "createSessionService", { enumerable: true, get: function () { return service_js_8.createSessionService; } });
|
|
108
121
|
var memory_host_js_1 = require("./session/memory-host.js");
|
|
109
122
|
Object.defineProperty(exports, "DEFAULT_SESSIONS", { enumerable: true, get: function () { return memory_host_js_1.DEFAULT_SESSIONS; } });
|
|
110
123
|
Object.defineProperty(exports, "MemorySessionHost", { enumerable: true, get: function () { return memory_host_js_1.MemorySessionHost; } });
|
|
111
|
-
var
|
|
112
|
-
Object.defineProperty(exports, "CODE_DEBUG", { enumerable: true, get: function () { return
|
|
113
|
-
Object.defineProperty(exports, "DOCUMENTED_RUN_TIMES", { enumerable: true, get: function () { return
|
|
114
|
-
Object.defineProperty(exports, "createRuntimeService", { enumerable: true, get: function () { return
|
|
124
|
+
var service_js_9 = require("./runtime/service.js");
|
|
125
|
+
Object.defineProperty(exports, "CODE_DEBUG", { enumerable: true, get: function () { return service_js_9.CODE_DEBUG; } });
|
|
126
|
+
Object.defineProperty(exports, "DOCUMENTED_RUN_TIMES", { enumerable: true, get: function () { return service_js_9.DOCUMENTED_RUN_TIMES; } });
|
|
127
|
+
Object.defineProperty(exports, "createRuntimeService", { enumerable: true, get: function () { return service_js_9.createRuntimeService; } });
|
|
115
128
|
var memory_runner_js_1 = require("./runtime/memory-runner.js");
|
|
116
129
|
Object.defineProperty(exports, "MemorySessionRunner", { enumerable: true, get: function () { return memory_runner_js_1.MemorySessionRunner; } });
|
|
117
130
|
var runtime_js_1 = require("./corpus/runtime.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/corpus/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE/E,oEAAoE;AACpE,eAAO,MAAM,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"identity.d.ts","sourceRoot":"","sources":["../../../src/corpus/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAoB,KAAK,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAE/E,oEAAoE;AACpE,eAAO,MAAM,SAAS,EAAE,eA+BvB,CAAA;AAED,gEAAgE;AAChE,eAAO,MAAM,WAAW,EAAE,eAKzB,CAAA;AAUD,eAAO,MAAM,eAAe,EAAE,UAAU,EAkOvC,CAAA"}
|
|
@@ -4,26 +4,30 @@ export const SIGNED_IN = {
|
|
|
4
4
|
...DEFAULT_IDENTITY,
|
|
5
5
|
tokens: [
|
|
6
6
|
{
|
|
7
|
-
username: '
|
|
7
|
+
username: 'sasjsuser',
|
|
8
8
|
clientId: 'web_app',
|
|
9
9
|
accessToken: 'seed-access',
|
|
10
10
|
refreshToken: 'seed-refresh'
|
|
11
11
|
},
|
|
12
12
|
{
|
|
13
|
-
username: '
|
|
13
|
+
username: 'sasjsadmin',
|
|
14
14
|
clientId: 'removed_client',
|
|
15
15
|
accessToken: 'seed-access-orphan',
|
|
16
16
|
refreshToken: 'seed-refresh-orphan'
|
|
17
17
|
}
|
|
18
18
|
],
|
|
19
19
|
codes: [
|
|
20
|
-
{ code: 'seed-code', username: '
|
|
21
|
-
{
|
|
20
|
+
{ code: 'seed-code', username: 'sasjsuser', clientId: 'web_app' },
|
|
21
|
+
{
|
|
22
|
+
code: 'seed-orphan-code',
|
|
23
|
+
username: 'sasjsuser',
|
|
24
|
+
clientId: 'removed_client'
|
|
25
|
+
},
|
|
22
26
|
// the same shape with a pair already issued: the exchange must still refuse,
|
|
23
27
|
// rather than handing back tokens that belong to a client that is gone
|
|
24
28
|
{
|
|
25
29
|
code: 'seed-orphan-pair-code',
|
|
26
|
-
username: '
|
|
30
|
+
username: 'sasjsadmin',
|
|
27
31
|
clientId: 'removed_client'
|
|
28
32
|
}
|
|
29
33
|
]
|
|
@@ -31,11 +35,11 @@ export const SIGNED_IN = {
|
|
|
31
35
|
/** The same identity, with the restricted user switched off. */
|
|
32
36
|
export const DEACTIVATED = {
|
|
33
37
|
...SIGNED_IN,
|
|
34
|
-
users: SIGNED_IN.users.map((user) => user.username === '
|
|
38
|
+
users: SIGNED_IN.users.map((user) => user.username === 'sasjsuser' ? { ...user, isActive: false } : user)
|
|
35
39
|
};
|
|
36
40
|
/** The user the seeded session belongs to, without the host's own identifier. */
|
|
37
41
|
const user2 = {
|
|
38
|
-
username: '
|
|
42
|
+
username: 'sasjsuser',
|
|
39
43
|
displayName: 'Demo User',
|
|
40
44
|
isAdmin: false,
|
|
41
45
|
needsToUpdatePassword: false
|
|
@@ -45,13 +49,13 @@ export const IDENTITY_CORPUS = [
|
|
|
45
49
|
id: 'login',
|
|
46
50
|
route: 'POST /SASLogon/login',
|
|
47
51
|
description: 'signs a seeded user in',
|
|
48
|
-
request: { body: { username: '
|
|
52
|
+
request: { body: { username: 'sasjsadmin', password: 'Orion123' } },
|
|
49
53
|
expect: {
|
|
50
54
|
status: 200,
|
|
51
55
|
partial: {
|
|
52
56
|
loggedIn: true,
|
|
53
57
|
user: {
|
|
54
|
-
username: '
|
|
58
|
+
username: 'sasjsadmin',
|
|
55
59
|
displayName: 'Demo Admin',
|
|
56
60
|
isAdmin: true,
|
|
57
61
|
needsToUpdatePassword: false
|
|
@@ -63,7 +67,7 @@ export const IDENTITY_CORPUS = [
|
|
|
63
67
|
id: 'login-missing-username',
|
|
64
68
|
route: 'POST /SASLogon/login',
|
|
65
69
|
description: 'refuses a sign-in with no username as 400, naming the field',
|
|
66
|
-
request: { body: { password: '
|
|
70
|
+
request: { body: { password: 'Orion123' } },
|
|
67
71
|
expect: { status: 400, error: '"username" is required' }
|
|
68
72
|
},
|
|
69
73
|
{
|
|
@@ -71,21 +75,21 @@ export const IDENTITY_CORPUS = [
|
|
|
71
75
|
route: 'POST /SASLogon/login',
|
|
72
76
|
description: 'refuses a deactivated account, naming it',
|
|
73
77
|
identity: DEACTIVATED,
|
|
74
|
-
request: { body: { username: '
|
|
78
|
+
request: { body: { username: 'sasjsuser', password: 'Orion123' } },
|
|
75
79
|
expect: { status: 401, error: 'This account is not active.' }
|
|
76
80
|
},
|
|
77
81
|
{
|
|
78
82
|
id: 'login-wrong-password',
|
|
79
83
|
route: 'POST /SASLogon/login',
|
|
80
84
|
description: 'refuses a wrong password as 401, naming it',
|
|
81
|
-
request: { body: { username: '
|
|
85
|
+
request: { body: { username: 'sasjsadmin', password: 'wrong123' } },
|
|
82
86
|
expect: { status: 401, error: 'Invalid Password.' }
|
|
83
87
|
},
|
|
84
88
|
{
|
|
85
89
|
id: 'login-unknown-user',
|
|
86
90
|
route: 'POST /SASLogon/login',
|
|
87
91
|
description: 'refuses an unknown username as 401, naming it',
|
|
88
|
-
request: { body: { username: 'nobody', password: '
|
|
92
|
+
request: { body: { username: 'nobody', password: 'Orion123' } },
|
|
89
93
|
expect: { status: 401, error: 'Username is not found.' }
|
|
90
94
|
},
|
|
91
95
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../src/corpus/records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAA;AAkB/B,qFAAqF;AACrF,eAAO,MAAM,eAAe,EAAE,eAG7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,eA0C9B,CAAA;AAOD,eAAO,MAAM,aAAa,EAAE,UAAU,
|
|
1
|
+
{"version":3,"file":"records.d.ts","sourceRoot":"","sources":["../../../src/corpus/records.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAEL,KAAK,eAAe,EAErB,MAAM,wBAAwB,CAAA;AAkB/B,qFAAqF;AACrF,eAAO,MAAM,eAAe,EAAE,eAG7B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,gBAAgB,EAAE,eA0C9B,CAAA;AAOD,eAAO,MAAM,aAAa,EAAE,UAAU,EAyqCrC,CAAA"}
|