@fuzdev/fuz_app 0.33.0 → 0.34.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/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/action_rpc.js +6 -1
- package/dist/testing/admin_integration.d.ts +7 -5
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/admin_integration.js +146 -145
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +34 -31
- package/dist/testing/integration.d.ts +2 -2
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +187 -124
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +25 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"audit_completeness.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/audit_completeness.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAkB7B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"audit_completeness.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/audit_completeness.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAkB7B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAIrD,OAAO,EAGN,KAAK,eAAe,EAEpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,SAAS,CAAC;AAKjB,OAAO,EAIN,KAAK,uBAAuB,EAC5B,MAAM,kBAAkB,CAAC;AAsB1B;;GAEG;AACH,MAAM,WAAW,4BAA4B;IAC5C,4CAA4C;IAC5C,eAAe,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACxC,wDAAwD;IACxD,kBAAkB,EAAE,CAAC,GAAG,EAAE,gBAAgB,KAAK,KAAK,CAAC,SAAS,CAAC,CAAC;IAChE;;;;;;;;;;;OAWG;IACH,aAAa,EAAE,uBAAuB,CAAC;IACvC,iDAAiD;IACjD,WAAW,CAAC,EAAE,eAAe,CAAC;IAC9B,qEAAqE;IACrE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;CAChC;AAoDD;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC,GAAI,SAAS,4BAA4B,KAAG,IAyezF,CAAC"}
|
|
@@ -21,7 +21,7 @@ import { create_pglite_factory, create_describe_db, AUTH_INTEGRATION_TRUNCATE_TA
|
|
|
21
21
|
import { find_auth_route } from './integration_helpers.js';
|
|
22
22
|
import { run_migrations } from '../db/migrate.js';
|
|
23
23
|
import { query_accept_offer } from '../auth/permit_offer_queries.js';
|
|
24
|
-
import {
|
|
24
|
+
import { rpc_call_for_spec, require_rpc_endpoint_path, resolve_rpc_endpoints_for_setup, } from './rpc_helpers.js';
|
|
25
25
|
import { permit_offer_create_action_spec, permit_revoke_action_spec, } from '../auth/permit_offer_action_specs.js';
|
|
26
26
|
import { admin_session_revoke_all_action_spec, admin_token_revoke_all_action_spec, app_settings_update_action_spec, invite_create_action_spec, invite_delete_action_spec, } from '../auth/admin_action_specs.js';
|
|
27
27
|
import { account_session_list_action_spec, account_session_revoke_action_spec, account_session_revoke_all_action_spec, account_token_create_action_spec, account_token_list_action_spec, account_token_revoke_action_spec, } from '../auth/account_action_specs.js';
|
|
@@ -126,10 +126,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
126
126
|
});
|
|
127
127
|
test('token create produces token_create event', async () => {
|
|
128
128
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
129
|
-
const res = await
|
|
129
|
+
const res = await rpc_call_for_spec({
|
|
130
130
|
app: test_app.app,
|
|
131
131
|
path: rpc_path,
|
|
132
|
-
|
|
132
|
+
spec: account_token_create_action_spec,
|
|
133
133
|
params: { name: 'audit-test' },
|
|
134
134
|
headers: test_app.create_session_headers(),
|
|
135
135
|
});
|
|
@@ -140,19 +140,20 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
140
140
|
test('token revoke produces token_revoke event', async () => {
|
|
141
141
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
142
142
|
// get a token ID to revoke
|
|
143
|
-
const list_res = await
|
|
143
|
+
const list_res = await rpc_call_for_spec({
|
|
144
144
|
app: test_app.app,
|
|
145
145
|
path: rpc_path,
|
|
146
|
-
|
|
146
|
+
spec: account_token_list_action_spec,
|
|
147
|
+
params: null,
|
|
147
148
|
headers: test_app.create_session_headers(),
|
|
148
149
|
});
|
|
149
150
|
assert.ok(list_res.ok, 'account_token_list should succeed');
|
|
150
151
|
const { tokens } = list_res.result;
|
|
151
152
|
assert.ok(tokens.length > 0, 'Expected at least one token');
|
|
152
|
-
const res = await
|
|
153
|
+
const res = await rpc_call_for_spec({
|
|
153
154
|
app: test_app.app,
|
|
154
155
|
path: rpc_path,
|
|
155
|
-
|
|
156
|
+
spec: account_token_revoke_action_spec,
|
|
156
157
|
params: { token_id: tokens[0].id },
|
|
157
158
|
headers: test_app.create_session_headers(),
|
|
158
159
|
});
|
|
@@ -174,20 +175,21 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
174
175
|
}),
|
|
175
176
|
});
|
|
176
177
|
// get session IDs (newest first)
|
|
177
|
-
const list_res = await
|
|
178
|
+
const list_res = await rpc_call_for_spec({
|
|
178
179
|
app: test_app.app,
|
|
179
180
|
path: rpc_path,
|
|
180
|
-
|
|
181
|
+
spec: account_session_list_action_spec,
|
|
182
|
+
params: null,
|
|
181
183
|
headers: test_app.create_session_headers(),
|
|
182
184
|
});
|
|
183
185
|
assert.ok(list_res.ok, 'account_session_list should succeed');
|
|
184
186
|
const { sessions } = list_res.result;
|
|
185
187
|
assert.ok(sessions.length >= 2, 'Expected at least 2 sessions');
|
|
186
188
|
// revoke the second session (not the one used for auth)
|
|
187
|
-
const res = await
|
|
189
|
+
const res = await rpc_call_for_spec({
|
|
188
190
|
app: test_app.app,
|
|
189
191
|
path: rpc_path,
|
|
190
|
-
|
|
192
|
+
spec: account_session_revoke_action_spec,
|
|
191
193
|
params: { session_id: sessions[1].id },
|
|
192
194
|
headers: test_app.create_session_headers(),
|
|
193
195
|
});
|
|
@@ -197,10 +199,11 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
197
199
|
});
|
|
198
200
|
test('session revoke-all produces session_revoke_all event', async () => {
|
|
199
201
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
200
|
-
const res = await
|
|
202
|
+
const res = await rpc_call_for_spec({
|
|
201
203
|
app: test_app.app,
|
|
202
204
|
path: rpc_path,
|
|
203
|
-
|
|
205
|
+
spec: account_session_revoke_all_action_spec,
|
|
206
|
+
params: null,
|
|
204
207
|
headers: test_app.create_session_headers(),
|
|
205
208
|
});
|
|
206
209
|
assert.ok(res.ok, `account_session_revoke_all failed: ${res.ok ? '' : JSON.stringify(res.error)}`);
|
|
@@ -229,10 +232,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
229
232
|
test('admin offer (RPC) + accept produces permit_offer_create and permit_grant events', async () => {
|
|
230
233
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
231
234
|
const target = await test_app.create_account({ username: 'audit_target' });
|
|
232
|
-
const offer_res = await
|
|
235
|
+
const offer_res = await rpc_call_for_spec({
|
|
233
236
|
app: test_app.app,
|
|
234
237
|
path: rpc_path,
|
|
235
|
-
|
|
238
|
+
spec: permit_offer_create_action_spec,
|
|
236
239
|
params: { to_account_id: target.account.id, role: ROLE_ADMIN },
|
|
237
240
|
headers: test_app.create_session_headers(),
|
|
238
241
|
});
|
|
@@ -255,10 +258,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
255
258
|
const target_actor = await query_actor_by_account({ db: get_db() }, target.account.id);
|
|
256
259
|
assert.ok(target_actor);
|
|
257
260
|
// Offer + accept to materialize a permit we can revoke.
|
|
258
|
-
const offer_res = await
|
|
261
|
+
const offer_res = await rpc_call_for_spec({
|
|
259
262
|
app: test_app.app,
|
|
260
263
|
path: rpc_path,
|
|
261
|
-
|
|
264
|
+
spec: permit_offer_create_action_spec,
|
|
262
265
|
params: { to_account_id: target.account.id, role: ROLE_ADMIN },
|
|
263
266
|
headers: test_app.create_session_headers(),
|
|
264
267
|
});
|
|
@@ -268,10 +271,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
268
271
|
return query_accept_offer({ db: tx }, { offer_id: offer.id, to_account_id: target.account.id, ip: null });
|
|
269
272
|
});
|
|
270
273
|
// Revoke via RPC.
|
|
271
|
-
const revoke_res = await
|
|
274
|
+
const revoke_res = await rpc_call_for_spec({
|
|
272
275
|
app: test_app.app,
|
|
273
276
|
path: rpc_path,
|
|
274
|
-
|
|
277
|
+
spec: permit_revoke_action_spec,
|
|
275
278
|
params: { actor_id: target_actor.id, permit_id: accept_result.permit.id },
|
|
276
279
|
headers: test_app.create_session_headers(),
|
|
277
280
|
});
|
|
@@ -282,10 +285,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
282
285
|
test('admin session revoke-all produces session_revoke_all event', async () => {
|
|
283
286
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
284
287
|
const target = await test_app.create_account({ username: 'audit_sessions_target' });
|
|
285
|
-
const res = await
|
|
288
|
+
const res = await rpc_call_for_spec({
|
|
286
289
|
app: test_app.app,
|
|
287
290
|
path: rpc_path,
|
|
288
|
-
|
|
291
|
+
spec: admin_session_revoke_all_action_spec,
|
|
289
292
|
params: { account_id: target.account.id },
|
|
290
293
|
headers: test_app.create_session_headers(),
|
|
291
294
|
});
|
|
@@ -297,10 +300,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
297
300
|
test('admin token revoke-all produces token_revoke_all event', async () => {
|
|
298
301
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
299
302
|
const target = await test_app.create_account({ username: 'audit_tokens_target' });
|
|
300
|
-
const res = await
|
|
303
|
+
const res = await rpc_call_for_spec({
|
|
301
304
|
app: test_app.app,
|
|
302
305
|
path: rpc_path,
|
|
303
|
-
|
|
306
|
+
spec: admin_token_revoke_all_action_spec,
|
|
304
307
|
params: { account_id: target.account.id },
|
|
305
308
|
headers: test_app.create_session_headers(),
|
|
306
309
|
});
|
|
@@ -313,19 +316,19 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
313
316
|
describe('invite mutation audit events', () => {
|
|
314
317
|
test('invite create and delete produce audit events', async () => {
|
|
315
318
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
316
|
-
const create_res = await
|
|
319
|
+
const create_res = await rpc_call_for_spec({
|
|
317
320
|
app: test_app.app,
|
|
318
321
|
path: rpc_path,
|
|
319
|
-
|
|
322
|
+
spec: invite_create_action_spec,
|
|
320
323
|
params: { username: 'invited_user' },
|
|
321
324
|
headers: test_app.create_session_headers(),
|
|
322
325
|
});
|
|
323
326
|
assert.ok(create_res.ok, `invite_create failed: ${create_res.ok ? '' : JSON.stringify(create_res.error)}`);
|
|
324
327
|
const { invite } = create_res.result;
|
|
325
|
-
const delete_res = await
|
|
328
|
+
const delete_res = await rpc_call_for_spec({
|
|
326
329
|
app: test_app.app,
|
|
327
330
|
path: rpc_path,
|
|
328
|
-
|
|
331
|
+
spec: invite_delete_action_spec,
|
|
329
332
|
params: { invite_id: invite.id },
|
|
330
333
|
headers: test_app.create_session_headers(),
|
|
331
334
|
});
|
|
@@ -339,10 +342,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
339
342
|
describe('app settings mutation audit events', () => {
|
|
340
343
|
test('settings update produces app_settings_update event', async () => {
|
|
341
344
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
342
|
-
const res = await
|
|
345
|
+
const res = await rpc_call_for_spec({
|
|
343
346
|
app: test_app.app,
|
|
344
347
|
path: rpc_path,
|
|
345
|
-
|
|
348
|
+
spec: app_settings_update_action_spec,
|
|
346
349
|
params: { open_signup: true },
|
|
347
350
|
headers: test_app.create_session_headers(),
|
|
348
351
|
});
|
|
@@ -356,10 +359,10 @@ export const describe_audit_completeness_tests = (options) => {
|
|
|
356
359
|
test('signup produces signup event', async () => {
|
|
357
360
|
const test_app = await create_test_app(build_options(options, get_db()));
|
|
358
361
|
// enable open signup via RPC
|
|
359
|
-
const settings_res = await
|
|
362
|
+
const settings_res = await rpc_call_for_spec({
|
|
360
363
|
app: test_app.app,
|
|
361
364
|
path: rpc_path,
|
|
362
|
-
|
|
365
|
+
spec: app_settings_update_action_spec,
|
|
363
366
|
params: { open_signup: true },
|
|
364
367
|
headers: test_app.create_session_headers(),
|
|
365
368
|
});
|
|
@@ -23,8 +23,8 @@ export interface StandardIntegrationTestOptions {
|
|
|
23
23
|
/**
|
|
24
24
|
* RPC endpoint specs — required. This suite dispatches
|
|
25
25
|
* `account_verify`, `account_session_*`, and `account_token_*` via
|
|
26
|
-
* `
|
|
27
|
-
* nginx shim with no payload). Hard-fails via
|
|
26
|
+
* `rpc_call_for_spec` (the `/api/account/verify` REST route is a
|
|
27
|
+
* status-only nginx shim with no payload). Hard-fails via
|
|
28
28
|
* `require_rpc_endpoint_path` on setup so consumer projects see a
|
|
29
29
|
* clear setup error instead of confusing test failures.
|
|
30
30
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"integration.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/integration.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAsB7B,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAC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