@fuzdev/fuz_app 0.182.0 → 0.183.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 +2 -0
- package/dist/actions/CLAUDE.md +4 -4
- package/dist/auth/CLAUDE.md +58 -34
- package/dist/auth/account_routes.d.ts +5 -3
- package/dist/auth/account_routes.d.ts.map +1 -1
- package/dist/auth/account_routes.js +71 -66
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/admin_actions.js +22 -17
- package/dist/auth/audit_emitter.d.ts +75 -84
- package/dist/auth/audit_emitter.d.ts.map +1 -1
- package/dist/auth/audit_emitter.js +83 -71
- package/dist/auth/audit_log_schema.d.ts +10 -5
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.js +22 -6
- package/dist/auth/bootstrap_account.d.ts +31 -13
- package/dist/auth/bootstrap_account.d.ts.map +1 -1
- package/dist/auth/bootstrap_account.js +34 -15
- package/dist/auth/bootstrap_routes.d.ts +1 -1
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/bootstrap_routes.js +7 -14
- package/dist/auth/deps.d.ts +8 -5
- package/dist/auth/deps.d.ts.map +1 -1
- package/dist/auth/deps.js +3 -2
- package/dist/auth/resolved_auth.d.ts +7 -7
- package/dist/auth/resolved_auth.d.ts.map +1 -1
- package/dist/auth/resolved_auth.js +4 -4
- package/dist/auth/role_grant_offer_actions.d.ts +25 -1
- package/dist/auth/role_grant_offer_actions.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_actions.js +40 -33
- package/dist/auth/role_grant_offer_queries.d.ts +60 -4
- package/dist/auth/role_grant_offer_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_offer_queries.js +79 -5
- package/dist/auth/role_grant_queries.d.ts +3 -52
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +5 -80
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.js +11 -22
- package/dist/auth/session_queries.d.ts +6 -3
- package/dist/auth/session_queries.d.ts.map +1 -1
- package/dist/auth/session_queries.js +20 -11
- package/dist/auth/signup_routes.d.ts.map +1 -1
- package/dist/auth/signup_routes.js +90 -38
- package/dist/db/sql_columns.d.ts +1 -1
- package/dist/db/sql_columns.js +1 -1
- package/dist/http/CLAUDE.md +15 -10
- package/dist/http/db_routes.d.ts +7 -22
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/db_routes.js +72 -72
- package/dist/http/pending_effects.d.ts +42 -4
- package/dist/http/pending_effects.d.ts.map +1 -1
- package/dist/http/pending_effects.js +34 -4
- package/dist/server/app_server.d.ts +43 -2
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/app_server.js +57 -3
- package/dist/testing/CLAUDE.md +255 -786
- package/dist/testing/adversarial_404.d.ts +6 -1
- package/dist/testing/adversarial_404.d.ts.map +1 -1
- package/dist/testing/adversarial_404.js +38 -17
- package/dist/testing/app_server.d.ts +20 -140
- package/dist/testing/app_server.d.ts.map +1 -1
- package/dist/testing/app_server.js +45 -124
- package/dist/testing/audit_drift_guard.d.ts +11 -6
- package/dist/testing/audit_drift_guard.d.ts.map +1 -1
- package/dist/testing/audit_drift_guard.js +15 -8
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts +12 -9
- package/dist/testing/cross_backend/audit_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/audit_cross_helpers.js +13 -14
- package/dist/testing/cross_backend/capabilities.d.ts +9 -6
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +11 -7
- package/dist/testing/cross_backend/capability_mounts.d.ts +103 -0
- package/dist/testing/cross_backend/capability_mounts.d.ts.map +1 -0
- package/dist/testing/cross_backend/capability_mounts.js +423 -0
- package/dist/testing/cross_backend/cell_moderate.js +2 -2
- package/dist/testing/cross_backend/cell_relations.d.ts.map +1 -1
- package/dist/testing/cross_backend/cell_relations.js +12 -11
- package/dist/testing/cross_backend/conformance_principal.d.ts +54 -0
- package/dist/testing/cross_backend/conformance_principal.d.ts.map +1 -0
- package/dist/testing/cross_backend/conformance_principal.js +283 -0
- package/dist/testing/cross_backend/conformance_table.d.ts +2 -50
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +2 -270
- package/dist/testing/cross_backend/credential_deadline.d.ts.map +1 -1
- package/dist/testing/cross_backend/credential_deadline.js +2 -0
- package/dist/testing/cross_backend/credential_wire.d.ts +1 -1
- package/dist/testing/cross_backend/credential_wire.d.ts.map +1 -1
- package/dist/testing/cross_backend/db_state_diff.d.ts +72 -0
- package/dist/testing/cross_backend/db_state_diff.d.ts.map +1 -0
- package/dist/testing/cross_backend/db_state_diff.js +444 -0
- package/dist/testing/cross_backend/declared_skips.d.ts +68 -0
- package/dist/testing/cross_backend/declared_skips.d.ts.map +1 -0
- package/dist/testing/cross_backend/declared_skips.js +132 -0
- package/dist/testing/cross_backend/differential.d.ts +11 -2
- package/dist/testing/cross_backend/differential.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential.js +35 -11
- package/dist/testing/cross_backend/differential_normalize.d.ts +12 -0
- package/dist/testing/cross_backend/differential_normalize.d.ts.map +1 -1
- package/dist/testing/cross_backend/differential_normalize.js +16 -0
- package/dist/testing/cross_backend/in_process_setup.d.ts +22 -12
- package/dist/testing/cross_backend/in_process_setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/in_process_setup.js +151 -134
- package/dist/testing/cross_backend/login_security.d.ts +12 -0
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.js +21 -4
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts +0 -2
- package/dist/testing/cross_backend/request_target_conformance_wire.d.ts.map +1 -1
- package/dist/testing/cross_backend/request_target_conformance_wire.js +3 -1
- package/dist/testing/cross_backend/revocation_drivers.d.ts +18 -5
- package/dist/testing/cross_backend/revocation_drivers.d.ts.map +1 -1
- package/dist/testing/cross_backend/revocation_drivers.js +18 -10
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts +1 -1
- package/dist/testing/cross_backend/role_grant_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.d.ts.map +1 -1
- package/dist/testing/cross_backend/role_grant_offer_lifecycle.js +33 -1
- package/dist/testing/cross_backend/role_grant_participation.js +4 -4
- package/dist/testing/cross_backend/rpc_adversarial.js +1 -1
- package/dist/testing/cross_backend/session_cap.d.ts +2 -2
- package/dist/testing/cross_backend/session_cap.d.ts.map +1 -1
- package/dist/testing/cross_backend/session_cap.js +22 -11
- package/dist/testing/cross_backend/setup.d.ts +31 -1
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +32 -1
- package/dist/testing/cross_backend/spine_suites.d.ts +123 -12
- package/dist/testing/cross_backend/spine_suites.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_suites.js +454 -57
- package/dist/testing/cross_backend/spine_surface_constants.d.ts +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.d.ts.map +1 -1
- package/dist/testing/cross_backend/spine_surface_constants.js +1 -0
- package/dist/testing/cross_backend/sse_round_trip.d.ts +9 -1
- package/dist/testing/cross_backend/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/sse_round_trip.js +123 -27
- package/dist/testing/cross_backend/testing_backdoor.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_backdoor.js +4 -2
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +59 -27
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +66 -42
- package/dist/testing/cross_backend/transport_composition.d.ts +1 -1
- package/dist/testing/cross_backend/transport_composition.d.ts.map +1 -1
- package/dist/testing/cross_backend/transport_composition.js +7 -3
- package/dist/testing/cross_backend/ws_round_trip.d.ts +5 -0
- package/dist/testing/cross_backend/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/cross_backend/ws_round_trip.js +54 -8
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/data_exposure.js +3 -0
- package/dist/testing/db.d.ts +0 -32
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db.js +0 -86
- package/dist/testing/db_entities.d.ts +14 -0
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +17 -0
- package/dist/testing/db_invariant_queries.d.ts +259 -0
- package/dist/testing/db_invariant_queries.d.ts.map +1 -0
- package/dist/testing/db_invariant_queries.js +400 -0
- package/dist/testing/db_invariants.d.ts +106 -0
- package/dist/testing/db_invariants.d.ts.map +1 -0
- package/dist/testing/db_invariants.gen.sql.d.ts +11 -0
- package/dist/testing/db_invariants.gen.sql.d.ts.map +1 -0
- package/dist/testing/db_invariants.gen.sql.js +13 -0
- package/dist/testing/db_invariants.js +141 -0
- package/dist/testing/db_invariants.sql +152 -0
- package/dist/testing/describe_db.d.ts +36 -0
- package/dist/testing/describe_db.d.ts.map +1 -0
- package/dist/testing/describe_db.js +71 -0
- package/dist/testing/integration.d.ts +6 -9
- package/dist/testing/integration.d.ts.map +1 -1
- package/dist/testing/integration.js +9 -13
- package/dist/testing/integration_helpers.d.ts +1 -1
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/rate_limiting.d.ts +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/rate_limiting.js +3 -2
- package/dist/testing/role_grant_helpers.d.ts +1 -1
- package/dist/testing/role_grant_helpers.d.ts.map +1 -1
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/round_trip.js +3 -0
- package/dist/testing/rpc_attack_surface.d.ts +8 -6
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.js +69 -6
- package/dist/testing/rpc_round_trip.d.ts +1 -1
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.js +3 -0
- package/dist/testing/sse_round_trip.d.ts +1 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.js +13 -4
- package/dist/testing/stubs.d.ts +4 -2
- package/dist/testing/stubs.d.ts.map +1 -1
- package/dist/testing/stubs.js +10 -5
- package/dist/testing/test_app.d.ts +166 -0
- package/dist/testing/test_app.d.ts.map +1 -0
- package/dist/testing/test_app.js +124 -0
- package/package.json +1 -1
|
@@ -20,6 +20,12 @@ import '../assert_dev_env.js';
|
|
|
20
20
|
* - **already decided → 400** `invalid_request` with reason
|
|
21
21
|
* `role_grant_offer_terminal` — a decline or retract after an accept, a
|
|
22
22
|
* second decline, a second retract, and either one after the other.
|
|
23
|
+
* - **a re-offer refreshes the pending offer.** The grantor offering the same
|
|
24
|
+
* role to the same account while its offer is pending answers that offer —
|
|
25
|
+
* the same id, its `message` the new one, and its `to_actor_id` the new
|
|
26
|
+
* request's: naming the recipient's actor narrows it, naming none widens it
|
|
27
|
+
* back — and the inbox still holds the one offer. Once the offer is decided,
|
|
28
|
+
* a re-offer is a new offer.
|
|
23
29
|
* - **a decided offer can't be accepted.** An accept after a decline or a
|
|
24
30
|
* retract is `role_grant_offer_terminal` and grants nothing — the
|
|
25
31
|
* recipient holds no grant of the role and the offer reads back unaccepted.
|
|
@@ -66,7 +72,7 @@ import '../assert_dev_env.js';
|
|
|
66
72
|
*/
|
|
67
73
|
import { assert, describe, test } from 'vitest';
|
|
68
74
|
import { rpc_call } from '../rpc_helpers.js';
|
|
69
|
-
import { ERROR_CANNOT_REVOKE_KEEPER_ADMIN, ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH, ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED, ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_SELF_TARGET, ERROR_ROLE_GRANT_OFFER_TERMINAL, RoleGrantOfferDeclineOutput, RoleGrantOfferHistoryOutput, RoleGrantOfferRetractOutput } from '../../auth/role_grant_offer_action_specs.js';
|
|
75
|
+
import { ERROR_CANNOT_REVOKE_KEEPER_ADMIN, ERROR_ROLE_GRANT_OFFER_ACTOR_ACCOUNT_MISMATCH, ERROR_ROLE_GRANT_OFFER_NOT_AUTHORIZED, ERROR_ROLE_GRANT_OFFER_NOT_FOUND, ERROR_ROLE_GRANT_OFFER_SELF_TARGET, ERROR_ROLE_GRANT_OFFER_TERMINAL, RoleGrantOfferCreateOutput, RoleGrantOfferDeclineOutput, RoleGrantOfferHistoryOutput, RoleGrantOfferListOutput, RoleGrantOfferRetractOutput } from '../../auth/role_grant_offer_action_specs.js';
|
|
70
76
|
import { AdminAccountListOutput } from '../../auth/admin_action_specs.js';
|
|
71
77
|
import { ROLE_ADMIN } from '../../auth/role_schema.js';
|
|
72
78
|
import { expect_output } from './cross_rpc.js';
|
|
@@ -115,6 +121,32 @@ export const describe_role_grant_offer_lifecycle_cross_tests = (options) => {
|
|
|
115
121
|
const { offers } = listed.result;
|
|
116
122
|
return offers.some((offer) => offer.id === offer_id);
|
|
117
123
|
};
|
|
124
|
+
describe('a re-offer refreshes the pending offer', () => {
|
|
125
|
+
test("a re-offer while pending answers the same offer, its actor narrowed and widened; after a decline it's a new offer", async () => {
|
|
126
|
+
const fixture = await setup_test();
|
|
127
|
+
const recipient = await fixture.create_account({ username: 'lifecycle_reoffer' });
|
|
128
|
+
const recipient_headers = recipient.create_session_headers();
|
|
129
|
+
const grantor_headers = fixture.create_session_headers();
|
|
130
|
+
const offer = async (params) => expect_output(await rpc(fixture, 'role_grant_offer_create', { to_account_id: recipient.account.id, role, ...params }, grantor_headers), RoleGrantOfferCreateOutput).offer;
|
|
131
|
+
const first = await offer({ message: 'first' });
|
|
132
|
+
assert.strictEqual(first.to_actor_id, null);
|
|
133
|
+
const narrowed = await offer({ to_actor_id: recipient.actor.id, message: 'narrowed' });
|
|
134
|
+
assert.strictEqual(narrowed.id, first.id, 'a re-offer while pending is the same offer');
|
|
135
|
+
assert.strictEqual(narrowed.to_actor_id, recipient.actor.id, 'naming the actor narrows it');
|
|
136
|
+
assert.strictEqual(narrowed.message, 'narrowed');
|
|
137
|
+
const widened = await offer({ message: 'widened' });
|
|
138
|
+
assert.strictEqual(widened.id, first.id);
|
|
139
|
+
assert.strictEqual(widened.to_actor_id, null, 'naming no actor widens it back');
|
|
140
|
+
assert.strictEqual(widened.message, 'widened');
|
|
141
|
+
// the inbox holds the one offer, as the last re-offer left it
|
|
142
|
+
const { offers } = expect_output(await rpc(fixture, 'role_grant_offer_list', {}, recipient_headers), RoleGrantOfferListOutput);
|
|
143
|
+
assert.deepStrictEqual(offers.map(({ id, to_actor_id, message }) => ({ id, to_actor_id, message })), [{ id: first.id, to_actor_id: null, message: 'widened' }]);
|
|
144
|
+
assert_ok(await decline(fixture, first.id, recipient_headers), 'decline');
|
|
145
|
+
const after_decline = await offer({ message: 'again' });
|
|
146
|
+
assert.notStrictEqual(after_decline.id, first.id, 'a decided offer is not reopened');
|
|
147
|
+
assert.ok(await is_pending(fixture, recipient, after_decline.id), 'the new offer is pending');
|
|
148
|
+
});
|
|
149
|
+
});
|
|
118
150
|
describe('role_grant_offer decline + retract refusals', () => {
|
|
119
151
|
test('a decline by anyone but the recipient → 404, identical to a missing offer; the offer stays pending', async () => {
|
|
120
152
|
const fixture = await setup_test();
|
|
@@ -64,10 +64,10 @@ export const describe_role_grant_participation_cross_tests = (options) => {
|
|
|
64
64
|
test(`admin assigns the ${role} app-role to a fresh account (idempotent)`, async () => {
|
|
65
65
|
const fixture = await setup_test();
|
|
66
66
|
const recipient = await fixture.create_account({ username: 'participation_assignee' });
|
|
67
|
-
// The keeper holds ROLE_ADMIN (seeded
|
|
68
|
-
// clears the dispatcher admin gate; `participant` is
|
|
69
|
-
// it clears the grant-path gate; the recipient is
|
|
70
|
-
// target actor resolves without `to_actor_id`.
|
|
67
|
+
// The keeper holds ROLE_ADMIN (seeded by default, as a production
|
|
68
|
+
// bootstrap), so it clears the dispatcher admin gate; `participant` is
|
|
69
|
+
// admin-grantable, so it clears the grant-path gate; the recipient is
|
|
70
|
+
// single-actor, so the target actor resolves without `to_actor_id`.
|
|
71
71
|
const first = await rpc(fixture.transport, 'role_grant_assign', { to_account_id: recipient.account.id, role }, fixture.create_session_headers());
|
|
72
72
|
assert.ok(first.ok, `assign must succeed: ${JSON.stringify(first)}`);
|
|
73
73
|
const assigned = first.result;
|
|
@@ -79,7 +79,7 @@ import { PROTOCOL_ACTION_METHODS } from '../../actions/action_codegen.js';
|
|
|
79
79
|
import { TESTING_METHOD_PREFIX } from '../surface_invariants.js';
|
|
80
80
|
import { create_rpc_post_init } from '../rpc_helpers.js';
|
|
81
81
|
import { assert_rpc_envelope_refusal, create_rpc_envelope_cases, generate_rpc_params_test_cases, to_rpc_envelope_request } from '../rpc_envelope_cases.js';
|
|
82
|
-
import { resolve_conformance_principal } from './
|
|
82
|
+
import { resolve_conformance_principal } from './conformance_principal.js';
|
|
83
83
|
import { SPINE_RPC_PATH } from './spine_surface_constants.js';
|
|
84
84
|
import { xfail_until } from './xfail.js';
|
|
85
85
|
import { expected_invalid_reason } from '../adversarial_input_cases.js';
|
|
@@ -25,8 +25,8 @@ export interface SessionCapCrossTestOptions {
|
|
|
25
25
|
readonly ws?: WsEndpointTarget;
|
|
26
26
|
/**
|
|
27
27
|
* Whether the `ws` endpoint mounts the self-service account actions
|
|
28
|
-
* (`capabilities.ws_account_actions`),
|
|
29
|
-
* over a socket
|
|
28
|
+
* (`capabilities.ws_account_actions`), for the case that lists the
|
|
29
|
+
* sessions over a socket; `false` (the default) skips it.
|
|
30
30
|
*/
|
|
31
31
|
readonly ws_account_actions?: boolean;
|
|
32
32
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session_cap.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/session_cap.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAA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AC;IAC7B,qEAAqE;IACrE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,mFAAmF;IACnF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,gBAAgB,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IACtC;;;;;OAKG;IACH,QAAQ,CAAC,gBAAgB,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,gCAAgC,GAAI,SAAS,0BAA0B,KAAG,IAkStF,CAAC"}
|
|
@@ -89,6 +89,15 @@ export const describe_session_cap_cross_tests = (options) => {
|
|
|
89
89
|
// a refused login past the cap is the defect, not a test fault
|
|
90
90
|
label: `${label} (the cap evicts, it never refuses)`
|
|
91
91
|
});
|
|
92
|
+
/** `account_session_list` on a transport: the listed ids, and those marked current. */
|
|
93
|
+
const list_on = async (transport, headers, label) => {
|
|
94
|
+
const { sessions } = expect_output(await cross_rpc_call(transport, rpc_path, 'account_session_list', undefined, headers), SessionListOutput);
|
|
95
|
+
assert.ok(sessions.length > 0, `${label}: the account lists its sessions`);
|
|
96
|
+
return {
|
|
97
|
+
ids: sessions.map((s) => s.id).sort(),
|
|
98
|
+
current: sessions.filter((s) => s.is_current).map((s) => s.id)
|
|
99
|
+
};
|
|
100
|
+
};
|
|
92
101
|
describe('per-account session cap parity', () => {
|
|
93
102
|
test(`logging in ${max_sessions + 1} times evicts the oldest session (the newest ${max_sessions} resolve, the first does not)`, async () => {
|
|
94
103
|
const fixture = await setup_test();
|
|
@@ -148,15 +157,6 @@ export const describe_session_cap_cross_tests = (options) => {
|
|
|
148
157
|
});
|
|
149
158
|
const first = await login(fixture, 'the first login');
|
|
150
159
|
const second = await login(fixture, 'the second login');
|
|
151
|
-
/** `account_session_list` on a transport: the listed ids, and those marked current. */
|
|
152
|
-
const list_on = async (transport, headers, label) => {
|
|
153
|
-
const { sessions } = expect_output(await cross_rpc_call(transport, rpc_path, 'account_session_list', undefined, headers), SessionListOutput);
|
|
154
|
-
assert.ok(sessions.length > 0, `${label}: the account lists its sessions`);
|
|
155
|
-
return {
|
|
156
|
-
ids: sessions.map((s) => s.id).sort(),
|
|
157
|
-
current: sessions.filter((s) => s.is_current).map((s) => s.id)
|
|
158
|
-
};
|
|
159
|
-
};
|
|
160
160
|
const on_first = await list_on(first, {}, 'the first login');
|
|
161
161
|
const on_second = await list_on(second, {}, 'the second login');
|
|
162
162
|
assert.strictEqual(on_first.current.length, 1, 'the first login sees exactly one current session');
|
|
@@ -175,8 +175,19 @@ export const describe_session_cap_cross_tests = (options) => {
|
|
|
175
175
|
const on_daemon_with_cookie = await list_on(fixture.fresh_transport({ origin: null }), fixture.create_daemon_token_headers(fixture.create_session_headers()), 'a daemon-token caller sending a session cookie');
|
|
176
176
|
assert.deepStrictEqual(on_daemon_with_cookie.ids, on_keeper.ids);
|
|
177
177
|
assert.deepStrictEqual(on_daemon_with_cookie.current, [], 'a daemon token authenticated the request, not the cookie beside it');
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
});
|
|
179
|
+
test_if(ws !== undefined && ws_account_actions, "the session list over a socket marks the socket's own session current", async () => {
|
|
180
|
+
assert.ok(ws !== undefined);
|
|
181
|
+
const fixture = await setup_test();
|
|
182
|
+
await fixture.create_account({
|
|
183
|
+
username,
|
|
184
|
+
password_value: DEFAULT_TEST_PASSWORD,
|
|
185
|
+
roles: [...ws_account_roles]
|
|
186
|
+
});
|
|
187
|
+
const first = await login(fixture, 'the first login');
|
|
188
|
+
await login(fixture, 'the second login');
|
|
189
|
+
const on_first = await list_on(first, {}, 'the first login');
|
|
190
|
+
assert.strictEqual(on_first.current.length, 1, 'the first login sees exactly one current session');
|
|
180
191
|
const client = await create_ws_transport({
|
|
181
192
|
base_url: ws.base_url,
|
|
182
193
|
ws_path: ws.ws_path,
|
|
@@ -23,12 +23,13 @@ import '../assert_dev_env.js';
|
|
|
23
23
|
*/
|
|
24
24
|
import { type Infer, type AnySchema } from '@fuzdev/fuz_schema/schema.ts';
|
|
25
25
|
import { Uuid } from '../../primitive_schemas.js';
|
|
26
|
-
import type { TestAccount } from '../
|
|
26
|
+
import type { TestAccount } from '../test_app.js';
|
|
27
27
|
import type { BackendCapabilities } from './capabilities.js';
|
|
28
28
|
import { type FetchTransport } from '../transports/fetch_transport.js';
|
|
29
29
|
import { MigrationTracker, type SchemaSnapshot } from '../schema_introspect.js';
|
|
30
30
|
import { ActionManifest } from './action_manifest.js';
|
|
31
31
|
import type { BackendHandle } from './spawn_backend.js';
|
|
32
|
+
import { type DbInvariantExclusions } from '../db_invariant_queries.js';
|
|
32
33
|
/**
|
|
33
34
|
* Options for `TestFixture.create_account` — mints an additional
|
|
34
35
|
* bootstrapped account alongside the keeper. Matches the existing
|
|
@@ -247,6 +248,16 @@ export interface TestFixture {
|
|
|
247
248
|
* `assert_audit_event_metadata`.
|
|
248
249
|
*/
|
|
249
250
|
readonly reject_unknown_audit_metadata_keys?: boolean;
|
|
251
|
+
/**
|
|
252
|
+
* Check the database invariants (`DB_INVARIANTS`, less the setup's
|
|
253
|
+
* `exclude_db_invariants`) now, throwing on a violation — cross-process
|
|
254
|
+
* over the backend's `_testing_db_invariants`, in-process on the fixture's
|
|
255
|
+
* own database; a no-op when the setup excludes `all`. The setup
|
|
256
|
+
* already runs it when each test finishes if built inside that test; a
|
|
257
|
+
* fixture built in `beforeAll` and shared by a describe is checked by the
|
|
258
|
+
* suite (`check_db_invariants_after_all`).
|
|
259
|
+
*/
|
|
260
|
+
readonly assert_db_invariants: () => Promise<void>;
|
|
250
261
|
}
|
|
251
262
|
/**
|
|
252
263
|
* Fixture-producing function. Invoked once inside every `test()` body by
|
|
@@ -460,7 +471,26 @@ export interface CrossProcessSetupOptions {
|
|
|
460
471
|
readonly signup_path?: string;
|
|
461
472
|
/** REST login route `fixture.create_account` logs in through. Default `SPINE_ACCOUNT_LOGIN_PATH`. */
|
|
462
473
|
readonly login_path?: string;
|
|
474
|
+
/**
|
|
475
|
+
* Database invariants (`DB_INVARIANTS`) left unchecked after each test,
|
|
476
|
+
* each with the non-empty reason it can't hold — tests that write rows
|
|
477
|
+
* directly, without the cascade the spine runs, or a gap an `xfail_until`
|
|
478
|
+
* marker tracks (`DbInvariantExclusions`). Every other invariant is checked
|
|
479
|
+
* when a test that called `setup_test()` finishes, over the backend's
|
|
480
|
+
* `_testing_db_invariants` backdoor, which `capabilities.testing_backdoors`
|
|
481
|
+
* must declare — the setup throws otherwise, unless `all` turns the check
|
|
482
|
+
* off with its reason. The setup logs its exclusions once. Under
|
|
483
|
+
* `describe.concurrent` a violation can land on a sibling of the test that
|
|
484
|
+
* left it (`register_db_invariants_check`).
|
|
485
|
+
*/
|
|
486
|
+
readonly exclude_db_invariants?: DbInvariantExclusions;
|
|
463
487
|
}
|
|
488
|
+
/**
|
|
489
|
+
* Matches a username `fixture.create_account()` generates — fresh per
|
|
490
|
+
* call, so a cross-backend comparison treats it as a volatile value.
|
|
491
|
+
* Unanchored and without flags; build a `g` copy to replace every match.
|
|
492
|
+
*/
|
|
493
|
+
export declare const GENERATED_USERNAME_PATTERN: RegExp;
|
|
464
494
|
/**
|
|
465
495
|
* Capture a backend's schema snapshot over the `_testing_schema_snapshot`
|
|
466
496
|
* RPC action (keeper daemon-token channel). The canonical way for a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAQN,KAAK,KAAK,EACV,KAAK,SAAS,EACd,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAuB,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAKvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
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G;AACH,eAAO,MAAM,yBAAyB,GACrC,QAAQ,SAAS;IAAE,QAAQ,CAAC,OAAO,EAAE;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAA;CAAE,EAEpE,cAAc,MAAM,EACpB,WAAW;IACV,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC1C,QAAQ,CAAC,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CAC5C,EACD,QAAQ;IACP,QAAQ,CAAC,cAAc,EAAE,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjD,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC;QAAE,EAAE,EAAE,IAAI,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACjE,KACC,wBAAwB,CAAC,QAAQ,CAuDnC,CAAC;AAgUF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,sCAAsC,EAC9C,UAAU,wBAAwB,KAChC,SA+RF,CAAC"}
|
|
@@ -30,6 +30,8 @@ import { create_fetch_transport } from '../transports/fetch_transport.js';
|
|
|
30
30
|
import { MigrationTracker } from '../schema_introspect.js';
|
|
31
31
|
import { ActionManifest } from './action_manifest.js';
|
|
32
32
|
import { SPINE_ACCOUNT_LOGIN_PATH, SPINE_ACCOUNT_SIGNUP_PATH } from './spine_surface_constants.js';
|
|
33
|
+
import { announce_db_invariant_exclusions, assert_db_invariant_rows, register_db_invariants_check } from '../db_invariants.js';
|
|
34
|
+
import { DB_INVARIANTS_EXCLUDE_ALL, DbInvariantRows } from '../db_invariant_queries.js';
|
|
33
35
|
/**
|
|
34
36
|
* Build a `TestAccount` from a seeded `{account, actor, api_token,
|
|
35
37
|
* session_cookie}` bundle and the session cookie name — the header builders
|
|
@@ -126,6 +128,12 @@ const TokenCreateResponseShape = strip_object({
|
|
|
126
128
|
*/
|
|
127
129
|
let username_counter = 0;
|
|
128
130
|
const PID_BASE36 = process.pid.toString(36);
|
|
131
|
+
/**
|
|
132
|
+
* Matches a username `fixture.create_account()` generates — fresh per
|
|
133
|
+
* call, so a cross-backend comparison treats it as a volatile value.
|
|
134
|
+
* Unanchored and without flags; build a `g` copy to replace every match.
|
|
135
|
+
*/
|
|
136
|
+
export const GENERATED_USERNAME_PATTERN = /test_user_[0-9a-z]+_[0-9a-z]+_[0-9a-z]+/;
|
|
129
137
|
const generate_default_username = () => {
|
|
130
138
|
const suffix = `_${PID_BASE36}_${Date.now().toString(36)}_${(++username_counter).toString(36)}`;
|
|
131
139
|
const max_prefix = USERNAME_LENGTH_MAX - suffix.length;
|
|
@@ -615,6 +623,19 @@ export const default_cross_process_setup = (handle, options) => {
|
|
|
615
623
|
const signup_path = options?.signup_path ?? SPINE_ACCOUNT_SIGNUP_PATH;
|
|
616
624
|
const login_path = options?.login_path ?? SPINE_ACCOUNT_LOGIN_PATH;
|
|
617
625
|
const { cookie_name } = handle.config;
|
|
626
|
+
const exclude_db_invariants = options?.exclude_db_invariants;
|
|
627
|
+
const setup_label = `default_cross_process_setup(${handle.config.name})`;
|
|
628
|
+
announce_db_invariant_exclusions(exclude_db_invariants, setup_label);
|
|
629
|
+
const check_db_invariants = exclude_db_invariants?.[DB_INVARIANTS_EXCLUDE_ALL] === undefined;
|
|
630
|
+
if (check_db_invariants &&
|
|
631
|
+
!handle.config.capabilities.testing_backdoors.includes('_testing_db_invariants')) {
|
|
632
|
+
throw new Error(`${setup_label}: the backend doesn't declare _testing_db_invariants in ` +
|
|
633
|
+
`capabilities.testing_backdoors, so the per-test database invariant check can't run — ` +
|
|
634
|
+
`mount the backdoor and declare it, or turn the check off with ` +
|
|
635
|
+
`exclude_db_invariants: {${DB_INVARIANTS_EXCLUDE_ALL}: '<reason>'} on this setup ` +
|
|
636
|
+
`(through describe_spine_cross_suites, its ` +
|
|
637
|
+
`setup: {exclude_db_invariants: {${DB_INVARIANTS_EXCLUDE_ALL}: '<reason>'}})`);
|
|
638
|
+
}
|
|
618
639
|
return async () => {
|
|
619
640
|
const { keeper, extra_accounts: seeded_extras, extra_actors } = await fire_testing_reset(handle, {
|
|
620
641
|
extra_keeper_roles,
|
|
@@ -680,7 +701,7 @@ export const default_cross_process_setup = (handle, options) => {
|
|
|
680
701
|
base_url: handle.config.base_url,
|
|
681
702
|
initial_cookies: [`${cookie_name}=${keeper.session_cookie}`]
|
|
682
703
|
});
|
|
683
|
-
|
|
704
|
+
const fixture = {
|
|
684
705
|
transport,
|
|
685
706
|
fresh_transport: (fresh_options) => create_fetch_transport({
|
|
686
707
|
base_url: handle.config.base_url,
|
|
@@ -695,6 +716,14 @@ export const default_cross_process_setup = (handle, options) => {
|
|
|
695
716
|
extra_accounts,
|
|
696
717
|
extra_actors,
|
|
697
718
|
reject_unknown_audit_metadata_keys: options?.reject_unknown_audit_metadata_keys ?? false,
|
|
719
|
+
// over the backdoor on the daemon-token channel, unrecorded by a
|
|
720
|
+
// transcript, so a `memory://` backend is checked like any other
|
|
721
|
+
assert_db_invariants: async () => {
|
|
722
|
+
if (!check_db_invariants)
|
|
723
|
+
return;
|
|
724
|
+
const answer = await capture_via_daemon(refreshed_handle, '_testing_db_invariants', DbInvariantRows);
|
|
725
|
+
assert_db_invariant_rows(answer.rows, handle.config.name, exclude_db_invariants);
|
|
726
|
+
},
|
|
698
727
|
// Forge over the wire — the cross-process driver has no keyring,
|
|
699
728
|
// so `_testing_mint_session` mints the backdated row + signs the
|
|
700
729
|
// cookie server-side over the keeper's daemon-token channel.
|
|
@@ -773,5 +802,7 @@ export const default_cross_process_setup = (handle, options) => {
|
|
|
773
802
|
return other.api_token;
|
|
774
803
|
}
|
|
775
804
|
};
|
|
805
|
+
register_db_invariants_check(fixture.assert_db_invariants);
|
|
806
|
+
return fixture;
|
|
776
807
|
};
|
|
777
808
|
};
|
|
@@ -10,6 +10,7 @@ import { type AppSettingsCrossTestOptions } from './app_settings.js';
|
|
|
10
10
|
import { type BodySizeCrossTestOptions } from './body_size.js';
|
|
11
11
|
import { type BodySizeSmugglingCrossTestOptions } from './body_size_smuggling.js';
|
|
12
12
|
import type { BackendCapabilities } from './capabilities.js';
|
|
13
|
+
import { type CapabilityMountsCrossTestOptions } from './capability_mounts.js';
|
|
13
14
|
import { type CellGrantRoleCrossTestOptions } from './cell_grant_role.js';
|
|
14
15
|
import { type CookieAttributesCrossTestOptions } from './cookie_attributes.js';
|
|
15
16
|
import { type CredentialDeadlineCrossTestOptions } from './credential_deadline.js';
|
|
@@ -35,7 +36,7 @@ import { type RoomsWsCrossTestOptions } from './rooms_ws.js';
|
|
|
35
36
|
import { type RpcAdversarialCrossTestOptions } from './rpc_adversarial.js';
|
|
36
37
|
import { type SessionCapCrossTestOptions } from './session_cap.js';
|
|
37
38
|
import { type SessionCookieCodecCrossTestOptions } from './session_cookie_codec.js';
|
|
38
|
-
import { type CrossProcessSetupOptions, type ReconstructedBootstrappedBackendHandle, type RpcPathCapabilityGatedCrossSuiteOptions } from './setup.js';
|
|
39
|
+
import { type CrossProcessSetupOptions, type ReconstructedBootstrappedBackendHandle, type RpcPathCapabilityGatedCrossSuiteOptions, type SetupTest } from './setup.js';
|
|
39
40
|
import { type SimpleRequestCrossTestOptions } from './simple_request.js';
|
|
40
41
|
import { type TestingBackdoorMethod } from './spine_surface_constants.js';
|
|
41
42
|
import { type CrossProcessSseTestOptions } from './sse_round_trip.js';
|
|
@@ -57,7 +58,7 @@ import { type CrossProcessWsTestOptions } from './ws_round_trip.js';
|
|
|
57
58
|
* guard test holds it, with `STANDALONE_CROSS_SUITES`, to every module that
|
|
58
59
|
* exports a `describe_*` suite, so a new suite fails until it is registered.
|
|
59
60
|
*/
|
|
60
|
-
export declare const SUITE_NAMES: readonly ["account_lifecycle", "actor_lookup", "app_settings", "body_size", "body_size_smuggling", "cell_crud", "cell_gated_create", "cell_grant_role", "cell_grant_steward", "cell_moderate", "cell_ref_admission", "cell_relations", "cookie_attributes", "credential_conformance", "credential_conformance_wire", "credential_deadline", "credential_header_robustness", "fact_serving", "identity_parity", "origin", "origin_conformance", "origin_scope", "peer_ping_ws", "query_shape", "ready", "request_header_conformance_wire", "request_target_conformance_wire", "role_grant_offer_enumeration", "role_grant_offer_lifecycle", "role_grant_offer_notification_ws", "role_grant_participation", "role_grant_role_grammar", "rooms_ws", "rpc_adversarial", "session_cap", "session_cookie_codec", "simple_request", "sse_round_trip", "standard", "testing_backdoor", "token_lifetime", "token_scope_surface", "transport_composition", "ws_connection_cap", "ws_envelope", "ws_inbound_dispatch", "ws_outbound_overflow", "ws_role_gated", "ws_round_trip"];
|
|
61
|
+
export declare const SUITE_NAMES: readonly ["account_lifecycle", "actor_lookup", "app_settings", "body_size", "body_size_smuggling", "capability_mounts", "cell_crud", "cell_gated_create", "cell_grant_role", "cell_grant_steward", "cell_moderate", "cell_ref_admission", "cell_relations", "cookie_attributes", "credential_conformance", "credential_conformance_wire", "credential_deadline", "credential_header_robustness", "fact_serving", "identity_parity", "origin", "origin_conformance", "origin_scope", "peer_ping_ws", "query_shape", "ready", "request_header_conformance_wire", "request_target_conformance_wire", "role_grant_offer_enumeration", "role_grant_offer_lifecycle", "role_grant_offer_notification_ws", "role_grant_participation", "role_grant_role_grammar", "rooms_ws", "rpc_adversarial", "session_cap", "session_cookie_codec", "simple_request", "sse_round_trip", "standard", "testing_backdoor", "token_lifetime", "token_scope_surface", "transport_composition", "ws_connection_cap", "ws_envelope", "ws_inbound_dispatch", "ws_outbound_overflow", "ws_role_gated", "ws_round_trip"];
|
|
61
62
|
/** A shipped single-backend cross suite, named by its module. */
|
|
62
63
|
export type SuiteName = (typeof SUITE_NAMES)[number];
|
|
63
64
|
/** A shipped suite module `describe_spine_cross_suites` leaves out. */
|
|
@@ -75,6 +76,13 @@ export declare const STANDALONE_CROSS_SUITES: Readonly<Record<StandaloneSuiteNam
|
|
|
75
76
|
* backend whose `capabilities.testing_backdoors` lacks one fails at collection.
|
|
76
77
|
*/
|
|
77
78
|
export declare const SPINE_SUITES_REQUIRED_BACKDOORS: ReadonlyArray<TestingBackdoorMethod>;
|
|
79
|
+
/**
|
|
80
|
+
* The suites `describe_spine_cross_suites` runs on every backend, each with
|
|
81
|
+
* why: each checks declarations the other suites gate on, so neither `exclude`
|
|
82
|
+
* nor `exclude_cases` can name it, and an override can't change the
|
|
83
|
+
* declaration it reads.
|
|
84
|
+
*/
|
|
85
|
+
export declare const UNEXCLUDABLE_SPINE_SUITES: Readonly<Partial<Record<SuiteName, string>>>;
|
|
78
86
|
/** The options each suite takes, by `SuiteName` — what `overrides` entries are partials of. */
|
|
79
87
|
export interface SuiteOptionsMap {
|
|
80
88
|
account_lifecycle: AccountLifecycleCrossTestOptions;
|
|
@@ -82,6 +90,7 @@ export interface SuiteOptionsMap {
|
|
|
82
90
|
app_settings: AppSettingsCrossTestOptions;
|
|
83
91
|
body_size: BodySizeCrossTestOptions;
|
|
84
92
|
body_size_smuggling: BodySizeSmugglingCrossTestOptions;
|
|
93
|
+
capability_mounts: CapabilityMountsCrossTestOptions;
|
|
85
94
|
cell_crud: RpcPathCapabilityGatedCrossSuiteOptions;
|
|
86
95
|
cell_gated_create: RpcPathCapabilityGatedCrossSuiteOptions;
|
|
87
96
|
cell_grant_role: CellGrantRoleCrossTestOptions;
|
|
@@ -176,10 +185,12 @@ export interface SpineSuiteRoles {
|
|
|
176
185
|
readonly cell_grant?: string;
|
|
177
186
|
/**
|
|
178
187
|
* The admin-grantable role `role_grant_offer_lifecycle` offers,
|
|
179
|
-
* `role_grant_participation` confers,
|
|
180
|
-
* assigns in a scope and revokes
|
|
188
|
+
* `role_grant_participation` confers, `role_grant_offer_notification_ws`
|
|
189
|
+
* assigns in a scope and revokes, and `sse_round_trip` assigns globally and
|
|
190
|
+
* revokes, the audit stream staying open. Default `SPINE_PARTICIPANT_ROLE`;
|
|
181
191
|
* `ROLE_ADMIN` serves a backend with only the builtin roles (the scoped
|
|
182
|
-
* assign and scoped revoke cases then skip, as a builtin is global-only
|
|
192
|
+
* assign and scoped revoke cases then skip, as a builtin is global-only, and
|
|
193
|
+
* so does `sse_round_trip`'s keep case, `admin` being the stream's gate).
|
|
183
194
|
*/
|
|
184
195
|
readonly conferral?: string;
|
|
185
196
|
}
|
|
@@ -210,17 +221,29 @@ export interface SpineCrossSuitesOptions {
|
|
|
210
221
|
readonly setup?: CrossProcessSetupOptions;
|
|
211
222
|
/**
|
|
212
223
|
* Suites this backend doesn't run, each with a non-empty reason. Each shows
|
|
213
|
-
* in the run as one skipped test carrying the reason. Not
|
|
214
|
-
* nor
|
|
224
|
+
* in the run as one skipped test carrying the reason. Not a suite in
|
|
225
|
+
* `UNEXCLUDABLE_SPINE_SUITES`, nor one that already skips itself for an
|
|
226
|
+
* undeclared backdoor.
|
|
215
227
|
*/
|
|
216
228
|
readonly exclude?: Readonly<Partial<Record<SuiteName, string>>>;
|
|
217
229
|
/**
|
|
218
230
|
* Single tests this backend doesn't run, by suite, each by its name path
|
|
219
231
|
* (`SuiteCaseExclusions`) with a non-empty reason; each shows in the run as
|
|
220
|
-
* skipped with its reason. An entry naming a suite the call doesn't run,
|
|
221
|
-
* `
|
|
232
|
+
* skipped with its reason. An entry naming a suite the call doesn't run, a
|
|
233
|
+
* suite in `UNEXCLUDABLE_SPINE_SUITES`, or a path no collected test of that
|
|
234
|
+
* suite has, fails.
|
|
222
235
|
*/
|
|
223
236
|
readonly exclude_cases?: SuiteCaseExclusions;
|
|
237
|
+
/**
|
|
238
|
+
* The gated skips this backend owes — each test a suite registers skipped
|
|
239
|
+
* because the backend lacks what it gates on (`test_if`, a suite skipped
|
|
240
|
+
* for an undeclared backdoor), by its name path below the calling suite,
|
|
241
|
+
* with a non-empty reason. When given, a closing test
|
|
242
|
+
* (`check_declared_skips`) fails on a gated skip not listed here, and on
|
|
243
|
+
* an entry whose test runs or that names no test. An `exclude`d suite's
|
|
244
|
+
* skip is declared by its `exclude` entry. Omitted, no skip is checked.
|
|
245
|
+
*/
|
|
246
|
+
readonly expected_skips?: Readonly<Record<string, string>>;
|
|
224
247
|
/** Per-suite option overrides, a shallow merge over what the handle gives. */
|
|
225
248
|
readonly overrides?: SuiteOverrides;
|
|
226
249
|
/** The roles the role-shaped suites use, when the backend lacks the spine's own. */
|
|
@@ -262,6 +285,31 @@ export interface SpineCrossSuitesOptions {
|
|
|
262
285
|
*/
|
|
263
286
|
readonly rpc_input_overrides?: Map<string, Record<string, unknown>>;
|
|
264
287
|
}
|
|
288
|
+
/**
|
|
289
|
+
* Why fuz_app's transcript differential leaves a suite out: it opens
|
|
290
|
+
* WebSockets, sends on raw sockets, or reads the audit event stream — sends
|
|
291
|
+
* the recording can't see — or it is HTTP only but its requests carry each
|
|
292
|
+
* backend's own secrets re-spelled inside strings (`embedded_secrets`), which
|
|
293
|
+
* no normalization places. fuz_app's import census holds each kind to what
|
|
294
|
+
* the suite's module reaches.
|
|
295
|
+
*
|
|
296
|
+
* @internal Read by fuz_app's transcript differential — not stable API.
|
|
297
|
+
*/
|
|
298
|
+
export type SpineSuiteTranscriptExclusionKind = 'websocket' | 'raw_socket' | 'sse' | 'embedded_secrets';
|
|
299
|
+
/**
|
|
300
|
+
* Whether fuz_app's transcript differential — the suites run once per backend,
|
|
301
|
+
* every request and answer recorded and compared — runs a suite: `'http'`
|
|
302
|
+
* when every request it sends goes through the fixture transports the
|
|
303
|
+
* transcript records, else excluded with its kind and why.
|
|
304
|
+
*
|
|
305
|
+
* @internal Read by fuz_app's transcript differential — not stable API.
|
|
306
|
+
*/
|
|
307
|
+
export type SpineSuiteTranscript = 'http' | {
|
|
308
|
+
readonly excluded: {
|
|
309
|
+
readonly kind: SpineSuiteTranscriptExclusionKind;
|
|
310
|
+
readonly reason: string;
|
|
311
|
+
};
|
|
312
|
+
};
|
|
265
313
|
/**
|
|
266
314
|
* The backdoors every case of `name` drives beyond
|
|
267
315
|
* `SPINE_SUITES_REQUIRED_BACKDOORS` — a backend not declaring one skips the
|
|
@@ -272,6 +320,28 @@ export interface SpineCrossSuitesOptions {
|
|
|
272
320
|
* @internal
|
|
273
321
|
*/
|
|
274
322
|
export declare const get_spine_suite_backdoors: (name: SuiteName) => ReadonlyArray<TestingBackdoorMethod>;
|
|
323
|
+
/**
|
|
324
|
+
* Whether fuz_app's transcript differential runs `name` — the transcript's
|
|
325
|
+
* suite list is the `'http'` ones.
|
|
326
|
+
*
|
|
327
|
+
* @param name - the suite
|
|
328
|
+
* @returns its `SuiteEntry.transcript`
|
|
329
|
+
* @internal Read by fuz_app's transcript differential — not stable API.
|
|
330
|
+
*/
|
|
331
|
+
export declare const get_spine_suite_transcript: (name: SuiteName) => SpineSuiteTranscript;
|
|
332
|
+
/**
|
|
333
|
+
* Hold an override of an unexcludable suite to its allowlist
|
|
334
|
+
* (`UNEXCLUDABLE_OVERRIDE_KEYS`): any key with its derived value passes, a
|
|
335
|
+
* free key with any value, a droppable key with `undefined`, and every other
|
|
336
|
+
* change throws. Other suites pass unchecked.
|
|
337
|
+
*
|
|
338
|
+
* @param name - the suite
|
|
339
|
+
* @param patch - the override's patch, as merged over `derived`
|
|
340
|
+
* @param derived - the options the handle gives
|
|
341
|
+
* @throws Error - naming the key, on a fixed key moved or a key not admitted
|
|
342
|
+
* @internal Used by `describe_spine_cross_suites` and its tests — not stable API.
|
|
343
|
+
*/
|
|
344
|
+
export declare const check_unexcludable_override: (name: SuiteName, patch: object | undefined, derived: object) => void;
|
|
275
345
|
/** The top-level tasks one suite registered, as indices into the calling suite's tasks. */
|
|
276
346
|
export interface SuiteTaskRange {
|
|
277
347
|
readonly name: SuiteName;
|
|
@@ -308,20 +378,61 @@ export declare const check_spine_case_exclusions: (exclude_cases: SuiteCaseExclu
|
|
|
308
378
|
* @internal
|
|
309
379
|
*/
|
|
310
380
|
export declare const register_spine_case_exclusions: (exclude_cases: SuiteCaseExclusions, ranges: ReadonlyArray<SuiteTaskRange>) => void;
|
|
381
|
+
/**
|
|
382
|
+
* What `register_spine_suites` registers beyond `describe_spine_cross_suites`'s defaults.
|
|
383
|
+
*
|
|
384
|
+
* @internal Used by fuz_app's transcript differential — not stable API.
|
|
385
|
+
*/
|
|
386
|
+
export interface SpineSuiteRegistration {
|
|
387
|
+
/**
|
|
388
|
+
* The suites to register, run in `SUITE_NAMES` order whatever the order
|
|
389
|
+
* given; default every suite. An `exclude` or override naming a suite
|
|
390
|
+
* outside it is refused as dead unless a listed suite reads it beside its
|
|
391
|
+
* own (the mount suite reads its probes' siblings), and an `exclude_cases`
|
|
392
|
+
* entry outside it always is.
|
|
393
|
+
*/
|
|
394
|
+
readonly names?: ReadonlyArray<SuiteName>;
|
|
395
|
+
/**
|
|
396
|
+
* Wraps every suite's `setup_test` — the transcript differential's
|
|
397
|
+
* recorder — after its override merge, so a setup an override supplies is
|
|
398
|
+
* wrapped too; also the multi-actor setups a suite derives. A setup an
|
|
399
|
+
* override adds at a key the derive never filled, or deeper than one object
|
|
400
|
+
* level, isn't wrapped.
|
|
401
|
+
*/
|
|
402
|
+
readonly wrap_setup_test?: (setup_test: SetupTest) => SetupTest;
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* `describe_spine_cross_suites` over a chosen set of suites, each suite's
|
|
406
|
+
* `setup_test` passed through a wrapper — so another runner over the suites
|
|
407
|
+
* (fuz_app's transcript differential) builds every suite's options as the
|
|
408
|
+
* one call does and can't drift from it.
|
|
409
|
+
*
|
|
410
|
+
* @param handle - the backend, as `inject_backend_handle()` returns it
|
|
411
|
+
* @param options - as `describe_spine_cross_suites` takes them
|
|
412
|
+
* @param registration - the suites to register and the setup wrapper
|
|
413
|
+
* @throws Error - as `describe_spine_cross_suites`, and on an empty, unknown
|
|
414
|
+
* or repeated name, or an `exclude`, override or `exclude_cases` entry for a
|
|
415
|
+
* suite the registration neither runs nor reads
|
|
416
|
+
* @internal Used by `describe_spine_cross_suites` and fuz_app's transcript differential — not stable API.
|
|
417
|
+
*/
|
|
418
|
+
export declare const register_spine_suites: (handle: ReconstructedBootstrappedBackendHandle, options: SpineCrossSuitesOptions, registration: SpineSuiteRegistration) => void;
|
|
311
419
|
/**
|
|
312
420
|
* Run every shipped single-backend cross suite against one spawned backend —
|
|
313
421
|
* see the module doc for what the options add and what stays outside.
|
|
314
422
|
*
|
|
315
423
|
* @param handle - the backend, as `inject_backend_handle()` returns it
|
|
316
424
|
* @param options - the declared surface, plus excludes, case exclusions and overrides
|
|
317
|
-
* @throws Error - on an exclude with no reason, an unknown suite name, a suite
|
|
318
|
-
* both excluded and overridden, an excluded `
|
|
319
|
-
* its cases, or an override changing
|
|
425
|
+
* @throws Error - on an exclude or `expected_skips` entry with no reason, an unknown suite name, a suite
|
|
426
|
+
* both excluded and overridden, an excluded `UNEXCLUDABLE_SPINE_SUITES` suite
|
|
427
|
+
* (or one of its cases, or an override changing the declaration it checks), an exclude,
|
|
320
428
|
* override or `exclude_cases` entry for a suite that skips itself or isn't
|
|
321
429
|
* run, a backend not declaring `SPINE_SUITES_REQUIRED_BACKDOORS` (or
|
|
430
|
+
* `_testing_db_invariants` without `setup.exclude_db_invariants.all`, or
|
|
322
431
|
* `_testing_put_fact` with `fact_serving`, or `_testing_room_evict` with
|
|
323
432
|
* `rooms`), or a suite missing an input the
|
|
324
433
|
* handle doesn't carry
|
|
325
434
|
*/
|
|
326
435
|
export declare const describe_spine_cross_suites: (handle: ReconstructedBootstrappedBackendHandle, options: SpineCrossSuitesOptions) => void;
|
|
436
|
+
/** The `describe` holding one skipped test per suite the call leaves out. */
|
|
437
|
+
export declare const SPINE_SUITES_SKIPPED_TITLE = "spine cross suites excluded on this backend";
|
|
327
438
|
//# sourceMappingURL=spine_suites.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spine_suites.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/spine_suites.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"spine_suites.d.ts","sourceRoot":"","sources":["../../../src/lib/testing/cross_backend/spine_suites.ts"],"names":[],"mappings":"AAAA,OAAO,s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