@sasjs/api 0.48.1 → 0.49.1
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 -0
- package/build/browser.js +204 -56
- package/build/cjs/appstream/identity.js +2 -31
- package/build/cjs/corpus/viya/replay.js +117 -0
- package/build/cjs/index.js +6 -3
- package/build/cjs/uuid.js +30 -0
- package/build/cjs/viya/compute.js +38 -20
- package/build/cjs/viya/dispatch.js +10 -0
- package/build/cjs/viya/seed.js +34 -8
- package/build/cjs/viya/service.js +55 -11
- package/build/cjs/viya/sessions.js +24 -10
- package/build/esm/appstream/identity.d.ts +1 -9
- package/build/esm/appstream/identity.d.ts.map +1 -1
- package/build/esm/appstream/identity.js +1 -30
- package/build/esm/corpus/viya/replay.d.ts +53 -0
- package/build/esm/corpus/viya/replay.d.ts.map +1 -0
- package/build/esm/corpus/viya/replay.js +112 -0
- package/build/esm/identity/types.d.ts +2 -0
- package/build/esm/identity/types.d.ts.map +1 -1
- package/build/esm/index.d.ts +2 -0
- package/build/esm/index.d.ts.map +1 -1
- package/build/esm/index.js +1 -0
- package/build/esm/uuid.d.ts +6 -0
- package/build/esm/uuid.d.ts.map +1 -0
- package/build/esm/uuid.js +26 -0
- package/build/esm/viya/compute.d.ts.map +1 -1
- package/build/esm/viya/compute.js +39 -21
- package/build/esm/viya/dispatch.d.ts +3 -0
- package/build/esm/viya/dispatch.d.ts.map +1 -1
- package/build/esm/viya/dispatch.js +11 -1
- package/build/esm/viya/seed.d.ts +29 -7
- package/build/esm/viya/seed.d.ts.map +1 -1
- package/build/esm/viya/seed.js +32 -7
- package/build/esm/viya/service.d.ts.map +1 -1
- package/build/esm/viya/service.js +55 -11
- package/build/esm/viya/sessions.d.ts +24 -6
- package/build/esm/viya/sessions.d.ts.map +1 -1
- package/build/esm/viya/sessions.js +24 -10
- package/package.json +1 -1
package/build/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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,EACL,gBAAgB,EAChB,WAAW,EACX,SAAS,EACT,eAAe,EACf,cAAc,EACd,yBAAyB,EACzB,UAAU,EACX,MAAM,oBAAoB,CAAA;AAC3B,YAAY,EACV,SAAS,EACT,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,EACpB,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA"}
|
package/build/esm/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export { dispatchViya, findViyaOperation } from './viya/dispatch.js';
|
|
|
31
31
|
export { VIYA_OVERLAY } from './viya/overlay.js';
|
|
32
32
|
export { VIYA_HANDLERS } from './viya/service.js';
|
|
33
33
|
export { VIYA_CORPUS } from './corpus/viya/operations.js';
|
|
34
|
+
export { requestFor, shapeMismatches } from './corpus/viya/replay.js';
|
|
34
35
|
export { dispatch, HANDLED_ROUTES } from './host/dispatch.js';
|
|
35
36
|
// a host gating its own middleware reads the same decision the inventory reports
|
|
36
37
|
export * from './identity/routeAccess.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uuid.d.ts","sourceRoot":"","sources":["../../src/uuid.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,SAAS,QAAO,MAkC5B,CAAA"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A UUID v4 for Node and browser workers. Where `randomUUID` is unavailable,
|
|
3
|
+
* build it from `getRandomValues`; do not fall back to weaker randomness.
|
|
4
|
+
*/
|
|
5
|
+
export const newUuidV4 = () => {
|
|
6
|
+
const webCrypto = globalThis.crypto;
|
|
7
|
+
if (typeof webCrypto?.randomUUID === 'function')
|
|
8
|
+
return webCrypto.randomUUID();
|
|
9
|
+
if (typeof webCrypto?.getRandomValues !== 'function')
|
|
10
|
+
throw new Error('No cryptographic source of randomness is available.');
|
|
11
|
+
const bytes = new Uint8Array(16);
|
|
12
|
+
webCrypto.getRandomValues(bytes);
|
|
13
|
+
// version 4, variant 10xx
|
|
14
|
+
bytes[6] = (bytes[6] & 0x0f) | 0x40;
|
|
15
|
+
bytes[8] = (bytes[8] & 0x3f) | 0x80;
|
|
16
|
+
const hex = Array.from(bytes)
|
|
17
|
+
.map((byte) => byte.toString(16).padStart(2, '0'))
|
|
18
|
+
.join('');
|
|
19
|
+
return [
|
|
20
|
+
hex.slice(0, 8),
|
|
21
|
+
hex.slice(8, 12),
|
|
22
|
+
hex.slice(12, 16),
|
|
23
|
+
hex.slice(16, 20),
|
|
24
|
+
hex.slice(20)
|
|
25
|
+
].join('-');
|
|
26
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../../src/viya/compute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../../src/viya/compute.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAMnD;;;;;;;;;GASG;AACH,eAAO,MAAM,oBAAoB,sCAAsC,CAAA;AAEvE,2EAA2E;AAC3E,eAAO,MAAM,mBAAmB,QAAuC,CAAA;AAgDvE;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GAAI,QAAQ,MAAM,GAAG,SAAS,KAAG,MAM5D,CAAA;AAyID,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,MAAM,EACN,CAAC,OAAO,EAAE;IACR,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;QAC1C,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,KAAK,OAAO,CAAC,WAAW,CAAC,CAiN3B,CAAA"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ApiError } from '../types.js';
|
|
2
|
-
import { normaliseServerUrl } from './seed.js';
|
|
3
|
-
import { seedOf } from './seed.js';
|
|
2
|
+
import { estateKeyOf, normaliseServerUrl, seedOf } from './seed.js';
|
|
4
3
|
import { estateFor } from './sessions.js';
|
|
5
4
|
import { idFor, callerId } from './ids.js';
|
|
6
5
|
/**
|
|
@@ -51,7 +50,7 @@ const linksFor = (uri, type, collection = false, itemType = false) => [
|
|
|
51
50
|
...(itemType ? { itemType: type } : {})
|
|
52
51
|
}
|
|
53
52
|
];
|
|
54
|
-
const estateOf = (services) => estateFor(seedOf(services.viya));
|
|
53
|
+
const estateOf = (services) => estateFor(estateKeyOf(services.viya), seedOf(services.viya));
|
|
55
54
|
/**
|
|
56
55
|
* The context name a client asked for.
|
|
57
56
|
*
|
|
@@ -133,15 +132,31 @@ const jobBody = (job) => {
|
|
|
133
132
|
])
|
|
134
133
|
};
|
|
135
134
|
};
|
|
136
|
-
/** The
|
|
137
|
-
const
|
|
135
|
+
/** The browser mock has an anonymous principal distinct from every named user. */
|
|
136
|
+
const ownerOf = (subject) => {
|
|
137
|
+
if (subject === undefined)
|
|
138
|
+
return { kind: 'anonymous' };
|
|
139
|
+
if (!subject || typeof subject.userId !== 'string' || !subject.userId.trim())
|
|
140
|
+
throw new ApiError(401, 'A valid caller is required.');
|
|
141
|
+
if (subject.ownerId === undefined)
|
|
142
|
+
return { kind: 'user', key: subject.userId };
|
|
143
|
+
if (typeof subject.ownerId !== 'string' || !subject.ownerId.trim())
|
|
144
|
+
throw new ApiError(401, 'A valid caller is required.');
|
|
145
|
+
return { kind: 'account', key: subject.ownerId };
|
|
146
|
+
};
|
|
147
|
+
/** Ownerless records cannot be attributed and are deliberately inaccessible. */
|
|
148
|
+
const sessionOf = (services, id, subject) => {
|
|
149
|
+
const owner = ownerOf(subject);
|
|
138
150
|
const session = estateOf(services).session(id);
|
|
139
|
-
if (!session
|
|
151
|
+
if (!session ||
|
|
152
|
+
!session.owner ||
|
|
153
|
+
session.owner.kind !== owner.kind ||
|
|
154
|
+
session.owner.key !== owner.key)
|
|
140
155
|
throw new ApiError(404, `Session with ID '${id}' was not found.`);
|
|
141
156
|
return session;
|
|
142
157
|
};
|
|
143
|
-
const jobOf = (services, sessionId, jobId) => {
|
|
144
|
-
const job = sessionOf(services, sessionId).jobs.get(jobId);
|
|
158
|
+
const jobOf = (services, sessionId, jobId, subject) => {
|
|
159
|
+
const job = sessionOf(services, sessionId, subject).jobs.get(jobId);
|
|
145
160
|
if (!job)
|
|
146
161
|
throw new ApiError(404, `Job with ID '${jobId}' was not found.`);
|
|
147
162
|
return job;
|
|
@@ -176,25 +191,25 @@ export const COMPUTE_HANDLERS = {
|
|
|
176
191
|
if (params.id !== EMULATED_CONTEXT_ID)
|
|
177
192
|
throw new ApiError(404, `Context with ID '${params.id}' was not found.`);
|
|
178
193
|
const body = (request.body ?? {});
|
|
179
|
-
const session = estateOf(services).create();
|
|
194
|
+
const session = estateOf(services).create(ownerOf(request.subject));
|
|
180
195
|
return {
|
|
181
196
|
status: 201,
|
|
182
197
|
body: sessionBody(services, session, body.environment?.autoExecLines ?? [], callerId(request.subject))
|
|
183
198
|
};
|
|
184
199
|
},
|
|
185
|
-
'GET /compute/sessions/{}/state': async ({ services, params }) => {
|
|
186
|
-
sessionOf(services, params.id);
|
|
200
|
+
'GET /compute/sessions/{}/state': async ({ services, params, request }) => {
|
|
201
|
+
sessionOf(services, params.id, request.subject);
|
|
187
202
|
// a bare enum, not an object: the adapter calls `.trim()` on the answer, and
|
|
188
203
|
// the capture recorded no shape here because there is no JSON body
|
|
189
204
|
return { status: 200, body: 'idle' };
|
|
190
205
|
},
|
|
191
|
-
'DELETE /compute/sessions/{}': async ({ services, params }) => {
|
|
192
|
-
sessionOf(services, params.id);
|
|
206
|
+
'DELETE /compute/sessions/{}': async ({ services, params, request }) => {
|
|
207
|
+
sessionOf(services, params.id, request.subject);
|
|
193
208
|
estateOf(services).remove(params.id);
|
|
194
209
|
return { status: 204, body: undefined };
|
|
195
210
|
},
|
|
196
211
|
'POST /compute/sessions/{}/jobs': async ({ services, params, request }) => {
|
|
197
|
-
const session = sessionOf(services, params.id);
|
|
212
|
+
const session = sessionOf(services, params.id, request.subject);
|
|
198
213
|
const body = (request.body ?? {});
|
|
199
214
|
const job = estateOf(services).submit(session, body);
|
|
200
215
|
const execute = services.viya?.execute;
|
|
@@ -233,8 +248,8 @@ export const COMPUTE_HANDLERS = {
|
|
|
233
248
|
});
|
|
234
249
|
return { status: 201, body: jobBody(job) };
|
|
235
250
|
},
|
|
236
|
-
'GET /compute/sessions/{}/filerefs/_webout/content': async ({ services, params }) => {
|
|
237
|
-
const session = sessionOf(services, params.id);
|
|
251
|
+
'GET /compute/sessions/{}/filerefs/_webout/content': async ({ services, params, request }) => {
|
|
252
|
+
const session = sessionOf(services, params.id, request.subject);
|
|
238
253
|
const last = [...session.jobs.values()].pop();
|
|
239
254
|
if (!last)
|
|
240
255
|
throw new ApiError(404, 'This session has no `_webout` yet: nothing has run in it.');
|
|
@@ -253,20 +268,23 @@ export const COMPUTE_HANDLERS = {
|
|
|
253
268
|
headers: { 'content-type': 'text/plain' }
|
|
254
269
|
};
|
|
255
270
|
},
|
|
256
|
-
'GET /compute/sessions/{}/jobs/{}': async ({ services, params }) => {
|
|
271
|
+
'GET /compute/sessions/{}/jobs/{}': async ({ services, params, request }) => {
|
|
257
272
|
const [sessionId, jobId] = segmentsOf(params);
|
|
258
|
-
return {
|
|
273
|
+
return {
|
|
274
|
+
status: 200,
|
|
275
|
+
body: jobBody(jobOf(services, sessionId, jobId, request.subject))
|
|
276
|
+
};
|
|
259
277
|
},
|
|
260
|
-
'GET /compute/sessions/{}/jobs/{}/state': async ({ services, params }) => {
|
|
278
|
+
'GET /compute/sessions/{}/jobs/{}/state': async ({ services, params, request }) => {
|
|
261
279
|
const [sessionId, jobId] = segmentsOf(params);
|
|
262
280
|
return {
|
|
263
281
|
status: 200,
|
|
264
|
-
body: jobOf(services, sessionId, jobId).state
|
|
282
|
+
body: jobOf(services, sessionId, jobId, request.subject).state
|
|
265
283
|
};
|
|
266
284
|
},
|
|
267
285
|
'GET /compute/sessions/{}/jobs/{}/log/content': async ({ services, params, request }) => {
|
|
268
286
|
const [sessionId, jobId] = segmentsOf(params);
|
|
269
|
-
const job = jobOf(services, sessionId, jobId);
|
|
287
|
+
const job = jobOf(services, sessionId, jobId, request.subject);
|
|
270
288
|
const start = Number(request.query?.start ?? 0) || 0;
|
|
271
289
|
const limit = Number(request.query?.limit ?? 0) || 0;
|
|
272
290
|
const lines = job.log.slice(start, limit ? start + limit : undefined);
|
|
@@ -30,6 +30,9 @@ export declare const findViyaOperation: (method: string, path: string) => ViyaMa
|
|
|
30
30
|
*
|
|
31
31
|
* `request` is the same shape the SASjs dispatch takes, so a host that already
|
|
32
32
|
* resolves a caller - a session cookie - passes `subject` rather than a token.
|
|
33
|
+
* For compute sessions a host with credentials must pass the authenticated
|
|
34
|
+
* subject on every request: a token alone is refused. No subject and no token
|
|
35
|
+
* is the anonymous browser mock, not an authentication boundary.
|
|
33
36
|
*/
|
|
34
37
|
export declare const dispatchViya: (services: Services, method: string, path: string, request?: ApiRequest) => Promise<ViyaResponse>;
|
|
35
38
|
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../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,MAAM,EACd,MAAM,MAAM,EACZ,UAAS,UAAe,KACvB,OAAO,CAAC,YAAY,CAkGtB,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isApiError } from '../types.js';
|
|
1
|
+
import { ApiError, isApiError } from '../types.js';
|
|
2
2
|
import { VIYA_OPERATIONS } from './declared.js';
|
|
3
3
|
import { VIYA_OVERLAY } from './overlay.js';
|
|
4
4
|
import { VIYA_HANDLERS } from './service.js';
|
|
@@ -52,6 +52,9 @@ export const findViyaOperation = (method, path) => {
|
|
|
52
52
|
*
|
|
53
53
|
* `request` is the same shape the SASjs dispatch takes, so a host that already
|
|
54
54
|
* resolves a caller - a session cookie - passes `subject` rather than a token.
|
|
55
|
+
* For compute sessions a host with credentials must pass the authenticated
|
|
56
|
+
* subject on every request: a token alone is refused. No subject and no token
|
|
57
|
+
* is the anonymous browser mock, not an authentication boundary.
|
|
55
58
|
*/
|
|
56
59
|
export const dispatchViya = async (services, method, path, request = {}) => {
|
|
57
60
|
const headers = emulatedHeaders();
|
|
@@ -94,6 +97,13 @@ export const dispatchViya = async (services, method, path, request = {}) => {
|
|
|
94
97
|
}
|
|
95
98
|
};
|
|
96
99
|
try {
|
|
100
|
+
// A host must resolve credentials before compute dispatch. A missing subject
|
|
101
|
+
// is the anonymous mock only when no credential was supplied.
|
|
102
|
+
if (request.subject === undefined &&
|
|
103
|
+
request.token !== undefined &&
|
|
104
|
+
(found.operation.id === 'POST /compute/contexts/{}/sessions' ||
|
|
105
|
+
found.operation.path.startsWith('/compute/sessions/')))
|
|
106
|
+
throw new ApiError(401, 'A valid caller is required.');
|
|
97
107
|
const answer = await handler({
|
|
98
108
|
services,
|
|
99
109
|
request,
|
package/build/esm/viya/seed.d.ts
CHANGED
|
@@ -7,12 +7,21 @@
|
|
|
7
7
|
* true after the next one, and a fixture committed today must match the answer
|
|
8
8
|
* tomorrow.
|
|
9
9
|
*
|
|
10
|
-
* The seed is therefore the
|
|
11
|
-
* is the address clients already use to reach it,
|
|
12
|
-
* spelled two ways is one string. There is no
|
|
13
|
-
* a different estate with different data,
|
|
14
|
-
* data - a fixture, a screenshot, a test -
|
|
15
|
-
* because the address is all the identity
|
|
10
|
+
* The seed is therefore what the estate's *generated data* draws from, and the
|
|
11
|
+
* identity of an estate is the address clients already use to reach it,
|
|
12
|
+
* normalised so that one estate spelled two ways is one string. There is no
|
|
13
|
+
* override: an address that differs is a different estate with different data,
|
|
14
|
+
* by design. Anything that reads this data - a fixture, a screenshot, a test -
|
|
15
|
+
* has to work whatever the address is, because the address is all the identity
|
|
16
|
+
* there is.
|
|
17
|
+
*
|
|
18
|
+
* The seed is a 32-bit digest of that address, which is wide enough to vary the
|
|
19
|
+
* generated numbers and narrow enough that two distinct addresses collide on it
|
|
20
|
+
* - by birthday, roughly one pair per few-billion addresses, and a search finds
|
|
21
|
+
* one in minutes. A collision makes two estates answer with the same numbers,
|
|
22
|
+
* which is cosmetic; anything that *stores* state per estate - the live session
|
|
23
|
+
* registry - must therefore key by the full address, never by the seed, and
|
|
24
|
+
* `estateKeyOf` is that key.
|
|
16
25
|
*
|
|
17
26
|
* An emulator with no address has not said which estate it is, so every such
|
|
18
27
|
* estate shares one seed. That is the only honest default.
|
|
@@ -75,9 +84,22 @@ export declare const hash: (input: string) => number;
|
|
|
75
84
|
* The number that makes this estate's generated data reproducible.
|
|
76
85
|
*
|
|
77
86
|
* The address is the only input: the same estate answers the same way every time,
|
|
78
|
-
* and a different address is a different estate.
|
|
87
|
+
* and a different address is a different estate. A 32-bit digest, so it varies
|
|
88
|
+
* the numbers - it is not the estate's identity for anything that stores state
|
|
89
|
+
* (see `estateKeyOf`).
|
|
79
90
|
*/
|
|
80
91
|
export declare const seedOf: (settings?: ViyaSeedSettings) => number;
|
|
92
|
+
/**
|
|
93
|
+
* The key a per-estate store is held under: the full normalised address.
|
|
94
|
+
*
|
|
95
|
+
* The seed is a 32-bit digest of this key, and two distinct addresses collide
|
|
96
|
+
* on it - a pair exists for any such digest, and a search finds one in
|
|
97
|
+
* minutes. A registry keyed by the seed would then hand two addresses one
|
|
98
|
+
* shared store, so state is keyed by the address itself: distinct addresses
|
|
99
|
+
* are distinct stores even when their seeds are one number, and two spellings
|
|
100
|
+
* of one address (which normalise to one string) remain one store.
|
|
101
|
+
*/
|
|
102
|
+
export declare const estateKeyOf: (settings?: ViyaSeedSettings) => string;
|
|
81
103
|
/**
|
|
82
104
|
* A uniform generator over one seed (mulberry32).
|
|
83
105
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/viya/seed.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"seed.d.ts","sourceRoot":"","sources":["../../../src/viya/seed.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,oDAAoD;AACpD,eAAO,MAAM,YAAY,aAAa,CAAA;AAEtC;;;;;;;GAOG;AACH,MAAM,WAAW,YAAY;IAC3B,OAAO,CAAC,OAAO,EAAE;QACf,2DAA2D;QAC3D,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;QAC1B,4DAA4D;QAC5D,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAClC,kEAAkE;QAClE,IAAI,CAAC,EAAE,MAAM,CAAA;QACb,sCAAsC;QACtC,SAAS,EAAE,MAAM,CAAA;KAClB,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;CACrB;AAED,8CAA8C;AAC9C,MAAM,WAAW,OAAO;IACtB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gFAAgF;IAChF,GAAG,EAAE,MAAM,CAAA;IACX;;;;;;OAMG;IACH,KAAK,CAAC,EAAE,WAAW,GAAG,QAAQ,CAAA;CAC/B;AAED,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,6DAA6D;IAC7D,OAAO,CAAC,EAAE,YAAY,CAAC,SAAS,CAAC,CAAA;CAClC;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,kBAAkB,GAAI,KAAK,MAAM,GAAG,SAAS,KAAG,MA+C5D,CAAA;AAED,8DAA8D;AAC9D,eAAO,MAAM,IAAI,GAAI,OAAO,MAAM,KAAG,MASpC,CAAA;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,MAAM,GAAI,WAAU,gBAAqB,KAAG,MAIxD,CAAA;AAED;;;;;;;;;GASG;AACH,eAAO,MAAM,WAAW,GAAI,WAAU,gBAAqB,KAAG,MAI7D,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,SAAS,GAAI,MAAM,MAAM,KAAG,CAAC,MAAM,MAAM,CAarD,CAAA;AAED,4DAA4D;AAC5D,eAAO,MAAM,OAAO,GAAI,MAAM,MAAM,MAAM,EAAE,OAAO,MAAM,KAAG,MAChC,CAAA;AAE5B,oDAAoD;AACpD,eAAO,MAAM,QAAQ,GAAI,CAAC,EAAE,MAAM,MAAM,MAAM,EAAE,QAAQ,CAAC,EAAE,KAAG,CACxB,CAAA"}
|
package/build/esm/viya/seed.js
CHANGED
|
@@ -7,12 +7,21 @@
|
|
|
7
7
|
* true after the next one, and a fixture committed today must match the answer
|
|
8
8
|
* tomorrow.
|
|
9
9
|
*
|
|
10
|
-
* The seed is therefore the
|
|
11
|
-
* is the address clients already use to reach it,
|
|
12
|
-
* spelled two ways is one string. There is no
|
|
13
|
-
* a different estate with different data,
|
|
14
|
-
* data - a fixture, a screenshot, a test -
|
|
15
|
-
* because the address is all the identity
|
|
10
|
+
* The seed is therefore what the estate's *generated data* draws from, and the
|
|
11
|
+
* identity of an estate is the address clients already use to reach it,
|
|
12
|
+
* normalised so that one estate spelled two ways is one string. There is no
|
|
13
|
+
* override: an address that differs is a different estate with different data,
|
|
14
|
+
* by design. Anything that reads this data - a fixture, a screenshot, a test -
|
|
15
|
+
* has to work whatever the address is, because the address is all the identity
|
|
16
|
+
* there is.
|
|
17
|
+
*
|
|
18
|
+
* The seed is a 32-bit digest of that address, which is wide enough to vary the
|
|
19
|
+
* generated numbers and narrow enough that two distinct addresses collide on it
|
|
20
|
+
* - by birthday, roughly one pair per few-billion addresses, and a search finds
|
|
21
|
+
* one in minutes. A collision makes two estates answer with the same numbers,
|
|
22
|
+
* which is cosmetic; anything that *stores* state per estate - the live session
|
|
23
|
+
* registry - must therefore key by the full address, never by the seed, and
|
|
24
|
+
* `estateKeyOf` is that key.
|
|
16
25
|
*
|
|
17
26
|
* An emulator with no address has not said which estate it is, so every such
|
|
18
27
|
* estate shares one seed. That is the only honest default.
|
|
@@ -78,12 +87,28 @@ export const hash = (input) => {
|
|
|
78
87
|
* The number that makes this estate's generated data reproducible.
|
|
79
88
|
*
|
|
80
89
|
* The address is the only input: the same estate answers the same way every time,
|
|
81
|
-
* and a different address is a different estate.
|
|
90
|
+
* and a different address is a different estate. A 32-bit digest, so it varies
|
|
91
|
+
* the numbers - it is not the estate's identity for anything that stores state
|
|
92
|
+
* (see `estateKeyOf`).
|
|
82
93
|
*/
|
|
83
94
|
export const seedOf = (settings = {}) => {
|
|
84
95
|
const address = normaliseServerUrl(settings.serverUrl);
|
|
85
96
|
return hash(`url:${address || DEFAULT_SEED}`);
|
|
86
97
|
};
|
|
98
|
+
/**
|
|
99
|
+
* The key a per-estate store is held under: the full normalised address.
|
|
100
|
+
*
|
|
101
|
+
* The seed is a 32-bit digest of this key, and two distinct addresses collide
|
|
102
|
+
* on it - a pair exists for any such digest, and a search finds one in
|
|
103
|
+
* minutes. A registry keyed by the seed would then hand two addresses one
|
|
104
|
+
* shared store, so state is keyed by the address itself: distinct addresses
|
|
105
|
+
* are distinct stores even when their seeds are one number, and two spellings
|
|
106
|
+
* of one address (which normalise to one string) remain one store.
|
|
107
|
+
*/
|
|
108
|
+
export const estateKeyOf = (settings = {}) => {
|
|
109
|
+
const address = normaliseServerUrl(settings.serverUrl);
|
|
110
|
+
return address || DEFAULT_SEED;
|
|
111
|
+
};
|
|
87
112
|
/**
|
|
88
113
|
* A uniform generator over one seed (mulberry32).
|
|
89
114
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/viya/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../../src/viya/service.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAiJnD,gEAAgE;AAChE,eAAO,MAAM,aAAa,EAAE,MAAM,CAChC,MAAM,EACN,CAAC,OAAO,EAAE;IACR,QAAQ,EAAE,QAAQ,CAAA;IAClB,OAAO,EAAE;QACP,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAA;QAC1C,IAAI,CAAC,EAAE,OAAO,CAAA;QACd,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,OAAO,CAAC,EAAE,OAAO,CAAA;KAClB,CAAA;IACD,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAC/B,KAAK,OAAO,CAAC,WAAW,CAAC,CAkS3B,CAAA"}
|
|
@@ -40,6 +40,10 @@ const folderBody = async (drive, path, caller) => {
|
|
|
40
40
|
modifiedTimeStamp: EMULATED_NOW,
|
|
41
41
|
memberCount: listing.files.length + listing.folders.length,
|
|
42
42
|
parentFolderUri: `/folders/folders/${idFor(parent)}`,
|
|
43
|
+
// the capture's folder shape carries `properties`, and this body is the one a
|
|
44
|
+
// real folder is read through: answering only the recycle bin with it left a
|
|
45
|
+
// client reading `folder.properties` against nothing
|
|
46
|
+
properties: { allowMove: 'true' },
|
|
43
47
|
links: linksFor(`/folders/folders/${id}`)
|
|
44
48
|
};
|
|
45
49
|
};
|
|
@@ -125,20 +129,60 @@ export const VIYA_HANDLERS = {
|
|
|
125
129
|
}
|
|
126
130
|
};
|
|
127
131
|
},
|
|
128
|
-
'GET /types/types': async () =>
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
'GET /types/types': async ({ request }) => {
|
|
133
|
+
const limit = Number(request.query?.limit ?? 0) || 0;
|
|
134
|
+
// the estate answers a collection envelope, not a bare list: a client reads
|
|
135
|
+
// `accept`, `start` and `version` off this answer, and a body carrying only
|
|
136
|
+
// `count` and `items` is a shape the capture does not have
|
|
137
|
+
const item = {
|
|
138
|
+
name: 'file',
|
|
139
|
+
label: 'File',
|
|
140
|
+
description: 'A file type',
|
|
141
|
+
mediaType: 'application/octet-stream',
|
|
142
|
+
resourceUri: '/types/types/file',
|
|
143
|
+
iconUri: '/types/types/file/icon',
|
|
144
|
+
tags: ['file'],
|
|
145
|
+
version: 1,
|
|
146
|
+
links: [
|
|
133
147
|
{
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
148
|
+
href: '/types/types/file',
|
|
149
|
+
uri: '/types/types/file',
|
|
150
|
+
rel: 'self',
|
|
151
|
+
method: 'GET',
|
|
152
|
+
type: 'application/vnd.sas.type.definition'
|
|
138
153
|
}
|
|
139
154
|
]
|
|
140
|
-
}
|
|
141
|
-
|
|
155
|
+
};
|
|
156
|
+
return {
|
|
157
|
+
status: 200,
|
|
158
|
+
body: {
|
|
159
|
+
accept: 'application/json',
|
|
160
|
+
name: 'types',
|
|
161
|
+
start: 0,
|
|
162
|
+
limit,
|
|
163
|
+
count: 1,
|
|
164
|
+
version: 2,
|
|
165
|
+
items: [item],
|
|
166
|
+
links: [
|
|
167
|
+
{
|
|
168
|
+
href: '/types/types',
|
|
169
|
+
uri: '/types/types',
|
|
170
|
+
rel: 'collection',
|
|
171
|
+
method: 'GET',
|
|
172
|
+
type: 'application/vnd.sas.collection',
|
|
173
|
+
itemType: 'typeDef'
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
href: '/types/types',
|
|
177
|
+
uri: '/types/types',
|
|
178
|
+
rel: 'self',
|
|
179
|
+
method: 'GET',
|
|
180
|
+
type: 'application/vnd.sas.collection'
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
},
|
|
142
186
|
'GET /folders/folders/@item': async ({ services, request }) => ({
|
|
143
187
|
status: 200,
|
|
144
188
|
body: await folderBody(requireDrive(services), pathFromQuery(request), callerId(request.subject))
|
|
@@ -25,8 +25,17 @@ export interface EmulatedJob {
|
|
|
25
25
|
completedTimeStamp?: string;
|
|
26
26
|
sessionId: string;
|
|
27
27
|
}
|
|
28
|
+
export type SessionOwner = {
|
|
29
|
+
kind: 'account' | 'user';
|
|
30
|
+
key: string;
|
|
31
|
+
} | {
|
|
32
|
+
kind: 'anonymous';
|
|
33
|
+
key?: never;
|
|
34
|
+
};
|
|
28
35
|
export interface EmulatedSession {
|
|
29
36
|
id: string;
|
|
37
|
+
/** Internal authorization principal, not a wire field. */
|
|
38
|
+
owner: SessionOwner;
|
|
30
39
|
/** When it was created, on the real clock: a client expires sessions by age. */
|
|
31
40
|
createdAt: string;
|
|
32
41
|
jobs: Map<string, EmulatedJob>;
|
|
@@ -59,20 +68,29 @@ export declare const logFor: (seed: number, program: string | string[]) => strin
|
|
|
59
68
|
/**
|
|
60
69
|
* The sessions one estate holds.
|
|
61
70
|
*
|
|
62
|
-
* Keyed by
|
|
63
|
-
*
|
|
71
|
+
* Keyed by the estate's key - the full normalised address, not the seed it
|
|
72
|
+
* digests to - so two emulated estates in one process (a test that runs two
|
|
73
|
+
* targets, or two addresses whose 32-bit seeds collide) do not share a session
|
|
74
|
+
* namespace. See `estateKeyOf`.
|
|
64
75
|
*/
|
|
65
76
|
export declare class EmulatedEstate {
|
|
66
77
|
private readonly seed;
|
|
67
78
|
private readonly sessions;
|
|
68
|
-
private created;
|
|
69
79
|
constructor(seed: number);
|
|
70
|
-
/** A new session:
|
|
71
|
-
create(): EmulatedSession;
|
|
80
|
+
/** A new session: opaque UUID v4, no jobs. */
|
|
81
|
+
create(owner: SessionOwner): EmulatedSession;
|
|
72
82
|
session(id: string): EmulatedSession | undefined;
|
|
73
83
|
remove(id: string): boolean;
|
|
74
84
|
/** A job accepted into a session, with the log the emulator generated for it. */
|
|
75
85
|
submit(session: EmulatedSession, job: SubmittedJob): EmulatedJob;
|
|
76
86
|
}
|
|
77
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The estate one address holds, minting it on first use.
|
|
89
|
+
*
|
|
90
|
+
* Keyed by the estate's key - the full normalised address - never by the seed:
|
|
91
|
+
* the seed is a 32-bit digest of the address, two distinct addresses collide on
|
|
92
|
+
* it, and a collision must not give them one shared session store. The estate
|
|
93
|
+
* still uses the seed for its generated logs.
|
|
94
|
+
*/
|
|
95
|
+
export declare const estateFor: (key: string, seed: number) => EmulatedEstate;
|
|
78
96
|
//# sourceMappingURL=sessions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/viya/sessions.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../../../src/viya/sessions.ts"],"names":[],"mappings":"AAkBA,gEAAgE;AAChE,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,oDAAoD;IACpD,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,sEAAsE;IACtE,MAAM,CAAC,EAAE,MAAM,CAAA;IACf;;;;;;;OAOG;IACH,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EAAE,MAAM,GAAG,OAAO;IAI3B,iFAAiF;IACjF,MAAM,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,EAAE,YAAY,GAAG,WAAW;CAwBjE;AAKD;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,GAAI,KAAK,MAAM,EAAE,MAAM,MAAM,KAAG,cAUrD,CAAA"}
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* that parses for NOTEs still gets a well-formed log, and a person reading it is
|
|
14
14
|
* not misled about what ran.
|
|
15
15
|
*/
|
|
16
|
+
import { newUuidV4 } from '../uuid.js';
|
|
16
17
|
import { drawFrom, drawInt, generator, hash } from './seed.js';
|
|
17
18
|
/**
|
|
18
19
|
* The generated log for one program.
|
|
@@ -48,19 +49,24 @@ export const logFor = (seed, program) => {
|
|
|
48
49
|
/**
|
|
49
50
|
* The sessions one estate holds.
|
|
50
51
|
*
|
|
51
|
-
* Keyed by
|
|
52
|
-
*
|
|
52
|
+
* Keyed by the estate's key - the full normalised address, not the seed it
|
|
53
|
+
* digests to - so two emulated estates in one process (a test that runs two
|
|
54
|
+
* targets, or two addresses whose 32-bit seeds collide) do not share a session
|
|
55
|
+
* namespace. See `estateKeyOf`.
|
|
53
56
|
*/
|
|
54
57
|
export class EmulatedEstate {
|
|
55
58
|
constructor(seed) {
|
|
56
59
|
this.seed = seed;
|
|
57
60
|
this.sessions = new Map();
|
|
58
|
-
this.created = 0;
|
|
59
61
|
}
|
|
60
|
-
/** A new session:
|
|
61
|
-
create() {
|
|
62
|
+
/** A new session: opaque UUID v4, no jobs. */
|
|
63
|
+
create(owner) {
|
|
64
|
+
const id = newUuidV4();
|
|
65
|
+
if (this.sessions.has(id))
|
|
66
|
+
throw new Error('Duplicate compute session ID.');
|
|
62
67
|
const session = {
|
|
63
|
-
id
|
|
68
|
+
id,
|
|
69
|
+
owner,
|
|
64
70
|
createdAt: new Date().toISOString(),
|
|
65
71
|
jobs: new Map(),
|
|
66
72
|
submitted: 0
|
|
@@ -97,13 +103,21 @@ export class EmulatedEstate {
|
|
|
97
103
|
return submitted;
|
|
98
104
|
}
|
|
99
105
|
}
|
|
100
|
-
/** One estate per
|
|
106
|
+
/** One estate per address, for the life of the process. */
|
|
101
107
|
const estates = new Map();
|
|
102
|
-
|
|
103
|
-
|
|
108
|
+
/**
|
|
109
|
+
* The estate one address holds, minting it on first use.
|
|
110
|
+
*
|
|
111
|
+
* Keyed by the estate's key - the full normalised address - never by the seed:
|
|
112
|
+
* the seed is a 32-bit digest of the address, two distinct addresses collide on
|
|
113
|
+
* it, and a collision must not give them one shared session store. The estate
|
|
114
|
+
* still uses the seed for its generated logs.
|
|
115
|
+
*/
|
|
116
|
+
export const estateFor = (key, seed) => {
|
|
117
|
+
const existing = estates.get(key);
|
|
104
118
|
if (existing)
|
|
105
119
|
return existing;
|
|
106
120
|
const estate = new EmulatedEstate(seed);
|
|
107
|
-
estates.set(
|
|
121
|
+
estates.set(key, estate);
|
|
108
122
|
return estate;
|
|
109
123
|
};
|
package/package.json
CHANGED