@fuzdev/fuz_app 0.96.0 → 0.98.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/CLAUDE.md +57 -23
- package/dist/actions/action_bridge.d.ts.map +1 -1
- package/dist/actions/action_codegen.d.ts +1 -1
- package/dist/actions/action_codegen.d.ts.map +1 -1
- package/dist/actions/action_codegen.js +1 -1
- package/dist/actions/{action_peer.d.ts → action_dispatcher.d.ts} +12 -12
- package/dist/actions/action_dispatcher.d.ts.map +1 -0
- package/dist/actions/{action_peer.js → action_dispatcher.js} +2 -2
- package/dist/actions/action_event.d.ts.map +1 -1
- package/dist/actions/action_rpc.d.ts +9 -0
- package/dist/actions/action_rpc.d.ts.map +1 -1
- package/dist/actions/broadcast_api.d.ts +2 -2
- package/dist/actions/broadcast_api.d.ts.map +1 -1
- package/dist/actions/compile_action_registry.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.d.ts +3 -3
- package/dist/actions/frontend_rpc_client.d.ts.map +1 -1
- package/dist/actions/frontend_rpc_client.js +3 -3
- package/dist/actions/peer_ping.d.ts +147 -0
- package/dist/actions/peer_ping.d.ts.map +1 -0
- package/dist/actions/peer_ping.js +189 -0
- package/dist/actions/peer_request.d.ts +158 -0
- package/dist/actions/peer_request.d.ts.map +1 -0
- package/dist/actions/peer_request.js +167 -0
- package/dist/actions/perform_action.d.ts +8 -0
- package/dist/actions/perform_action.d.ts.map +1 -1
- package/dist/actions/perform_action.js +2 -1
- package/dist/actions/protocol.d.ts +3 -3
- package/dist/actions/protocol.d.ts.map +1 -1
- package/dist/actions/protocol.js +9 -4
- package/dist/actions/register_action_ws.d.ts.map +1 -1
- package/dist/actions/register_action_ws.js +28 -1
- package/dist/actions/rpc_client.d.ts +4 -4
- package/dist/actions/rpc_client.d.ts.map +1 -1
- package/dist/actions/socket.svelte.d.ts.map +1 -1
- package/dist/actions/transports.d.ts +1 -1
- package/dist/actions/transports_http.d.ts.map +1 -1
- package/dist/actions/transports_ws.d.ts +12 -5
- package/dist/actions/transports_ws.d.ts.map +1 -1
- package/dist/actions/transports_ws.js +36 -6
- package/dist/actions/transports_ws_backend.d.ts +34 -1
- package/dist/actions/transports_ws_backend.d.ts.map +1 -1
- package/dist/actions/transports_ws_backend.js +62 -5
- package/dist/auth/CLAUDE.md +13 -13
- package/dist/auth/actor_lookup_action_specs.d.ts.map +1 -1
- package/dist/auth/actor_search_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_action_specs.d.ts.map +1 -1
- package/dist/auth/admin_actions.d.ts.map +1 -1
- package/dist/auth/audit_log_queries.d.ts.map +1 -1
- package/dist/auth/audit_log_schema.d.ts.map +1 -1
- package/dist/auth/bearer_auth.d.ts.map +1 -1
- package/dist/auth/bearer_auth.js +6 -7
- package/dist/auth/bootstrap_routes.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.d.ts +21 -4
- package/dist/auth/daemon_token_middleware.d.ts.map +1 -1
- package/dist/auth/daemon_token_middleware.js +61 -10
- package/dist/auth/middleware.d.ts.map +1 -1
- package/dist/auth/middleware.js +6 -2
- package/dist/auth/role_grant_queries.d.ts +31 -12
- package/dist/auth/role_grant_queries.d.ts.map +1 -1
- package/dist/auth/role_grant_queries.js +36 -12
- package/dist/auth/role_schema.d.ts.map +1 -1
- package/dist/auth/self_service_role_actions.d.ts.map +1 -1
- package/dist/db/create_db.d.ts.map +1 -1
- package/dist/db/fact_store.d.ts.map +1 -1
- package/dist/db/status.d.ts.map +1 -1
- package/dist/http/CLAUDE.md +3 -2
- package/dist/http/auth_shape.d.ts.map +1 -1
- package/dist/http/db_routes.d.ts.map +1 -1
- package/dist/http/error_schemas.d.ts +0 -6
- package/dist/http/error_schemas.d.ts.map +1 -1
- package/dist/http/error_schemas.js +0 -6
- package/dist/http/jsonrpc_helpers.d.ts +1 -1
- package/dist/http/jsonrpc_helpers.js +1 -1
- package/dist/http/origin.d.ts +18 -1
- package/dist/http/origin.d.ts.map +1 -1
- package/dist/http/origin.js +17 -0
- package/dist/rate_limiter.d.ts.map +1 -1
- package/dist/rate_limiter.js +11 -0
- package/dist/server/app_backend.d.ts.map +1 -1
- package/dist/server/app_server.d.ts.map +1 -1
- package/dist/server/serve_fact_route.d.ts.map +1 -1
- package/dist/server/serve_fact_route.js +7 -4
- package/dist/testing/CLAUDE.md +41 -18
- package/dist/testing/admin_integration.d.ts.map +1 -1
- package/dist/testing/adversarial_input.d.ts.map +1 -1
- package/dist/testing/adversarial_input.js +3 -1
- package/dist/testing/attack_surface.d.ts.map +1 -1
- package/dist/testing/audit_completeness.d.ts.map +1 -1
- package/dist/testing/audit_completeness.js +4 -1
- package/dist/testing/cross_backend/action_manifest.d.ts +7 -7
- package/dist/testing/cross_backend/action_manifest.js +7 -7
- package/dist/testing/cross_backend/action_manifest_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.d.ts.map +1 -1
- package/dist/testing/cross_backend/bootstrap_backend.js +8 -0
- package/dist/testing/cross_backend/capabilities.d.ts +15 -12
- package/dist/testing/cross_backend/capabilities.d.ts.map +1 -1
- package/dist/testing/cross_backend/capabilities.js +4 -4
- package/dist/testing/cross_backend/cell_cross_helpers.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.d.ts +42 -0
- package/dist/testing/cross_backend/conformance_case.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_case.js +47 -0
- package/dist/testing/cross_backend/conformance_table.d.ts.map +1 -1
- package/dist/testing/cross_backend/conformance_table.js +90 -3
- package/dist/testing/cross_backend/cookie_attributes.d.ts +20 -0
- package/dist/testing/cross_backend/cookie_attributes.d.ts.map +1 -0
- package/dist/testing/cross_backend/cookie_attributes.js +158 -0
- package/dist/testing/cross_backend/credential_header_robustness.d.ts +12 -0
- package/dist/testing/cross_backend/credential_header_robustness.d.ts.map +1 -0
- package/dist/testing/cross_backend/credential_header_robustness.js +179 -0
- package/dist/testing/cross_backend/default_backend_configs.d.ts.map +1 -1
- package/dist/testing/cross_backend/default_backend_configs.js +5 -3
- package/dist/testing/cross_backend/fact_serving.d.ts.map +1 -1
- package/dist/testing/cross_backend/fact_serving.js +5 -1
- package/dist/testing/cross_backend/full_spine_mount.d.ts.map +1 -1
- package/dist/testing/cross_backend/full_spine_mount.js +7 -0
- package/dist/testing/cross_backend/identity_parity.d.ts.map +1 -1
- package/dist/testing/cross_backend/login_security.d.ts.map +1 -1
- package/dist/testing/cross_backend/method_coverage.d.ts +3 -7
- package/dist/testing/cross_backend/method_coverage.d.ts.map +1 -1
- package/dist/testing/cross_backend/method_coverage.js +1 -2
- package/dist/testing/cross_backend/peer_ping_ws.js +1 -1
- package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts +26 -0
- package/dist/testing/cross_backend/role_grant_offer_enumeration.d.ts.map +1 -0
- package/dist/testing/cross_backend/role_grant_offer_enumeration.js +108 -0
- package/dist/testing/cross_backend/rust_spine_stub_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.d.ts +17 -0
- package/dist/testing/cross_backend/setup.d.ts.map +1 -1
- package/dist/testing/cross_backend/setup.js +31 -8
- package/dist/testing/cross_backend/testing_reset_actions.d.ts +0 -13
- package/dist/testing/cross_backend/testing_reset_actions.d.ts.map +1 -1
- package/dist/testing/cross_backend/testing_reset_actions.js +12 -4
- package/dist/testing/cross_backend/ts_spine_backend_config.d.ts.map +1 -1
- package/dist/testing/cross_backend/ts_spine_backend_config.js +9 -3
- package/dist/testing/data_exposure.d.ts.map +1 -1
- package/dist/testing/db.d.ts.map +1 -1
- package/dist/testing/db_entities.d.ts +15 -0
- package/dist/testing/db_entities.d.ts.map +1 -1
- package/dist/testing/db_entities.js +16 -1
- package/dist/testing/error_coverage.d.ts.map +1 -1
- package/dist/testing/error_coverage.js +1 -2
- package/dist/testing/integration_helpers.d.ts.map +1 -1
- package/dist/testing/rate_limiting.d.ts.map +1 -1
- package/dist/testing/round_trip.d.ts.map +1 -1
- package/dist/testing/rpc_attack_surface.d.ts.map +1 -1
- package/dist/testing/rpc_helpers.d.ts.map +1 -1
- package/dist/testing/rpc_round_trip.d.ts.map +1 -1
- package/dist/testing/schema_generators.d.ts.map +1 -1
- package/dist/testing/schema_generators.js +3 -1
- package/dist/testing/schema_parity.d.ts.map +1 -1
- package/dist/testing/sse_round_trip.d.ts.map +1 -1
- package/dist/testing/surface_invariants.d.ts.map +1 -1
- package/dist/testing/transports/bootstrap.d.ts.map +1 -1
- package/dist/testing/transports/ws_client.d.ts +1 -1
- package/dist/testing/transports/ws_transport.d.ts +1 -1
- package/dist/testing/ws_round_trip.d.ts +1 -1
- package/dist/testing/ws_round_trip.d.ts.map +1 -1
- package/dist/testing/ws_round_trip.js +3 -3
- package/dist/ui/CLAUDE.md +6 -3
- package/dist/ui/auth_state.svelte.d.ts.map +1 -1
- package/dist/ui/form_state.svelte.d.ts.map +1 -1
- package/dist/ui/role_grant_offers_state.svelte.d.ts +1 -1
- package/dist/ui/role_grant_offers_state.svelte.js +1 -1
- package/dist/ui/ui_format.d.ts.map +1 -1
- package/package.json +2 -2
- package/dist/actions/action_peer.d.ts.map +0 -1
|
@@ -68,7 +68,11 @@ export const describe_fact_serving_cross_tests = (options) => {
|
|
|
68
68
|
const { setup_test, setup_test_multi_actor, capabilities } = options;
|
|
69
69
|
const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
|
|
70
70
|
/** Seed an embedded fact over the daemon channel; returns its `blake3:` hash. */
|
|
71
|
-
const put_fact = async (fixture, content, content_type) => expect_output(await cross_rpc_call(
|
|
71
|
+
const put_fact = async (fixture, content, content_type) => expect_output(await cross_rpc_call(
|
|
72
|
+
// Origin-free transport — the daemon-token middleware discards the
|
|
73
|
+
// credential when an `Origin` / `Referer` is present (browser
|
|
74
|
+
// context), and cross-process `fixture.transport` auto-adds `Origin`.
|
|
75
|
+
fixture.fresh_transport({ origin: null }), rpc_path, '_testing_put_fact', content_type === undefined ? { content } : { content, content_type }, fixture.create_daemon_token_headers()), TestingPutFactOutput).hash;
|
|
72
76
|
/**
|
|
73
77
|
* Create a cell referencing `hash` (`extract_refs` lifts it into `cell.refs`).
|
|
74
78
|
* Pass `acting` when the caller's account holds more than one actor —
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"full_spine_mount.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/full_spine_mount.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"full_spine_mount.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/full_spine_mount.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAE3D,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAC,kBAAkB,EAAC,MAAM,8CAA8C,CAAC;AAKrF,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,oCAAoC,CAAC;AAOzE,2FAA2F;AAC3F,MAAM,WAAW,qBAAqB;IACrC;;;;;;OAMG;IACH,QAAQ,CAAC,kBAAkB,EAAE,gBAAgB,CAAC;IAC9C;;;;OAIG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,kBAAkB,GAAG,IAAI,CAAC;CACzD;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,4BAA4B,GACxC,MAAM,OAAO,EACb,SAAS,qBAAqB,KAC5B,KAAK,CAAC,SAAS,CA0BjB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,GACpC,KAAK,gBAAgB,EACrB,SAAS,qBAAqB,KAC5B,KAAK,CAAC,eAAe,CAEvB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
|
+
import { peer_ping_action } from '../../actions/peer_ping.js';
|
|
2
3
|
import { create_standard_rpc_actions } from '../../auth/standard_rpc_actions.js';
|
|
3
4
|
import { create_all_cell_actions } from '../../auth/all_cell_actions.js';
|
|
4
5
|
import { create_actor_lookup_actions } from '../../auth/actor_lookup_actions.js';
|
|
@@ -29,6 +30,12 @@ export const build_full_spine_rpc_actions = (deps, options) => {
|
|
|
29
30
|
...create_all_cell_actions(deps, { roles: spine_roles }),
|
|
30
31
|
...create_actor_lookup_actions(deps),
|
|
31
32
|
...create_actor_search_actions(deps),
|
|
33
|
+
// `peer/ping` is mounted on the HTTP RPC endpoint too (not just WS) so an
|
|
34
|
+
// HTTP invocation reaches the handler and refuses with `peer_no_transport`
|
|
35
|
+
// rather than `method_not_found`. It's a protocol action, so it's filtered
|
|
36
|
+
// out of the action manifest (`create_testing_action_manifest_action`) —
|
|
37
|
+
// the WS endpoint registers it via the `protocol_actions` spread.
|
|
38
|
+
peer_ping_action,
|
|
32
39
|
];
|
|
33
40
|
// Append the `_testing_action_manifest` backdoor last — it closes over the
|
|
34
41
|
// complete `actions` list (plus its own spec) to dump the live method set
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity_parity.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/identity_parity.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqG9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAkB1C,uDAAuD;AACvD,MAAM,WAAW,8BAA8B;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AA0JD,eAAO,MAAM,oCAAoC,GAChD,SAAS,8BAA8B,KACrC,
|
|
1
|
+
{"version":3,"file":"identity_parity.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/identity_parity.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAqG9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAkB1C,uDAAuD;AACvD,MAAM,WAAW,8BAA8B;IAC9C,+DAA+D;IAC/D,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAC7B,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;CAC9B;AA0JD,eAAO,MAAM,oCAAoC,GAChD,SAAS,8BAA8B,KACrC,IA6TF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"login_security.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/login_security.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAoD9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAE1C,mDAAmD;AACnD,MAAM,WAAW,6BAA6B;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAyBD,eAAO,MAAM,mCAAmC,GAC/C,SAAS,6BAA6B,KACpC,
|
|
1
|
+
{"version":3,"file":"login_security.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/login_security.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAoD9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAE1C,mDAAmD;AACnD,MAAM,WAAW,6BAA6B;IAC7C,2EAA2E;IAC3E,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,kFAAkF;IAClF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC7B;AAyBD,eAAO,MAAM,mCAAmC,GAC/C,SAAS,6BAA6B,KACpC,IAsGF,CAAC"}
|
|
@@ -7,19 +7,15 @@ export type MethodCoverageTier =
|
|
|
7
7
|
* the spec-derived round-trip + attack-surface suites — no bespoke suite
|
|
8
8
|
* needed.
|
|
9
9
|
*/
|
|
10
|
-
'declared'
|
|
11
|
-
/**
|
|
10
|
+
'declared' /**
|
|
12
11
|
* Live-mounted but deliberately off the declared surface (stateful or
|
|
13
12
|
* opt-in). Covered only by a dedicated imperative `describe_*_cross_tests`
|
|
14
13
|
* suite, so the entry must name it.
|
|
15
|
-
*/
|
|
16
|
-
| 'off_surface'
|
|
17
|
-
/**
|
|
14
|
+
*/ | 'off_surface' /**
|
|
18
15
|
* A `_testing_*` daemon-token backdoor — live-mounted on the test binary,
|
|
19
16
|
* never on the declared surface. Coverage is the credential-gate suite plus
|
|
20
17
|
* the in-process spec-level gate test.
|
|
21
|
-
*/
|
|
22
|
-
| 'backdoor';
|
|
18
|
+
*/ | 'backdoor';
|
|
23
19
|
/** One row of the live-RPC-method coverage manifest. */
|
|
24
20
|
export interface MethodCoverageEntry {
|
|
25
21
|
/** The RPC method name (`action.spec.method`). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method_coverage.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/method_coverage.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAiC9B,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAE3D,sEAAsE;AACtE,MAAM,MAAM,kBAAkB;AAC7B;;;;GAIG;AACD,UAAU
|
|
1
|
+
{"version":3,"file":"method_coverage.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/method_coverage.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAiC9B,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAE3D,sEAAsE;AACtE,MAAM,MAAM,kBAAkB;AAC7B;;;;GAIG;AACD,UAAU,CAAC;;;;GAIV,GACD,aAAa,CAAC;;;;GAIb,GACD,UAAU,CAAC;AAEd,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IACnC,kDAAkD;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,kCAAkC;IAClC,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAC;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,mBAAmB,CAAC;IAChD;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,qDAAqD;AACrD,MAAM,WAAW,sBAAsB;IACtC,wEAAwE;IACxE,QAAQ,CAAC,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,wEAAwE;IACxE,QAAQ,CAAC,gBAAgB,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACjD,+DAA+D;IAC/D,QAAQ,CAAC,QAAQ,EAAE,aAAa,CAAC,mBAAmB,CAAC,CAAC;IACtD,yDAAyD;IACzD,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;CACxC;AAID;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B,GAAI,OAAO,sBAAsB,KAAG,IAyF1E,CAAC"}
|
|
@@ -79,8 +79,7 @@ export const assert_rpc_method_coverage = (input) => {
|
|
|
79
79
|
case 'off_surface':
|
|
80
80
|
assert.ok(!is_declared, `method coverage: '${entry.method}' is tagged 'off_surface' but is on the declared ` +
|
|
81
81
|
`surface — retag it 'declared' (the spec-derived suites already enumerate it)`);
|
|
82
|
-
assert.ok(!is_backdoor, `method coverage: '${entry.method}' is tagged 'off_surface' but starts with '${prefix}' ` +
|
|
83
|
-
`— retag it 'backdoor'`);
|
|
82
|
+
assert.ok(!is_backdoor, `method coverage: '${entry.method}' is tagged 'off_surface' but starts with '${prefix}' ` + `— retag it 'backdoor'`);
|
|
84
83
|
assert.ok(!!entry.suite, `method coverage: off-surface method '${entry.method}' must name the cross-backend ` +
|
|
85
84
|
`'suite' that covers it — it gets no auto-enumeration`);
|
|
86
85
|
break;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../assert_dev_env.js';
|
|
2
2
|
/**
|
|
3
3
|
* Cross-process **server-initiated `peer/ping`** suite — the machinery
|
|
4
|
-
* proof for
|
|
4
|
+
* proof for ActionPeer (a backend initiating a JSON-RPC request to a
|
|
5
5
|
* connected client and awaiting its typed reply). The sibling of the
|
|
6
6
|
* one-way notification suite (`role_grant_offer_notification_ws.ts`),
|
|
7
7
|
* extended from server→client *notifications* to server→client
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import '../assert_dev_env.js';
|
|
2
|
+
import type { SetupTest } from './setup.js';
|
|
3
|
+
/**
|
|
4
|
+
* Username of the bootstrap-seeded single-actor admin grantor. The entrypoint
|
|
5
|
+
* seeds it via `extra_accounts: [{username: OFFER_GRANTOR_USERNAME, roles:
|
|
6
|
+
* [ROLE_ADMIN]}]`. A *separate* account is required (an account can't offer to
|
|
7
|
+
* itself), and it must be single-actor so its `role_grant_offer_create` resolves
|
|
8
|
+
* without an `acting` selector — which rules out the now-multi-actor keeper and
|
|
9
|
+
* `fixture.create_account` (whose internal `invite_create` runs as the
|
|
10
|
+
* multi-actor keeper and would hit `actor_required`).
|
|
11
|
+
*/
|
|
12
|
+
export declare const OFFER_GRANTOR_USERNAME = "offer_grantor";
|
|
13
|
+
/** Options for the offer-enumeration parity suite. */
|
|
14
|
+
export interface RoleGrantOfferEnumerationCrossTestOptions {
|
|
15
|
+
/**
|
|
16
|
+
* Per-test fixture producer. **Must be configured with `extra_actors`** (≥1)
|
|
17
|
+
* so the keeper is multi-actor and the sibling-actor mismatch arm is
|
|
18
|
+
* reachable — the entrypoint passes
|
|
19
|
+
* `default_cross_process_setup(handle, {extra_actors: [...]})`.
|
|
20
|
+
*/
|
|
21
|
+
readonly setup_test: SetupTest;
|
|
22
|
+
/** RPC endpoint path. Default `/api/rpc`. */
|
|
23
|
+
readonly rpc_path?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare const describe_role_grant_offer_enumeration_cross_tests: (options: RoleGrantOfferEnumerationCrossTestOptions) => void;
|
|
26
|
+
//# sourceMappingURL=role_grant_offer_enumeration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"role_grant_offer_enumeration.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/role_grant_offer_enumeration.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAuD9B,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,YAAY,CAAC;AAK1C;;;;;;;;GAQG;AACH,eAAO,MAAM,sBAAsB,kBAAkB,CAAC;AAEtD,sDAAsD;AACtD,MAAM,WAAW,yCAAyC;IACzD;;;;;OAKG;IACH,QAAQ,CAAC,UAAU,EAAE,SAAS,CAAC;IAC/B,6CAA6C;IAC7C,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC3B;AAQD,eAAO,MAAM,iDAAiD,GAC7D,SAAS,yCAAyC,KAChD,IA2FF,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import '../assert_dev_env.js';
|
|
2
|
+
/**
|
|
3
|
+
* Cross-backend parity suite for the **role_grant_offer_accept enumeration
|
|
4
|
+
* boundary** — the deliberate 403-vs-404 split on the accept path.
|
|
5
|
+
*
|
|
6
|
+
* `role_grant_offer_accept` distinguishes two denials, and the distinction is a
|
|
7
|
+
* conscious decision (not an accident to mask away):
|
|
8
|
+
*
|
|
9
|
+
* - **a genuinely-nonexistent offer (or one on another account) → 404**
|
|
10
|
+
* `role_grant_offer_not_found`. The account-scoped IDOR guard refuses to
|
|
11
|
+
* confirm an offer id the caller's account doesn't own — so a cross-account
|
|
12
|
+
* prober learns nothing.
|
|
13
|
+
* - **an offer that exists on the caller's OWN account but is targeted to a
|
|
14
|
+
* different actor (a sibling persona) → 403** `role_grant_offer_actor_mismatch`.
|
|
15
|
+
* This reveals "an offer exists for a sibling actor" to a co-account caller —
|
|
16
|
+
* but there is **no cross-account leak**: every actor in the distinction
|
|
17
|
+
* belongs to the one account already authenticated, so the 403 discloses
|
|
18
|
+
* nothing a principal can't already see about its own account. Masking this to
|
|
19
|
+
* 404 would only obscure a legitimate "not yours to accept, pick the right
|
|
20
|
+
* persona" signal. So 403 is the chosen, defensible behavior — and both spines
|
|
21
|
+
* must agree on it (a future Rust or TS change that over-masked the sibling
|
|
22
|
+
* case to 404, or under-masked the cross-account case to 403, is the
|
|
23
|
+
* regression this suite catches).
|
|
24
|
+
*
|
|
25
|
+
* The actor-mismatch arm only fires for an *actor-targeted* offer accepted by a
|
|
26
|
+
* sibling actor, so the suite needs a multi-actor recipient. The keeper is the
|
|
27
|
+
* only fixture account that can be seeded multi-actor (`extra_actors`), and an
|
|
28
|
+
* account can't offer to itself — so the grantor is a separate admin account and
|
|
29
|
+
* the recipient is the keeper (actor A = `fixture.actor` is the offer target;
|
|
30
|
+
* actor B = `fixture.extra_actors[0]` is the rejected sibling).
|
|
31
|
+
*
|
|
32
|
+
* Multi-step (create → accept) and using the `acting` selector, so this is an
|
|
33
|
+
* imperative suite (not a `conformance_table` row). The accept verb is on every
|
|
34
|
+
* spine's standard RPC surface, so the suite is ungated. Cross-process only: the
|
|
35
|
+
* sibling-actor / actor-targeted-offer setup is a wire flow. Cited property:
|
|
36
|
+
* `docs/security.md` §"Authorization" (the 404-over-403 mask is scoped to
|
|
37
|
+
* cross-principal leaks; an intra-account sibling-actor offer stays a 403
|
|
38
|
+
* `role_grant_offer_actor_mismatch`).
|
|
39
|
+
*
|
|
40
|
+
* `$lib`-free by contract (relative specifiers only), like the sibling
|
|
41
|
+
* cross-backend suites.
|
|
42
|
+
*
|
|
43
|
+
* @module
|
|
44
|
+
*/
|
|
45
|
+
import { describe, test, assert } from 'vitest';
|
|
46
|
+
import { rpc_call } from '../rpc_helpers.js';
|
|
47
|
+
import { ROLE_ADMIN } from '../../auth/role_schema.js';
|
|
48
|
+
import { ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH, ERROR_ROLE_GRANT_OFFER_NOT_FOUND, } from '../../auth/role_grant_offer_action_specs.js';
|
|
49
|
+
import { SPINE_RPC_PATH } from './default_spine_surface.js';
|
|
50
|
+
/** A well-formed UUID that never names a real offer — exercises the not-found arm. */
|
|
51
|
+
const NIL_UUID = '00000000-0000-0000-0000-000000000000';
|
|
52
|
+
/**
|
|
53
|
+
* Username of the bootstrap-seeded single-actor admin grantor. The entrypoint
|
|
54
|
+
* seeds it via `extra_accounts: [{username: OFFER_GRANTOR_USERNAME, roles:
|
|
55
|
+
* [ROLE_ADMIN]}]`. A *separate* account is required (an account can't offer to
|
|
56
|
+
* itself), and it must be single-actor so its `role_grant_offer_create` resolves
|
|
57
|
+
* without an `acting` selector — which rules out the now-multi-actor keeper and
|
|
58
|
+
* `fixture.create_account` (whose internal `invite_create` runs as the
|
|
59
|
+
* multi-actor keeper and would hit `actor_required`).
|
|
60
|
+
*/
|
|
61
|
+
export const OFFER_GRANTOR_USERNAME = 'offer_grantor';
|
|
62
|
+
/** The `error.data.reason` of a failed RPC call, or `undefined`. */
|
|
63
|
+
const reason_of = (res) => res.ok
|
|
64
|
+
? undefined
|
|
65
|
+
: res.error.data?.reason;
|
|
66
|
+
export const describe_role_grant_offer_enumeration_cross_tests = (options) => {
|
|
67
|
+
const { setup_test } = options;
|
|
68
|
+
const rpc_path = options.rpc_path ?? SPINE_RPC_PATH;
|
|
69
|
+
const rpc = (transport, method, params, headers) => rpc_call({ app: transport, path: rpc_path, method, params, headers });
|
|
70
|
+
describe('role_grant_offer accept enumeration (403 vs 404)', () => {
|
|
71
|
+
test('actor-targeted offer: sibling-actor accept → 403 actor_mismatch; targeted actor accepts the SAME offer → 200', async () => {
|
|
72
|
+
const fixture = await setup_test();
|
|
73
|
+
const sibling = fixture.extra_actors[0];
|
|
74
|
+
assert.ok(sibling, 'suite requires the keeper seeded with an extra actor — pass extra_actors in the entrypoint');
|
|
75
|
+
// Actor A (the keeper's bootstrap actor) is the offer target; actor B
|
|
76
|
+
// (the seeded sibling) is the one that must be rejected.
|
|
77
|
+
const target_actor = fixture.actor;
|
|
78
|
+
// Grantor must be a SEPARATE single-actor admin account (an account
|
|
79
|
+
// can't offer to itself; the keeper is multi-actor here so its own
|
|
80
|
+
// offer/invite calls would need an `acting`). Seeded via
|
|
81
|
+
// `extra_accounts` in the entrypoint.
|
|
82
|
+
const grantor = fixture.extra_accounts[OFFER_GRANTOR_USERNAME];
|
|
83
|
+
assert.ok(grantor, `suite requires an admin grantor seeded via extra_accounts['${OFFER_GRANTOR_USERNAME}']`);
|
|
84
|
+
// Offer ROLE_ADMIN to the keeper's account, TARGETED at actor A.
|
|
85
|
+
const created = await rpc(fixture.fresh_transport(), 'role_grant_offer_create', { to_account_id: fixture.account.id, to_actor_id: target_actor.id, role: ROLE_ADMIN }, grantor.create_session_headers());
|
|
86
|
+
assert.ok(created.ok, `offer create must succeed: ${JSON.stringify(created)}`);
|
|
87
|
+
const offer_id = created.result.offer.id;
|
|
88
|
+
// Sibling actor B (same account) tries to accept A's offer → 403
|
|
89
|
+
// actor_mismatch. The offer stays pending (no mutation on the denial).
|
|
90
|
+
const sibling_accept = await rpc(fixture.transport, 'role_grant_offer_accept', { offer_id, acting: sibling.id }, fixture.create_session_headers());
|
|
91
|
+
assert.strictEqual(sibling_accept.status, 403, 'sibling-actor accept must be 403');
|
|
92
|
+
assert.strictEqual(reason_of(sibling_accept), ERROR_ROLE_GRANT_OFFER_ACTOR_MISMATCH, 'sibling-actor accept must carry the actor_mismatch reason (not a 404 mask)');
|
|
93
|
+
// Control: the TARGETED actor A accepts the very same offer → 200. Proves
|
|
94
|
+
// the 403 above was a genuine wrong-actor signal, not a broken/unacceptable
|
|
95
|
+
// offer (which would make the 403 vacuous).
|
|
96
|
+
const target_accept = await rpc(fixture.transport, 'role_grant_offer_accept', { offer_id, acting: target_actor.id }, fixture.create_session_headers());
|
|
97
|
+
assert.ok(target_accept.ok && target_accept.status === 200, `targeted-actor accept of the same offer must succeed: ${JSON.stringify(target_accept)}`);
|
|
98
|
+
});
|
|
99
|
+
test('a nonexistent offer → 404 not_found (the cross-principal mask, distinct from the intra-account 403)', async () => {
|
|
100
|
+
const fixture = await setup_test();
|
|
101
|
+
// A valid `acting` (the keeper's own actor) so resolution passes and the
|
|
102
|
+
// handler reaches the offer lookup — which finds nothing → 404.
|
|
103
|
+
const res = await rpc(fixture.transport, 'role_grant_offer_accept', { offer_id: NIL_UUID, acting: fixture.actor.id }, fixture.create_session_headers());
|
|
104
|
+
assert.strictEqual(res.status, 404, 'a nonexistent offer must be 404');
|
|
105
|
+
assert.strictEqual(reason_of(res), ERROR_ROLE_GRANT_OFFER_NOT_FOUND, 'a nonexistent offer must carry the not_found reason');
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rust_spine_stub_backend_config.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/rust_spine_stub_backend_config.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAuC9B,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AASvD,uGAAuG;AACvG,eAAO,MAAM,uBAAuB,oCAAoC,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,6CAA6C,CAAC;AAenG,kGAAkG;AAClG,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,0FAA0F;AAC1F,eAAO,MAAM,oCAAoC,sDACG,CAAC;AAErD,MAAM,WAAW,6BAA6B;IAC7C,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B,GAC1C,UAAS,6BAAkC,KACzC,
|
|
1
|
+
{"version":3,"file":"rust_spine_stub_backend_config.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/rust_spine_stub_backend_config.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAuC9B,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AASvD,uGAAuG;AACvG,eAAO,MAAM,uBAAuB,oCAAoC,CAAC;AAEzE;;;;;GAKG;AACH,eAAO,MAAM,wCAAwC,6CAA6C,CAAC;AAenG,kGAAkG;AAClG,eAAO,MAAM,4BAA4B,OAAO,CAAC;AAEjD,0FAA0F;AAC1F,eAAO,MAAM,oCAAoC,sDACG,CAAC;AAErD,MAAM,WAAW,6BAA6B;IAC7C,8DAA8D;IAC9D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,+EAA+E;IAC/E,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;OAOG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,MAAM,CAAC;CAClC;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,8BAA8B,GAC1C,UAAS,6BAAkC,KACzC,aAiDF,CAAC"}
|
|
@@ -253,6 +253,11 @@ export interface RpcPathCrossSuiteOptions extends CrossSuiteOptions {
|
|
|
253
253
|
* const bootstrapped: BootstrappedBackendHandle = {
|
|
254
254
|
* ...handle,
|
|
255
255
|
* keeper_transport,
|
|
256
|
+
* keeper_daemon_transport: create_fetch_transport({
|
|
257
|
+
* base_url: config.base_url,
|
|
258
|
+
* initial_cookies: keeper.cookies,
|
|
259
|
+
* origin: null,
|
|
260
|
+
* }),
|
|
256
261
|
* keeper_account: keeper.account,
|
|
257
262
|
* keeper_actor: keeper.actor,
|
|
258
263
|
* keeper_cookies: keeper.cookies,
|
|
@@ -268,6 +273,18 @@ export interface RpcPathCrossSuiteOptions extends CrossSuiteOptions {
|
|
|
268
273
|
export interface BootstrappedBackendHandle extends BackendHandle {
|
|
269
274
|
/** Transport carrying the keeper session cookie + cookie jar. */
|
|
270
275
|
readonly keeper_transport: FetchTransport;
|
|
276
|
+
/**
|
|
277
|
+
* Daemon-token transport for the keeper — same cookie jar as
|
|
278
|
+
* `keeper_transport` but with `origin: null` so it sends no `Origin`
|
|
279
|
+
* header. The daemon-token middleware discards the credential in a
|
|
280
|
+
* browser context (any `Origin` / `Referer`), so the `_testing_*`
|
|
281
|
+
* daemon-token calls (`_testing_reset` / `_testing_schema_snapshot` /
|
|
282
|
+
* `_testing_action_manifest` / `_testing_mint_session`) must route
|
|
283
|
+
* through this Origin-free transport. CSRF/cookie-session calls
|
|
284
|
+
* (`invite_create`, `role_grant_offer_create`) stay on `keeper_transport`,
|
|
285
|
+
* which keeps its default `Origin`.
|
|
286
|
+
*/
|
|
287
|
+
readonly keeper_daemon_transport: FetchTransport;
|
|
271
288
|
/** Keeper account JSON captured from `POST /bootstrap`. */
|
|
272
289
|
readonly keeper_account: {
|
|
273
290
|
readonly id: Uuid;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/setup.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AA0B9B,OAAO,EAAC,IAAI,EAAC,MAAM,wBAAwB,CAAC;AAK5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,kBAAkB,CAAC;AAClD,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,mBAAmB,CAAC;AAC3D,OAAO,EAAyB,KAAK,cAAc,EAAC,MAAM,kCAAkC,CAAC;AAC7F,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAC,cAAc,EAAC,MAAM,sBAAsB,CAAC;AACpD,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAC;AAEtD;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC/B;;;;;;;OAOG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;;GAMG;AACH,MAAM,MAAM,kBAAkB,GAAG,WAAW,CAAC;AAE7C;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,gBAAgB;IAChC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;CACtC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;;GASG;AACH,eAAO,MAAM,uBAAuB,GACnC,QAAQ,sCAAsC,KAC5C,OAAO,CAAC,cAAc,CAUxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,MAAM,CAAC;AAuUlD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,eAAO,MAAM,2BAA2B,GACvC,QAAQ,sCAAsC,EAC9C,UAAU,wBAAwB,KAChC,SA8IF,CAAC"}
|
|
@@ -82,6 +82,15 @@ export const reconstruct_bootstrapped_handle = (serialized) => ({
|
|
|
82
82
|
base_url: serialized.config.base_url,
|
|
83
83
|
initial_cookies: serialized.keeper_cookies,
|
|
84
84
|
}),
|
|
85
|
+
// Same cookie jar but Origin-free so the daemon-token middleware doesn't
|
|
86
|
+
// discard the credential as browser-context — used by the `_testing_*`
|
|
87
|
+
// daemon-token calls (`_testing_reset` / `_testing_schema_snapshot` /
|
|
88
|
+
// `_testing_action_manifest` / `_testing_mint_session`).
|
|
89
|
+
keeper_daemon_transport: create_fetch_transport({
|
|
90
|
+
base_url: serialized.config.base_url,
|
|
91
|
+
initial_cookies: serialized.keeper_cookies,
|
|
92
|
+
origin: null,
|
|
93
|
+
}),
|
|
85
94
|
});
|
|
86
95
|
/**
|
|
87
96
|
* Structural subset of `SignupOutput` the runner cares about. Looser
|
|
@@ -163,7 +172,7 @@ const rpc_via_transport = async (transport, rpc_path, method, params, backend_na
|
|
|
163
172
|
* the snapshot shapes match by design.
|
|
164
173
|
*/
|
|
165
174
|
export const capture_schema_snapshot = async (handle, options = {}) => {
|
|
166
|
-
const raw = await rpc_via_transport(handle.
|
|
175
|
+
const raw = await rpc_via_transport(handle.keeper_daemon_transport, handle.config.rpc_path, '_testing_schema_snapshot', { exclude_tables: [...(options.exclude_tables ?? [])] }, handle.config.name, { [DAEMON_TOKEN_HEADER]: handle.daemon_token });
|
|
167
176
|
// TODO: cast, not parse — `SchemaSnapshot.parse(raw)` would validate the wire
|
|
168
177
|
// against the schema (the `capture_action_manifest` twin parses + uses a
|
|
169
178
|
// strict object); parsing here may surface a latent schema-model gap to
|
|
@@ -181,7 +190,7 @@ export const capture_schema_snapshot = async (handle, options = {}) => {
|
|
|
181
190
|
* `fuz_testing` mirror); the normalized shapes match by design.
|
|
182
191
|
*/
|
|
183
192
|
export const capture_action_manifest = async (handle) => {
|
|
184
|
-
const raw = await rpc_via_transport(handle.
|
|
193
|
+
const raw = await rpc_via_transport(handle.keeper_daemon_transport, handle.config.rpc_path, '_testing_action_manifest', {}, handle.config.name, { [DAEMON_TOKEN_HEADER]: handle.daemon_token });
|
|
185
194
|
return ActionManifest.parse(raw);
|
|
186
195
|
};
|
|
187
196
|
/**
|
|
@@ -215,7 +224,7 @@ const TestingResetResponseShape = z.object({
|
|
|
215
224
|
* can close over them.
|
|
216
225
|
*/
|
|
217
226
|
const fire_testing_reset = async (handle, options) => {
|
|
218
|
-
const raw = await rpc_via_transport(handle.
|
|
227
|
+
const raw = await rpc_via_transport(handle.keeper_daemon_transport, handle.config.rpc_path, '_testing_reset', {
|
|
219
228
|
extra_keeper_roles: options.extra_keeper_roles ?? [],
|
|
220
229
|
extra_accounts: (options.extra_accounts ?? []).map((spec) => ({
|
|
221
230
|
username: spec.username,
|
|
@@ -365,14 +374,12 @@ const grant_roles_via_offer_accept = async (handle, minted, roles) => {
|
|
|
365
374
|
for (const role of roles) {
|
|
366
375
|
const offer_result = (await rpc_via_transport(handle.keeper_transport, handle.config.rpc_path, 'role_grant_offer_create', { to_account_id: minted.account.id, role }, `${handle.config.name}, role=${role}`));
|
|
367
376
|
if (!offer_result?.offer?.id) {
|
|
368
|
-
throw new Error(`role_grant_offer_create(${handle.config.name}, role=${role}) returned unexpected result: ` +
|
|
369
|
-
JSON.stringify(offer_result));
|
|
377
|
+
throw new Error(`role_grant_offer_create(${handle.config.name}, role=${role}) returned unexpected result: ` + JSON.stringify(offer_result));
|
|
370
378
|
}
|
|
371
379
|
const offer_id = offer_result.offer.id;
|
|
372
380
|
const accept_result = await rpc_via_transport(minted.transport, handle.config.rpc_path, 'role_grant_offer_accept', { offer_id }, `${handle.config.name}, role=${role}`);
|
|
373
381
|
if (!accept_result) {
|
|
374
|
-
throw new Error(`role_grant_offer_accept(${handle.config.name}, role=${role}) returned unexpected result: ` +
|
|
375
|
-
JSON.stringify(accept_result));
|
|
382
|
+
throw new Error(`role_grant_offer_accept(${handle.config.name}, role=${role}) returned unexpected result: ` + JSON.stringify(accept_result));
|
|
376
383
|
}
|
|
377
384
|
}
|
|
378
385
|
};
|
|
@@ -387,6 +394,17 @@ const create_keeper_transport = (handle, cookie_name, session_cookie) => create_
|
|
|
387
394
|
base_url: handle.config.base_url,
|
|
388
395
|
initial_cookies: [`${cookie_name}=${session_cookie}`],
|
|
389
396
|
});
|
|
397
|
+
/**
|
|
398
|
+
* Origin-free twin of `create_keeper_transport` — same fresh keeper cookie
|
|
399
|
+
* jar but `origin: null` so the daemon-token middleware doesn't discard the
|
|
400
|
+
* credential as browser-context. Used for the per-test `_testing_*`
|
|
401
|
+
* daemon-token calls (the rebuilt handle's `keeper_daemon_transport`).
|
|
402
|
+
*/
|
|
403
|
+
const create_keeper_daemon_transport = (handle, cookie_name, session_cookie) => create_fetch_transport({
|
|
404
|
+
base_url: handle.config.base_url,
|
|
405
|
+
initial_cookies: [`${cookie_name}=${session_cookie}`],
|
|
406
|
+
origin: null,
|
|
407
|
+
});
|
|
390
408
|
/**
|
|
391
409
|
* Build a `SetupTest` against a spawned + bootstrapped backend.
|
|
392
410
|
*
|
|
@@ -428,9 +446,14 @@ export const default_cross_process_setup = (handle, options) => {
|
|
|
428
446
|
// `session_cookie` for any keeper-acting calls this test makes
|
|
429
447
|
// (e.g. `fixture.create_account()`'s `invite_create` step).
|
|
430
448
|
const keeper_transport = create_keeper_transport(handle, cookie_name, keeper.session_cookie);
|
|
449
|
+
// Origin-free twin for the per-test daemon-token calls — the original
|
|
450
|
+
// `handle.keeper_daemon_transport` carries the wiped `globalSetup` keeper
|
|
451
|
+
// cookie, so rebuild it against the freshly re-seeded keeper.
|
|
452
|
+
const keeper_daemon_transport = create_keeper_daemon_transport(handle, cookie_name, keeper.session_cookie);
|
|
431
453
|
const refreshed_handle = {
|
|
432
454
|
...handle,
|
|
433
455
|
keeper_transport,
|
|
456
|
+
keeper_daemon_transport,
|
|
434
457
|
keeper_account: keeper.account,
|
|
435
458
|
keeper_actor: keeper.actor,
|
|
436
459
|
keeper_cookies: [`${cookie_name}=${keeper.session_cookie}`],
|
|
@@ -508,7 +531,7 @@ export const default_cross_process_setup = (handle, options) => {
|
|
|
508
531
|
// so `_testing_mint_session` mints the backdated row + signs the
|
|
509
532
|
// cookie server-side over the keeper's daemon-token channel.
|
|
510
533
|
mint_expired_session: async () => {
|
|
511
|
-
const raw = await rpc_via_transport(refreshed_handle.
|
|
534
|
+
const raw = await rpc_via_transport(refreshed_handle.keeper_daemon_transport, handle.config.rpc_path, '_testing_mint_session', { account_id: keeper.account.id, expires_in_seconds: EXPIRED_SESSION_OFFSET_SECONDS }, handle.config.name, { [DAEMON_TOKEN_HEADER]: handle.daemon_token });
|
|
512
535
|
const parsed = MintSessionResponseShape.safeParse(raw);
|
|
513
536
|
if (!parsed.success) {
|
|
514
537
|
throw new Error(`_testing_mint_session(${handle.config.name}) returned unexpected result: ` +
|
|
@@ -389,19 +389,6 @@ export declare const testing_action_manifest_action_spec: {
|
|
|
389
389
|
readonly async: true;
|
|
390
390
|
readonly description: string;
|
|
391
391
|
};
|
|
392
|
-
/**
|
|
393
|
-
* Build the `_testing_action_manifest` action over a backend's full live RPC
|
|
394
|
-
* mount. The handler closes over a manifest computed once at assembly time
|
|
395
|
-
* from every `mounted` spec **plus this action's own spec** — the manifest
|
|
396
|
-
* action is itself a live method, so it must appear in the dump it serves.
|
|
397
|
-
* `mounted` excludes it (it's appended to the mount *after* the rest is
|
|
398
|
-
* assembled, in `build_full_spine_rpc_actions`), so its static spec is folded
|
|
399
|
-
* in here; the Rust mirror folds in its own descriptor the same way.
|
|
400
|
-
*
|
|
401
|
-
* Pass the protocol-action-free full mount: the protocol actions
|
|
402
|
-
* (`heartbeat` / `cancel`) are excluded by construction so the cross-impl
|
|
403
|
-
* diff stays apples-to-apples (see `action_manifest.ts` §Scope).
|
|
404
|
-
*/
|
|
405
392
|
export declare const create_testing_action_manifest_action: (mounted: ReadonlyArray<RpcAction>) => RpcAction;
|
|
406
393
|
/** Options for `create_testing_actions`. */
|
|
407
394
|
export interface CreateTestingActionsOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,SAAS,EAAC,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"testing_reset_actions.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/testing_reset_actions.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAItB,OAAO,EAAa,KAAK,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAKvE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,oBAAoB,CAAC;AAChD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACjE,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,4BAA4B,CAAC;AACjE,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAgCvC;;;;;;;;;;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OAAO,EACb,SAAS,2BAA2B,KAClC,KAAK,CAAC,SAAS,CAqIjB,CAAC;AAEF,0FAA0F;AAC1F,eAAO,MAAM,0BAA0B,UAAmC,CAAC"}
|
|
@@ -69,6 +69,7 @@ import { z } from 'zod';
|
|
|
69
69
|
import { Uuid } from '@fuzdev/fuz_util/id.ts';
|
|
70
70
|
import { fact_hash_bytes, FactHashSchema } from '@fuzdev/fuz_util/fact_hash.ts';
|
|
71
71
|
import { rpc_action } from '../../actions/action_rpc.js';
|
|
72
|
+
import { protocol_action_specs } from '../../actions/protocol.js';
|
|
72
73
|
import { query_put_fact } from '../../db/fact_queries.js';
|
|
73
74
|
import { ROLE_ADMIN, ROLE_KEEPER } from '../../auth/role_schema.js';
|
|
74
75
|
import { auth_integration_truncate_tables } from '../db.js';
|
|
@@ -343,13 +344,20 @@ export const testing_action_manifest_action_spec = {
|
|
|
343
344
|
* assembled, in `build_full_spine_rpc_actions`), so its static spec is folded
|
|
344
345
|
* in here; the Rust mirror folds in its own descriptor the same way.
|
|
345
346
|
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
347
|
+
* Protocol actions (`heartbeat` / `cancel` / `peer/ping`) are filtered out of
|
|
348
|
+
* the manifest here so the cross-impl diff stays apples-to-apples: the two
|
|
349
|
+
* impls organize them differently (`peer/ping` is on the TS spine's WS **and**
|
|
350
|
+
* HTTP-RPC endpoints; heartbeat/cancel WS-only; the Rust stub compiles one
|
|
351
|
+
* shared registry serving both transports), so including them would be a
|
|
352
|
+
* spurious divergence (see `action_manifest.ts` §Scope). The exclusion set is
|
|
353
|
+
* the live `protocol_action_specs` bundle — kept in lockstep with the static
|
|
354
|
+
* `PROTOCOL_ACTION_METHODS` by a drift-guard test — so this stays off the
|
|
355
|
+
* heavyweight `action_codegen` module the spawned binary would otherwise pull in.
|
|
349
356
|
*/
|
|
357
|
+
const PROTOCOL_METHODS = new Set(protocol_action_specs.map((spec) => spec.method));
|
|
350
358
|
export const create_testing_action_manifest_action = (mounted) => {
|
|
351
359
|
const manifest = build_action_manifest([
|
|
352
|
-
...mounted.map((action) => action.spec),
|
|
360
|
+
...mounted.map((action) => action.spec).filter((spec) => !PROTOCOL_METHODS.has(spec.method)),
|
|
353
361
|
testing_action_manifest_action_spec,
|
|
354
362
|
]);
|
|
355
363
|
return rpc_action(testing_action_manifest_action_spec, async () => manifest);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ts_spine_backend_config.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ts_spine_backend_config.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAQvD,8GAA8G;AAC9G,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"ts_spine_backend_config.d.ts","sourceRoot":"../src/lib/","sources":["../../../src/lib/testing/cross_backend/ts_spine_backend_config.ts"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAE9B;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAQvD,8GAA8G;AAC9G,eAAO,MAAM,gBAAgB,6BAA6B,CAAC;AAE3D;;;;;;;;;GASG;AACH,eAAO,MAAM,iBAAiB,4BAA4B,CAAC;AA+B3D,6FAA6F;AAC7F,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,iDAAiD;AACjD,eAAO,MAAM,0BAA0B,OAAO,CAAC;AAE/C,gDAAgD;AAChD,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,wDAAwD,CAAC;AAEzF,yDAAyD;AACzD,eAAO,MAAM,mBAAmB,wDAAwD,CAAC;AAEzF,wDAAwD;AACxD,eAAO,MAAM,kBAAkB,uDAAuD,CAAC;AAEvF,MAAM,WAAW,2BAA2B;IAC3C,mFAAmF;IACnF,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,8DAA8D;IAC9D,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;;;;;;;OASG;IACH,QAAQ,CAAC,uBAAuB,CAAC,EAAE,OAAO,CAAC;CAC3C;AAWD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,GACxC,UAAS,2BAAgC,KACvC,aAmBF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,GACvC,UAAS,2BAAgC,KACvC,aAmBF,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GACxC,UAAS,2BAAgC,KACvC,aAgCF,CAAC"}
|
|
@@ -16,10 +16,16 @@ export const TS_SPINE_DIR_ENV = 'FUZ_TESTING_TS_SPINE_DIR';
|
|
|
16
16
|
export const TS_SPINE_SSE_PATH = '/api/admin/audit/stream';
|
|
17
17
|
/**
|
|
18
18
|
* Capabilities for the TS spine binary — `ts_default_capabilities` plus `sse`
|
|
19
|
-
* (the binary wires `audit_log_sse`)
|
|
20
|
-
* `/ready` deploy gate in `build_spine_app`)
|
|
19
|
+
* (the binary wires `audit_log_sse`), `ready` (the binary live-mounts the
|
|
20
|
+
* `/ready` deploy gate in `build_spine_app`), and `peer_request` (the backend
|
|
21
|
+
* WS transport's `request_connection` path drives server→client `peer/ping`).
|
|
21
22
|
*/
|
|
22
|
-
const ts_spine_capabilities = Object.freeze({
|
|
23
|
+
const ts_spine_capabilities = Object.freeze({
|
|
24
|
+
...ts_default_capabilities,
|
|
25
|
+
sse: true,
|
|
26
|
+
ready: true,
|
|
27
|
+
peer_request: true,
|
|
28
|
+
});
|
|
23
29
|
/**
|
|
24
30
|
* Capabilities for the **Bun** spine binary — `ts_spine_capabilities` with
|
|
25
31
|
* `oversized_reject_closes_connection: false`. `Bun.serve` drains the declared
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAqB7B,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAC,SAAS,EAAc,MAAM,0BAA0B,CAAC;AAIrE;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,GAAI,QAAQ,OAAO,KAAG,GAAG,CAAC,MAAM,CAuB9E,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,yCAAyC,GACrD,SAAS,UAAU,EACnB,mBAAkB,aAAa,CAAC,MAAM,CAA6B,KACjE,IAWF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wCAAwC,GACpD,SAAS,UAAU,EACnB,oBAAmB,aAAa,CAAC,MAAM,CAA8B,KACnE,
|
|
1
|
+
{"version":3,"file":"data_exposure.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/data_exposure.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAqB7B,OAAO,KAAK,EAAC,UAAU,EAAE,cAAc,EAAC,MAAM,oBAAoB,CAAC;AAYnE,OAAO,KAAK,EAAC,mBAAmB,EAAC,MAAM,iCAAiC,CAAC;AACzE,OAAO,KAAK,EAAC,SAAS,EAAc,MAAM,0BAA0B,CAAC;AAIrE;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,GAAI,QAAQ,OAAO,KAAG,GAAG,CAAC,MAAM,CAuB9E,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,yCAAyC,GACrD,SAAS,UAAU,EACnB,mBAAkB,aAAa,CAAC,MAAM,CAA6B,KACjE,IAWF,CAAC;AAEF;;G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EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACjC,IAAI,EAAE,OAAO,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,GAAU,IAAI,EAAE,KAAG,OAAO,CAAC,IAAI,CAGvD,CAAC;AAMF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,qBAAqB,GAAI,aAAa,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,KAAG,SAkB7E,CAAC;AAEH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,iBAAiB,GAC7B,aAAa,CAAC,EAAE,EAAE,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,EACtC,WAAW,MAAM,KACf,SAgEF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,UAQhC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gCAAgC,UAAyC,CAAC;AAEvF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,gBAAgB,GAAU,IAAI,EAAE,KAAG,OAAO,CAAC,IAAI,CAG3D,CAAC;AAEF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,kBAAkB,GAC9B,WAAW,SAAS,GAAG,KAAK,CAAC,SAAS,CAAC,EACvC,iBAAiB,KAAK,CAAC,MAAM,CAAC,KAC5B,CAAC,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,IAAI,KAAK,IAAI,CAwBzD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,qBAAqB,GAAI,WAAW,KAAK,CAAC,SAAS,CAAC,KAAG,IAQnE,CAAC"}
|
|
@@ -40,4 +40,19 @@ export declare const create_test_account_with_actor: (db: Db, options: {
|
|
|
40
40
|
* suites don't reimplement the same direct-seed wrapper.
|
|
41
41
|
*/
|
|
42
42
|
export declare const create_test_role_grant_direct: (db: Db, input: CreateRoleGrantInput) => Promise<RoleGrant>;
|
|
43
|
+
/**
|
|
44
|
+
* Add a second `actor` to an existing test account — the multi-actor edge.
|
|
45
|
+
*
|
|
46
|
+
* Wraps the production `query_create_actor`; the TS twin of the Rust
|
|
47
|
+
* `tests/common` `seed_extra_actor` helper. Lets a `.db.test.ts` suite build a
|
|
48
|
+
* multi-actor account without reimplementing the raw insert.
|
|
49
|
+
*/
|
|
50
|
+
export declare const create_test_extra_actor: (db: Db, account_id: string, name: string) => Promise<Actor>;
|
|
51
|
+
/**
|
|
52
|
+
* Soft-delete (tombstone) one actor via the production `query_actor_soft_delete`
|
|
53
|
+
* — returns `true` when an active row flipped. The TS twin of the Rust
|
|
54
|
+
* `query_actor_soft_delete` the guard tests use, for seeding the latent
|
|
55
|
+
* multi-actor tombstone state directly (no per-actor-delete RPC ships yet).
|
|
56
|
+
*/
|
|
57
|
+
export declare const soft_delete_test_actor: (db: Db, actor_id: string) => Promise<boolean>;
|
|
43
58
|
//# sourceMappingURL=db_entities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db_entities.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/db_entities.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"db_entities.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/db_entities.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AA0B7B,OAAO,KAAK,EAAC,OAAO,EAAE,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAC,MAAM,2BAA2B,CAAC;AAC/F,OAAO,KAAK,EAAC,EAAE,EAAC,MAAM,aAAa,CAAC;AAEpC,oFAAoF;AACpF,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,KAAK,CAAC;CACb;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,8BAA8B,GAC1C,IAAI,EAAE,EACN,SAAS;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,CAAC,EAAE,MAAM,CAAA;CAAC,KACjD,OAAO,CAAC,oBAAoB,CAI7B,CAAC;AAEH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,6BAA6B,GACzC,IAAI,EAAE,EACN,OAAO,oBAAoB,KACzB,OAAO,CAAC,SAAS,CAAyC,CAAC;AAE9D;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,GACnC,IAAI,EAAE,EACN,YAAY,MAAM,EAClB,MAAM,MAAM,KACV,OAAO,CAAC,KAAK,CAA+C,CAAC;AAEhE;;;;;GAKG;AACH,eAAO,MAAM,sBAAsB,GAAU,IAAI,EAAE,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,OAAO,CACzC,CAAC"}
|
|
@@ -16,7 +16,7 @@ import './assert_dev_env.js';
|
|
|
16
16
|
*
|
|
17
17
|
* @module
|
|
18
18
|
*/
|
|
19
|
-
import { query_create_account_with_actor } from '../auth/account_queries.js';
|
|
19
|
+
import { query_create_account_with_actor, query_create_actor, query_actor_soft_delete, } from '../auth/account_queries.js';
|
|
20
20
|
import { query_create_role_grant } from '../auth/role_grant_queries.js';
|
|
21
21
|
/**
|
|
22
22
|
* Create an `account` + `actor` row pair in the database for tests.
|
|
@@ -49,3 +49,18 @@ export const create_test_account_with_actor = async (db, options) => query_creat
|
|
|
49
49
|
* suites don't reimplement the same direct-seed wrapper.
|
|
50
50
|
*/
|
|
51
51
|
export const create_test_role_grant_direct = async (db, input) => query_create_role_grant({ db }, input);
|
|
52
|
+
/**
|
|
53
|
+
* Add a second `actor` to an existing test account — the multi-actor edge.
|
|
54
|
+
*
|
|
55
|
+
* Wraps the production `query_create_actor`; the TS twin of the Rust
|
|
56
|
+
* `tests/common` `seed_extra_actor` helper. Lets a `.db.test.ts` suite build a
|
|
57
|
+
* multi-actor account without reimplementing the raw insert.
|
|
58
|
+
*/
|
|
59
|
+
export const create_test_extra_actor = async (db, account_id, name) => query_create_actor({ db }, account_id, name);
|
|
60
|
+
/**
|
|
61
|
+
* Soft-delete (tombstone) one actor via the production `query_actor_soft_delete`
|
|
62
|
+
* — returns `true` when an active row flipped. The TS twin of the Rust
|
|
63
|
+
* `query_actor_soft_delete` the guard tests use, for seeding the latent
|
|
64
|
+
* multi-actor tombstone state directly (no per-actor-delete RPC ships yet).
|
|
65
|
+
*/
|
|
66
|
+
export const soft_delete_test_actor = async (db, actor_id) => query_actor_soft_delete({ db }, actor_id, null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error_coverage.d.ts","sourceRoot":"../src/lib/","sources":["../../src/lib/testing/error_coverage.ts"],"names":[],"mappings":"AAAA,OAAO,qBAAqB,CAAC;AAE7B;;;;;;;;;;;GAWG;AAEH,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,uBAAuB,CAAC;AAIrD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,4BAA4B,GAAI,QAAQ,CAAC,CAAC,OAAO,KAAG,KAAK,CAAC,MAAM,CAAC,GAAG,IAWhF,CAAC;AAEF,sFAAsF;AACtF,MAAM,WAAW,cAAc;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;CACd;AAED,6EAA6E;AAC7E,MAAM,WAAW,qBAAqB;IACrC,kDAAkD;IAClD,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,iCAAiC;IACjC,eAAe,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAChC;AAqDD;;;;;;;;;;;;;;;GAeG;AACH,qBAAa,sBAAsB;IAClC;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,CAAa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;CACtB;AAaD;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,qBAAqB,GACjC,WAAW,sBAAsB,EACjC,aAAa,KAAK,CAAC,SAAS,CAAC,EAC7B,UAAU,oBAAoB,KAC5B,IAsBF,CAAC"}
|
|
@@ -217,7 +217,6 @@ export const assert_error_coverage = (collector, route_specs, options) => {
|
|
|
217
217
|
console.log(`[error coverage] ${covered}/${total} (${(ratio * 100).toFixed(1)}%)` +
|
|
218
218
|
(uncovered_lines.length > 0 ? `\n uncovered:\n ${uncovered_lines.join('\n ')}` : ''));
|
|
219
219
|
if (min_coverage > 0) {
|
|
220
|
-
assert.ok(ratio >= min_coverage, `Error coverage ${(ratio * 100).toFixed(1)}% below threshold ${(min_coverage * 100).toFixed(1)}%` +
|
|
221
|
-
`\n uncovered:\n ${uncovered_lines.join('\n ')}`);
|
|
220
|
+
assert.ok(ratio >= min_coverage, `Error coverage ${(ratio * 100).toFixed(1)}% below threshold ${(min_coverage * 100).toFixed(1)}%` + `\n uncovered:\n ${uncovered_lines.join('\n ')}`);
|
|
222
221
|
}
|
|
223
222
|
};
|