@codemem/core 0.49.1 → 0.50.0-beta.2
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/api-types.d.ts +7 -0
- package/dist/api-types.d.ts.map +1 -1
- package/dist/better-sqlite-coordinator-runtime.d.ts.map +1 -1
- package/dist/better-sqlite-coordinator-store.d.ts +56 -3
- package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
- package/dist/boundary-readiness-inventory.d.ts +27 -0
- package/dist/boundary-readiness-inventory.d.ts.map +1 -0
- package/dist/coordinator-account-link-receiver.d.ts +15 -0
- package/dist/coordinator-account-link-receiver.d.ts.map +1 -1
- package/dist/coordinator-account-link-status-client.d.ts +1 -1
- package/dist/coordinator-account-link-status-client.d.ts.map +1 -1
- package/dist/coordinator-actions.d.ts +14 -0
- package/dist/coordinator-actions.d.ts.map +1 -1
- package/dist/coordinator-api.d.ts +7 -0
- package/dist/coordinator-api.d.ts.map +1 -1
- package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -1
- package/dist/coordinator-auth-link-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-auth-schema-stage.d.ts +14 -2
- package/dist/coordinator-auth-schema-stage.d.ts.map +1 -1
- package/dist/coordinator-block-tombstone-test-harness.d.ts +3 -0
- package/dist/coordinator-block-tombstone-test-harness.d.ts.map +1 -0
- package/dist/coordinator-bootstrap-authorization-api-test-harness.d.ts.map +1 -1
- package/dist/coordinator-bootstrap-authorization-test-harness.d.ts.map +1 -1
- package/dist/coordinator-bootstrap-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-boundary-readiness-client.d.ts +35 -0
- package/dist/coordinator-boundary-readiness-client.d.ts.map +1 -0
- package/dist/coordinator-boundary-readiness-route.d.ts +52 -0
- package/dist/coordinator-boundary-readiness-route.d.ts.map +1 -0
- package/dist/coordinator-boundary-readiness-test-harness.d.ts +15 -0
- package/dist/coordinator-boundary-readiness-test-harness.d.ts.map +1 -0
- package/dist/coordinator-boundary-readiness.d.ts +161 -0
- package/dist/coordinator-boundary-readiness.d.ts.map +1 -0
- package/dist/coordinator-browser-auth-app.d.ts +1 -1
- package/dist/coordinator-browser-auth-app.d.ts.map +1 -1
- package/dist/coordinator-browser-auth-callback.d.ts +2 -1
- package/dist/coordinator-browser-auth-callback.d.ts.map +1 -1
- package/dist/coordinator-controller-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-d1-schema-inventory.d.ts +2 -0
- package/dist/coordinator-d1-schema-inventory.d.ts.map +1 -1
- package/dist/coordinator-d1-scope-authorization-test-harness.d.ts.map +1 -1
- package/dist/coordinator-device-auth-link.d.ts +1 -0
- package/dist/coordinator-device-auth-link.d.ts.map +1 -1
- package/dist/coordinator-device-rejoin-browser-evidence.d.ts +28 -0
- package/dist/coordinator-device-rejoin-browser-evidence.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser-transaction-test-harness.d.ts +8 -0
- package/dist/coordinator-device-rejoin-browser-transaction-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser-transaction.d.ts +43 -0
- package/dist/coordinator-device-rejoin-browser-transaction.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser-view.d.ts +30 -0
- package/dist/coordinator-device-rejoin-browser-view.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-browser.d.ts +26 -0
- package/dist/coordinator-device-rejoin-browser.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-client-requests.d.ts +70 -0
- package/dist/coordinator-device-rejoin-client-requests.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-client.d.ts +15 -0
- package/dist/coordinator-device-rejoin-client.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-confirmation-test-harness.d.ts +22 -0
- package/dist/coordinator-device-rejoin-confirmation-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-confirmation.d.ts +18 -0
- package/dist/coordinator-device-rejoin-confirmation.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-destinations-test-harness.d.ts +7 -0
- package/dist/coordinator-device-rejoin-destinations-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-destinations.d.ts +25 -0
- package/dist/coordinator-device-rejoin-destinations.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-display.d.ts +14 -0
- package/dist/coordinator-device-rejoin-display.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-event-client.d.ts +30 -0
- package/dist/coordinator-device-rejoin-event-client.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-events.d.ts +7 -0
- package/dist/coordinator-device-rejoin-events.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-finalize-test-harness.d.ts +14 -0
- package/dist/coordinator-device-rejoin-finalize-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-finalize.d.ts +36 -0
- package/dist/coordinator-device-rejoin-finalize.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-http.d.ts +11 -0
- package/dist/coordinator-device-rejoin-http.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-link-evidence-test-harness.d.ts +17 -0
- package/dist/coordinator-device-rejoin-link-evidence-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-link-evidence.d.ts +29 -0
- package/dist/coordinator-device-rejoin-link-evidence.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-link-lineage.d.ts +7 -0
- package/dist/coordinator-device-rejoin-link-lineage.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-oidc-pins.d.ts +14 -0
- package/dist/coordinator-device-rejoin-oidc-pins.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-proof.d.ts +41 -0
- package/dist/coordinator-device-rejoin-proof.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-schema-test-harness.d.ts +8 -0
- package/dist/coordinator-device-rejoin-schema-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-schema.d.ts +9 -0
- package/dist/coordinator-device-rejoin-schema.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-evidence-test-harness.d.ts +40 -0
- package/dist/coordinator-device-rejoin-start-evidence-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-evidence.d.ts +25 -0
- package/dist/coordinator-device-rejoin-start-evidence.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-http.d.ts +12 -0
- package/dist/coordinator-device-rejoin-start-http.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-input.d.ts +23 -0
- package/dist/coordinator-device-rejoin-start-input.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-start-write.d.ts +38 -0
- package/dist/coordinator-device-rejoin-start-write.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-http.d.ts +10 -0
- package/dist/coordinator-device-rejoin-status-http.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-live-test-harness.d.ts +33 -0
- package/dist/coordinator-device-rejoin-status-live-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-projection.d.ts +28 -0
- package/dist/coordinator-device-rejoin-status-projection.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status-test-harness.d.ts +8 -0
- package/dist/coordinator-device-rejoin-status-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-rejoin-status.d.ts +39 -0
- package/dist/coordinator-device-rejoin-status.d.ts.map +1 -0
- package/dist/coordinator-device-removal-commands.d.ts +13 -0
- package/dist/coordinator-device-removal-commands.d.ts.map +1 -0
- package/dist/coordinator-device-removal-commit-test-harness.d.ts +3 -0
- package/dist/coordinator-device-removal-commit-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-commit.d.ts +44 -0
- package/dist/coordinator-device-removal-commit.d.ts.map +1 -0
- package/dist/coordinator-device-removal-dependents-test-harness.d.ts +9 -0
- package/dist/coordinator-device-removal-dependents-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-dependents.d.ts +34 -0
- package/dist/coordinator-device-removal-dependents.d.ts.map +1 -0
- package/dist/coordinator-device-removal-list-test-harness.d.ts +4 -0
- package/dist/coordinator-device-removal-list-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-list.d.ts +42 -0
- package/dist/coordinator-device-removal-list.d.ts.map +1 -0
- package/dist/coordinator-device-removal-preview-test-harness.d.ts +9 -0
- package/dist/coordinator-device-removal-preview-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-routes.d.ts +13 -0
- package/dist/coordinator-device-removal-routes.d.ts.map +1 -0
- package/dist/coordinator-device-removal-target.d.ts +98 -0
- package/dist/coordinator-device-removal-target.d.ts.map +1 -0
- package/dist/coordinator-device-removal-test-harness.d.ts +70 -0
- package/dist/coordinator-device-removal-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal-writer-test-harness.d.ts +8 -0
- package/dist/coordinator-device-removal-writer-test-harness.d.ts.map +1 -0
- package/dist/coordinator-device-removal.d.ts +233 -0
- package/dist/coordinator-device-removal.d.ts.map +1 -0
- package/dist/coordinator-device-revocation-client.d.ts +2 -0
- package/dist/coordinator-device-revocation-client.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-handler-test-harness.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-handler.d.ts +1 -1
- package/dist/coordinator-device-revocation-handler.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-route.d.ts.map +1 -1
- package/dist/coordinator-device-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-device-revocation.d.ts +20 -2
- package/dist/coordinator-device-revocation.d.ts.map +1 -1
- package/dist/coordinator-enrollment-reconciler.d.ts.map +1 -1
- package/dist/coordinator-enrollment-test-fixtures.d.ts +126 -0
- package/dist/coordinator-enrollment-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts +1 -1
- package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-identity-grant-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-identity-group-grant-test-harness.d.ts.map +1 -1
- package/dist/coordinator-invitation-lift-test-harness.d.ts +6 -0
- package/dist/coordinator-invitation-lift-test-harness.d.ts.map +1 -0
- package/dist/coordinator-invitation-removal.d.ts +71 -0
- package/dist/coordinator-invitation-removal.d.ts.map +1 -0
- package/dist/coordinator-join-review-guards.d.ts +2 -0
- package/dist/coordinator-join-review-guards.d.ts.map +1 -1
- package/dist/coordinator-join-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-key-id-fill-api-test-harness.d.ts +12 -0
- package/dist/coordinator-key-id-fill-api-test-harness.d.ts.map +1 -0
- package/dist/coordinator-key-id-fill-api.d.ts +19 -0
- package/dist/coordinator-key-id-fill-api.d.ts.map +1 -0
- package/dist/coordinator-legacy-device-ownership.d.ts +66 -5
- package/dist/coordinator-legacy-device-ownership.d.ts.map +1 -1
- package/dist/coordinator-legacy-owner-compatibility.d.ts +3 -0
- package/dist/coordinator-legacy-owner-compatibility.d.ts.map +1 -1
- package/dist/coordinator-membership-enrollment-test-harness.d.ts +4 -0
- package/dist/coordinator-membership-enrollment-test-harness.d.ts.map +1 -0
- package/dist/coordinator-membership-enrollment.d.ts +15 -0
- package/dist/coordinator-membership-enrollment.d.ts.map +1 -0
- package/dist/coordinator-owner-enrollment-commit.d.ts +1 -1
- package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -1
- package/dist/coordinator-owner-enrollment-qualification-test-harness.d.ts.map +1 -1
- package/dist/coordinator-owner-enrollment-qualification.d.ts +1 -0
- package/dist/coordinator-owner-enrollment-qualification.d.ts.map +1 -1
- package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-peer-discovery-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-peer-removal-api-test-harness.d.ts +29 -0
- package/dist/coordinator-peer-removal-api-test-harness.d.ts.map +1 -0
- package/dist/coordinator-peer-removal-query-test-harness.d.ts +4 -0
- package/dist/coordinator-peer-removal-query-test-harness.d.ts.map +1 -0
- package/dist/coordinator-peer-removal-query.d.ts +32 -0
- package/dist/coordinator-peer-removal-query.d.ts.map +1 -0
- package/dist/coordinator-peer-revocation-route.d.ts +45 -0
- package/dist/coordinator-peer-revocation-route.d.ts.map +1 -0
- package/dist/coordinator-peer-revocation.d.ts +61 -0
- package/dist/coordinator-peer-revocation.d.ts.map +1 -0
- package/dist/coordinator-presence-capabilities.d.ts +10 -0
- package/dist/coordinator-presence-capabilities.d.ts.map +1 -0
- package/dist/coordinator-project-revocation-test-harness.d.ts +1 -1
- package/dist/coordinator-project-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-recipient-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-refresh-lifecycle.d.ts +11 -0
- package/dist/coordinator-refresh-lifecycle.d.ts.map +1 -0
- package/dist/coordinator-rejoin-discovery.d.ts +16 -0
- package/dist/coordinator-rejoin-discovery.d.ts.map +1 -0
- package/dist/coordinator-rejoin-timestamp.d.ts +3 -0
- package/dist/coordinator-rejoin-timestamp.d.ts.map +1 -0
- package/dist/coordinator-removal-notice.d.ts +21 -0
- package/dist/coordinator-removal-notice.d.ts.map +1 -0
- package/dist/coordinator-removal-progress-listing-test-harness.d.ts +3 -0
- package/dist/coordinator-removal-progress-listing-test-harness.d.ts.map +1 -0
- package/dist/coordinator-runtime-ChgCIqfx.js +1716 -0
- package/dist/coordinator-runtime-ChgCIqfx.js.map +1 -0
- package/dist/coordinator-runtime.d.ts +20 -1
- package/dist/coordinator-runtime.d.ts.map +1 -1
- package/dist/coordinator-scope-authorization-api-test-harness.d.ts.map +1 -1
- package/dist/coordinator-store-contract.d.ts +21 -3
- package/dist/coordinator-store-contract.d.ts.map +1 -1
- package/dist/coordinator-store-test-harness.d.ts.map +1 -1
- package/dist/coordinator-sync-config.d.ts +14 -0
- package/dist/coordinator-sync-config.d.ts.map +1 -1
- package/dist/d1-coordinator-runtime.d.ts +3 -1
- package/dist/d1-coordinator-runtime.d.ts.map +1 -1
- package/dist/d1-coordinator-store.d.ts +63 -3
- package/dist/d1-coordinator-store.d.ts.map +1 -1
- package/dist/database-runtime-primitives.d.ts +1 -1
- package/dist/db.d.ts.map +1 -1
- package/dist/device-identity-binding.d.ts +24 -0
- package/dist/device-identity-binding.d.ts.map +1 -1
- package/dist/device-identity-inventory.d.ts +19 -1
- package/dist/device-identity-inventory.d.ts.map +1 -1
- package/dist/device-retirement.d.ts +43 -0
- package/dist/device-retirement.d.ts.map +1 -0
- package/dist/identity-device-assignment.d.ts +8 -0
- package/dist/identity-device-assignment.d.ts.map +1 -1
- package/dist/index.d.ts +34 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11908 -10664
- package/dist/index.js.map +1 -1
- package/dist/ingest-events.d.ts.map +1 -1
- package/dist/internal/cloudflare-coordinator.js +2317 -1542
- package/dist/internal/cloudflare-coordinator.js.map +1 -1
- package/dist/internal/relay-runtime.js +32 -32
- package/dist/legacy-pairing-assignment-conversion.d.ts +46 -0
- package/dist/legacy-pairing-assignment-conversion.d.ts.map +1 -0
- package/dist/legacy-pairing-assignment-state.d.ts +11 -0
- package/dist/legacy-pairing-assignment-state.d.ts.map +1 -0
- package/dist/legacy-team-setup-completion-manifest.d.ts +41 -0
- package/dist/legacy-team-setup-completion-manifest.d.ts.map +1 -1
- package/dist/legacy-team-setup-errors.d.ts +3 -2
- package/dist/legacy-team-setup-errors.d.ts.map +1 -1
- package/dist/local-origin-claim.d.ts +48 -0
- package/dist/local-origin-claim.d.ts.map +1 -0
- package/dist/maintenance/ai-structured.d.ts +2 -0
- package/dist/maintenance/ai-structured.d.ts.map +1 -1
- package/dist/observer-config.d.ts.map +1 -1
- package/dist/owned-recipient-d1-test-harness.d.ts.map +1 -1
- package/dist/owner-enrollment-link-authority.d.ts +1 -0
- package/dist/owner-enrollment-link-authority.d.ts.map +1 -1
- package/dist/{owner-enrollment-start-BsDwgxAh.js → owner-enrollment-start-CD7R8wy3.js} +5548 -3637
- package/dist/owner-enrollment-start-CD7R8wy3.js.map +1 -0
- package/dist/pairing-removal.d.ts +58 -0
- package/dist/pairing-removal.d.ts.map +1 -0
- package/dist/peer-project-filter-change.d.ts +33 -0
- package/dist/peer-project-filter-change.d.ts.map +1 -0
- package/dist/peer-project-filter-management.d.ts +7 -0
- package/dist/peer-project-filter-management.d.ts.map +1 -0
- package/dist/peer-project-filter-retention.d.ts +17 -0
- package/dist/peer-project-filter-retention.d.ts.map +1 -0
- package/dist/peer-removal-check-state.d.ts +24 -0
- package/dist/peer-removal-check-state.d.ts.map +1 -0
- package/dist/peer-removal.d.ts +34 -0
- package/dist/peer-removal.d.ts.map +1 -0
- package/dist/peer-traversal-coordinator-attempt-write-test-fixtures.d.ts.map +1 -1
- package/dist/peer-traversal-coordinator-decision-test-fixtures.d.ts.map +1 -1
- package/dist/pi-hooks.d.ts +1 -5
- package/dist/pi-hooks.d.ts.map +1 -1
- package/dist/policy-team-device-eligibility.d.ts +10 -0
- package/dist/policy-team-device-eligibility.d.ts.map +1 -1
- package/dist/project-boundary-migration-hold.d.ts +50 -0
- package/dist/project-boundary-migration-hold.d.ts.map +1 -0
- package/dist/project-boundary-migration-records.d.ts +46 -0
- package/dist/project-boundary-migration-records.d.ts.map +1 -0
- package/dist/project-filters-narrowing.d.ts +11 -0
- package/dist/project-filters-narrowing.d.ts.map +1 -0
- package/dist/project-scope-resume.d.ts +26 -0
- package/dist/project-scope-resume.d.ts.map +1 -0
- package/dist/project-scope-settings.d.ts +21 -1
- package/dist/project-scope-settings.d.ts.map +1 -1
- package/dist/project-scope-withdrawal.d.ts +48 -0
- package/dist/project-scope-withdrawal.d.ts.map +1 -0
- package/dist/project-withdrawal-state.d.ts +36 -0
- package/dist/project-withdrawal-state.d.ts.map +1 -0
- package/dist/raw-event-flush.d.ts.map +1 -1
- package/dist/{recipient-policy-contract-Ca40IBUh.js → recipient-policy-contract-BHxfaQZ2.js} +12 -5
- package/dist/recipient-policy-contract-BHxfaQZ2.js.map +1 -0
- package/dist/recipient-policy-contract.d.ts +7 -0
- package/dist/recipient-policy-contract.d.ts.map +1 -1
- package/dist/recipient-policy-contract.js +2 -2
- package/dist/recipient-policy-edges.d.ts.map +1 -1
- package/dist/recipient-policy-intent.d.ts +1 -0
- package/dist/recipient-policy-intent.d.ts.map +1 -1
- package/dist/recipient-policy-onboarding.d.ts.map +1 -1
- package/dist/recipient-policy-reconciler.d.ts.map +1 -1
- package/dist/recipient-policy-reconciliation.d.ts.map +1 -1
- package/dist/recipient-policy-team-create.d.ts +22 -0
- package/dist/recipient-policy-team-create.d.ts.map +1 -0
- package/dist/{relay-health-CeyhVeuq.js → relay-health-B8BpHFaE.js} +14 -14
- package/dist/{relay-health-CeyhVeuq.js.map → relay-health-B8BpHFaE.js.map} +1 -1
- package/dist/{relay-peer-client-DmZfZebO.js → relay-peer-client-CrFrhN_q.js} +3140 -2687
- package/dist/relay-peer-client-CrFrhN_q.js.map +1 -0
- package/dist/relay-server-test-fixtures.d.ts.map +1 -1
- package/dist/removed-device-local-ids.d.ts +16 -0
- package/dist/removed-device-local-ids.d.ts.map +1 -0
- package/dist/replication-cursor-orphan-cleanup.d.ts +14 -0
- package/dist/replication-cursor-orphan-cleanup.d.ts.map +1 -0
- package/dist/retired-device-aliases.d.ts +28 -0
- package/dist/retired-device-aliases.d.ts.map +1 -0
- package/dist/same-actor-peers.d.ts +5 -1
- package/dist/same-actor-peers.d.ts.map +1 -1
- package/dist/schema-bootstrap.d.ts +1 -0
- package/dist/schema-bootstrap.d.ts.map +1 -1
- package/dist/schema.d.ts +4456 -3623
- package/dist/schema.d.ts.map +1 -1
- package/dist/scope-membership-cache-read.d.ts +28 -1
- package/dist/scope-membership-cache-read.d.ts.map +1 -1
- package/dist/scope-membership-cache-test-fixtures.d.ts +1 -0
- package/dist/scope-membership-cache-test-fixtures.d.ts.map +1 -1
- package/dist/scope-membership-cache.d.ts +1 -1
- package/dist/scope-membership-cache.d.ts.map +1 -1
- package/dist/scope-membership-evidence.d.ts +17 -1
- package/dist/scope-membership-evidence.d.ts.map +1 -1
- package/dist/{scope-membership-cache-read-B6z47l2W.js → scope-resolution-DXzf4k16.js} +2287 -1613
- package/dist/scope-resolution-DXzf4k16.js.map +1 -0
- package/dist/semantic-worker-entry.js +1 -1
- package/dist/{semantic-worker-job-BLaC4xRY.js → semantic-worker-job-DjfAtX64.js} +3 -3
- package/dist/{semantic-worker-job-BLaC4xRY.js.map → semantic-worker-job-DjfAtX64.js.map} +1 -1
- package/dist/{semantic-worker-ranking-5-VSzEmx.js → semantic-worker-ranking-CZCemeb4.js} +59 -53
- package/dist/semantic-worker-ranking-CZCemeb4.js.map +1 -0
- package/dist/share-provisioning.d.ts +4 -0
- package/dist/share-provisioning.d.ts.map +1 -1
- package/dist/shared-owned-device-enrollment-test-harness.d.ts.map +1 -1
- package/dist/shared-owned-project-invites-test-harness.d.ts.map +1 -1
- package/dist/shared-owned-recipient-invites-test-harness.d.ts.map +1 -1
- package/dist/shared-ownership-writer-lifecycle-test-harness.d.ts.map +1 -1
- package/dist/snapshot-cross-scope-reconcile.d.ts +25 -0
- package/dist/snapshot-cross-scope-reconcile.d.ts.map +1 -0
- package/dist/{sync-auth-constants-BVzVfSmn.js → sync-auth-constants-CifCg69d.js} +4484 -2842
- package/dist/sync-auth-constants-CifCg69d.js.map +1 -0
- package/dist/sync-bootstrap.d.ts +2 -0
- package/dist/sync-bootstrap.d.ts.map +1 -1
- package/dist/sync-capability.d.ts +1 -1
- package/dist/sync-capability.d.ts.map +1 -1
- package/dist/sync-channel-pass.d.ts.map +1 -1
- package/dist/sync-channel-progress.d.ts +7 -0
- package/dist/sync-channel-progress.d.ts.map +1 -1
- package/dist/sync-daemon.d.ts +4 -1
- package/dist/sync-daemon.d.ts.map +1 -1
- package/dist/sync-pass.d.ts +2 -0
- package/dist/sync-pass.d.ts.map +1 -1
- package/dist/sync-peer-addresses.d.ts +4 -2
- package/dist/sync-peer-addresses.d.ts.map +1 -1
- package/dist/sync-reachability-pass-BFTEIkZH.js +2 -0
- package/dist/{sync-reachability-pass-Dhn4N2hr.js → sync-reachability-pass-vOvswNNG.js} +3219 -3025
- package/dist/sync-reachability-pass-vOvswNNG.js.map +1 -0
- package/dist/sync-replication.d.ts +26 -3
- package/dist/sync-replication.d.ts.map +1 -1
- package/dist/sync-scope-protocol.d.ts.map +1 -1
- package/dist/sync-status-test-fixtures.d.ts +1 -1
- package/dist/sync-status-test-fixtures.d.ts.map +1 -1
- package/dist/test-environment-isolation.d.ts +2 -0
- package/dist/test-environment-isolation.d.ts.map +1 -0
- package/dist/test-schema.generated.d.ts +1 -1
- package/dist/test-schema.generated.d.ts.map +1 -1
- package/dist/test-utils.d.ts +7 -0
- package/dist/test-utils.d.ts.map +1 -1
- package/dist/{validated-vector-index-audit-B64yhEBF.js → validated-vector-index-audit-CFSIbYIn.js} +255 -623
- package/dist/validated-vector-index-audit-CFSIbYIn.js.map +1 -0
- package/dist/viewer-device-removal-commit.d.ts +56 -0
- package/dist/viewer-device-removal-commit.d.ts.map +1 -0
- package/dist/viewer-device-removal-evidence.d.ts +17 -0
- package/dist/viewer-device-removal-evidence.d.ts.map +1 -0
- package/dist/{scope-membership-semantics-B8qXaMqx.js → workspace-identity-C7EPmSZe.js} +121 -49
- package/dist/workspace-identity-C7EPmSZe.js.map +1 -0
- package/package.json +3 -3
- package/dist/coordinator-runtime-CEc6KhBE.js +0 -594
- package/dist/coordinator-runtime-CEc6KhBE.js.map +0 -1
- package/dist/owner-enrollment-start-BsDwgxAh.js.map +0 -1
- package/dist/recipient-policy-contract-Ca40IBUh.js.map +0 -1
- package/dist/relay-peer-client-DmZfZebO.js.map +0 -1
- package/dist/scope-membership-cache-read-B6z47l2W.js.map +0 -1
- package/dist/scope-membership-semantics-B8qXaMqx.js.map +0 -1
- package/dist/semantic-worker-ranking-5-VSzEmx.js.map +0 -1
- package/dist/sync-auth-constants-BVzVfSmn.js.map +0 -1
- package/dist/sync-reachability-pass-C_-w0t6b.js +0 -2
- package/dist/sync-reachability-pass-Dhn4N2hr.js.map +0 -1
- package/dist/validated-vector-index-audit-B64yhEBF.js.map +0 -1
- package/dist/workspace-identity-DI8bBR0Y.js +0 -76
- package/dist/workspace-identity-DI8bBR0Y.js.map +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Store } from "./coordinator-auth-store-test-fixtures.js";
|
|
2
|
+
import type { RevocationFixture } from "./coordinator-device-revocation-test-harness.js";
|
|
3
|
+
import { type EnrollmentTestExec, type EnrollmentTestSqlite } from "./coordinator-enrollment-test-fixtures.js";
|
|
4
|
+
/**
|
|
5
|
+
* Numbers in test names are the entries of group A in the removal test plan.
|
|
6
|
+
* Every fixture is a database as schema initialization or the migrations left
|
|
7
|
+
* it, with the enrollment triggers installed, and starts with no tombstone and
|
|
8
|
+
* no enrollment.
|
|
9
|
+
*/
|
|
10
|
+
export type RemovalFixture = {
|
|
11
|
+
store: Store;
|
|
12
|
+
/** Unique for each test. */
|
|
13
|
+
prefix: string;
|
|
14
|
+
/** Raw SQL write. Rejects when a trigger or constraint aborts the statement. */
|
|
15
|
+
exec: (sql: string, ...values: unknown[]) => Promise<void>;
|
|
16
|
+
rows: <T = Record<string, unknown>>(sql: string, ...values: unknown[]) => Promise<T[]>;
|
|
17
|
+
/**
|
|
18
|
+
* A store on the same database that runs `change` once, immediately before
|
|
19
|
+
* its first write whose SQL contains one of `before`. On D1 that is before
|
|
20
|
+
* the batch that holds the write, so after every read the operation made first.
|
|
21
|
+
*/
|
|
22
|
+
interleave: (before: readonly string[], change: RemovalChange) => Store;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* A raw change that the fixture runs on its own database through the enrollment
|
|
26
|
+
* test helpers: synchronously on better-sqlite3, awaited on native D1.
|
|
27
|
+
*/
|
|
28
|
+
export type RemovalChange = (database: EnrollmentTestSqlite | EnrollmentTestExec) => unknown;
|
|
29
|
+
/** The injected store clock of every fixture. */
|
|
30
|
+
export declare const REMOVAL_CLOCK_MS: number;
|
|
31
|
+
export declare function removalHarness(fixture: (use: (f: RemovalFixture) => Promise<void>) => Promise<void>): import("vitest").TestAPI<{
|
|
32
|
+
fixture: RemovalFixture;
|
|
33
|
+
}>;
|
|
34
|
+
export type RemovalTest = ReturnType<typeof removalHarness>;
|
|
35
|
+
export type DeviceKey = {
|
|
36
|
+
publicKey: string;
|
|
37
|
+
fingerprint: string;
|
|
38
|
+
keyId: string;
|
|
39
|
+
};
|
|
40
|
+
/** A well-formed SSH Ed25519 public key derived from a label. No private key exists for it. */
|
|
41
|
+
export declare function removalDeviceKey(label: string): Promise<DeviceKey>;
|
|
42
|
+
export declare function opaqueKey(label: string): DeviceKey;
|
|
43
|
+
export type Enrollment = {
|
|
44
|
+
groupId: string;
|
|
45
|
+
deviceId: string;
|
|
46
|
+
key: DeviceKey;
|
|
47
|
+
};
|
|
48
|
+
export declare function enroll(f: RemovalFixture, target: Enrollment): Promise<void>;
|
|
49
|
+
/** The enrollment insert of releases before the key ID column existed. */
|
|
50
|
+
export declare function legacyInsert(f: RemovalFixture, target: Enrollment): Promise<void>;
|
|
51
|
+
export declare function currentInsert(f: RemovalFixture, target: Enrollment, verb?: string): Promise<void>;
|
|
52
|
+
export declare function insertTombstone(f: RemovalFixture, target: Enrollment, verb?: string): Promise<void>;
|
|
53
|
+
export declare function liftTombstones(f: RemovalFixture, deviceId: string): Promise<void>;
|
|
54
|
+
/** Marks an enrollment that a test arranged, in a column that every writer sets. */
|
|
55
|
+
export declare const ARRANGED_DISPLAY_NAME = "arranged by the test";
|
|
56
|
+
/** The creation time of every arranged enrollment. A writer's insert never uses it. */
|
|
57
|
+
export declare const ARRANGED_CREATED_AT = "2026-11-17T00:00:00.000Z";
|
|
58
|
+
/** A disabled enrollment with no Identity, as another writer could add it at any moment. */
|
|
59
|
+
export declare function insertDisabledEnrollment(target: Enrollment): RemovalChange;
|
|
60
|
+
export declare function enrollments(f: RemovalFixture): Promise<{
|
|
61
|
+
group_id: string;
|
|
62
|
+
device_id: string;
|
|
63
|
+
public_key: string;
|
|
64
|
+
key_id: string | null;
|
|
65
|
+
}[]>;
|
|
66
|
+
export declare function target(f: RemovalFixture, name?: string, group?: string): Promise<Enrollment>;
|
|
67
|
+
export declare function registerDeviceRemovalContract(test: RemovalTest): void;
|
|
68
|
+
/** The invitation helpers of the revocation harnesses, on this fixture's database. */
|
|
69
|
+
export declare function invitationFixture(f: RemovalFixture, name: string, key: DeviceKey): RevocationFixture;
|
|
70
|
+
//# sourceMappingURL=coordinator-device-removal-test-harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-removal-test-harness.d.ts","sourceRoot":"","sources":["../src/coordinator-device-removal-test-harness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAC;AAEzF,OAAO,EACN,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAEzB,MAAM,2CAA2C,CAAC;AAKnD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,GAAG;IAC5B,KAAK,EAAE,KAAK,CAAC;IACb,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAI,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACvF;;;;OAIG;IACH,UAAU,EAAE,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,aAAa,KAAK,KAAK,CAAC;CACxE,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,oBAAoB,GAAG,kBAAkB,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AAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAMjF;AAED,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,yBAAyB,CAAC;AAC5D,uFAAuF;AACvF,eAAO,MAAM,mBAAmB,6BAA6B,CAAC;AAE9D,4FAA4F;AAC5F,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,UAAU,GAAG,aAAa,CAW1E;AAwBD,wBAAgB,WAAW,CAAC,CAAC,EAAE,cAAc;cAClB,MAAM;eAAa,MAAM;gBAAc,MAAM;YAAU,MAAM,GAAG,IAAI;KAK9F;AAED,wBAAsB,MAAM,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,SAAM,EAAE,KAAK,SAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAM7F;AAED,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,WAAW,QAkB9D;AA6vBD,sFAAsF;AACtF,wBAAgB,iBAAiB,CAChC,CAAC,EAAE,cAAc,EACjB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,SAAS,GACZ,iBAAiB,CAanB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type RemovalTest } from "./coordinator-device-removal-test-harness.js";
|
|
2
|
+
/**
|
|
3
|
+
* Enrollment writers under the enrollment triggers: what they write when the
|
|
4
|
+
* enrollment changes between their reads and their write, and how they keep
|
|
5
|
+
* `key_id` and the key text. The fixtures are those of the removal harness.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerEnrollmentWriterContract(test: RemovalTest): void;
|
|
8
|
+
//# sourceMappingURL=coordinator-device-removal-writer-test-harness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-removal-writer-test-harness.d.ts","sourceRoot":"","sources":["../src/coordinator-device-removal-writer-test-harness.ts"],"names":[],"mappings":"AAEA,OAAO,EAeN,KAAK,WAAW,EAGhB,MAAM,8CAA8C,CAAC;AAMtD;;;;GAIG;AACH,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,WAAW,QAUjE"}
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import type { AuthLinkBackend } from "./coordinator-auth-link.js";
|
|
2
|
+
import { type CoordinatorRemoveDeviceEnrollmentsInput, type CoordinatorRemoveDeviceEnrollmentsResult } from "./coordinator-device-removal-commit.js";
|
|
3
|
+
import { type CoordinatorDeviceRemovalListResult, type CoordinatorListDeviceRemovalsInput } from "./coordinator-device-removal-list.js";
|
|
4
|
+
import { type CoordinatorDeviceRemovalPreviewInput, type CoordinatorDeviceRemovalPreviewResult } from "./coordinator-device-removal-target.js";
|
|
5
|
+
import { type CoordinatorPeerRemovalLookupInput, type CoordinatorPeerRemovalLookupResult } from "./coordinator-peer-removal-query.js";
|
|
6
|
+
/**
|
|
7
|
+
* Removal tombstones. One row records each deleted enrollment and stays active
|
|
8
|
+
* until a lift sets `lifted_at` and exactly one of the two `lifted_by_*` columns.
|
|
9
|
+
* `removal_seq` is the only value that orders a removal against an invitation.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEVICE_REMOVAL_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_device_removals (\n removal_seq INTEGER PRIMARY KEY AUTOINCREMENT,\n removal_id TEXT NOT NULL,\n group_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n public_key TEXT NOT NULL,\n fingerprint TEXT NOT NULL,\n key_id TEXT,\n identity_id TEXT,\n display_name TEXT,\n actor_id TEXT,\n removed_at TEXT NOT NULL,\n lifted_at TEXT,\n lifted_by_invite_id TEXT,\n lifted_by_attempt_id TEXT\n);\n\nCREATE UNIQUE INDEX IF NOT EXISTS idx_coordinator_device_removals_active\n ON coordinator_device_removals(group_id, device_id) WHERE lifted_at IS NULL;\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_removals_device\n ON coordinator_device_removals(device_id);\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_removals_key\n ON coordinator_device_removals(key_id) WHERE key_id IS NOT NULL;\n\n-- A tombstone starts active. REPLACE's implicit deletes may skip DELETE triggers\n-- when recursive triggers are off, so a colliding insert aborts before it can replace.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_removals_insert\nBEFORE INSERT ON coordinator_device_removals\nWHEN NEW.lifted_at IS NOT NULL OR NEW.lifted_by_invite_id IS NOT NULL\n OR NEW.lifted_by_attempt_id IS NOT NULL\n OR EXISTS (\n SELECT 1 FROM coordinator_device_removals\n WHERE removal_seq = NEW.removal_seq\n OR (lifted_at IS NULL AND group_id = NEW.group_id AND device_id = NEW.device_id)\n )\nBEGIN\n SELECT RAISE(ABORT, 'device_removal_collision');\nEND;\n\n-- The only update is the single lift of an active row. No column list, so an\n-- update that names the row ID as rowid, _rowid_, or oid is covered too.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_removals_update\nBEFORE UPDATE ON coordinator_device_removals\nWHEN NOT (\n OLD.lifted_at IS NULL AND OLD.lifted_by_invite_id IS NULL AND OLD.lifted_by_attempt_id IS NULL\n AND NEW.lifted_at IS NOT NULL\n AND (NEW.lifted_by_invite_id IS NULL) <> (NEW.lifted_by_attempt_id IS NULL)\n AND NEW.removal_seq IS OLD.removal_seq AND NEW.removal_id IS OLD.removal_id\n AND NEW.group_id IS OLD.group_id AND NEW.device_id IS OLD.device_id\n AND NEW.public_key IS OLD.public_key AND NEW.fingerprint IS OLD.fingerprint\n AND NEW.key_id IS OLD.key_id AND NEW.identity_id IS OLD.identity_id\n AND NEW.display_name IS OLD.display_name AND NEW.actor_id IS OLD.actor_id\n AND NEW.removed_at IS OLD.removed_at\n)\nBEGIN\n SELECT RAISE(ABORT, 'device_removal_immutable');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_removals_delete\nBEFORE DELETE ON coordinator_device_removals\nBEGIN\n SELECT RAISE(ABORT, 'device_removal_immutable');\nEND;\n\n-- An automatic removal_seq reads as -1 before insert. Positive values keep that from matching a row.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_removals_rowid\nAFTER INSERT ON coordinator_device_removals\nWHEN NEW.removal_seq < 1\nBEGIN\n SELECT RAISE(ABORT, 'device_removal_rowid');\nEND;\n";
|
|
12
|
+
/** Additive columns of existing tables. Rows that predate a column keep null. */
|
|
13
|
+
export declare const DEVICE_REMOVAL_COLUMNS: readonly {
|
|
14
|
+
table: string;
|
|
15
|
+
column: string;
|
|
16
|
+
sql: string;
|
|
17
|
+
}[];
|
|
18
|
+
export declare const DEVICE_REMOVAL_MIGRATION_NAME = "0048_add_device_removals.sql";
|
|
19
|
+
/** Every trigger of DEVICE_REMOVAL_SCHEMA_SQL. Readiness requires each of them by name. */
|
|
20
|
+
export declare const DEVICE_REMOVAL_TRIGGER_NAMES: readonly string[];
|
|
21
|
+
/**
|
|
22
|
+
* `ready` is 1 when the tombstone table, its active-tombstone index, each of its
|
|
23
|
+
* triggers, and the three columns exist. Every object is required by name, so
|
|
24
|
+
* an object that a later release adds next to them does not change the answer.
|
|
25
|
+
*/
|
|
26
|
+
export declare const DEVICE_REMOVAL_SCHEMA_READINESS_SQL: string;
|
|
27
|
+
/** Whether migration 0048, or SQLite initialization, has installed device removal storage. */
|
|
28
|
+
export declare function hasDeviceRemovalSchema(backend: Pick<AuthLinkBackend, "first">): Promise<boolean>;
|
|
29
|
+
/**
|
|
30
|
+
* SQL fragments with which a writer stores one extra column. On a coordinator
|
|
31
|
+
* schema without device removal storage they are empty, so every enrollment and
|
|
32
|
+
* invitation writer keeps working there exactly as before.
|
|
33
|
+
*/
|
|
34
|
+
export interface RemovalColumnSql {
|
|
35
|
+
/** `, column` for an INSERT column list. */
|
|
36
|
+
readonly column: string;
|
|
37
|
+
/** `, value` for the matching position of the INSERT values. */
|
|
38
|
+
readonly value: string;
|
|
39
|
+
/** `, column = value` for an UPDATE. */
|
|
40
|
+
readonly assignment: string;
|
|
41
|
+
}
|
|
42
|
+
/** `enrolled_devices.key_id` from `value`, by default one bound parameter. */
|
|
43
|
+
export declare function enrollmentKeyIdSql(ready: boolean, value?: string): RemovalColumnSql;
|
|
44
|
+
/** Matches a captured enrollment subject, globally for enrollment or in one group for enable. */
|
|
45
|
+
export declare function activeEnrollmentRemoval(input: {
|
|
46
|
+
deviceId: string;
|
|
47
|
+
keyId: string | null;
|
|
48
|
+
publicKey: string | null;
|
|
49
|
+
groupId?: string;
|
|
50
|
+
}): {
|
|
51
|
+
sql: string;
|
|
52
|
+
values: (string | null)[];
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Checks on `enrolled_devices` that hold for every writer, including an older
|
|
56
|
+
* release that opens a migrated database directly. They need the tombstone
|
|
57
|
+
* table and the `key_id` column. They are a second check behind the statement
|
|
58
|
+
* checks of each writer, and they do not evaluate invitations.
|
|
59
|
+
*
|
|
60
|
+
* SQLite initialization installs them after it has filled the key IDs, and
|
|
61
|
+
* migration 0049 installs them on D1. Migration 0048 does not, so a D1 database
|
|
62
|
+
* between the two stores key IDs and cannot record a removal yet.
|
|
63
|
+
*/
|
|
64
|
+
export declare const ENROLLMENT_REMOVAL_TRIGGER_STATEMENTS: readonly string[];
|
|
65
|
+
export declare const ENROLLMENT_REMOVAL_TRIGGERS_SQL: string;
|
|
66
|
+
export declare const ENROLLMENT_REMOVAL_TRIGGER_NAMES: readonly string[];
|
|
67
|
+
/** Each enrollment trigger with its name, in the order of the statements. */
|
|
68
|
+
export declare const ENROLLMENT_REMOVAL_TRIGGERS: readonly {
|
|
69
|
+
name: string;
|
|
70
|
+
sql: string;
|
|
71
|
+
}[];
|
|
72
|
+
export declare const ENROLLMENT_REMOVAL_MIGRATION_NAME = "0049_add_enrollment_removal_triggers.sql";
|
|
73
|
+
/**
|
|
74
|
+
* `ready` is 1 when migration 0049, or SQLite initialization, has installed the
|
|
75
|
+
* enrollment triggers on top of device removal storage.
|
|
76
|
+
*/
|
|
77
|
+
export declare const ENROLLMENT_REMOVAL_TRIGGERS_READINESS_SQL: string;
|
|
78
|
+
/**
|
|
79
|
+
* A trigger definition in the form sqlite_master keeps it: no comment lines, no
|
|
80
|
+
* IF NOT EXISTS, no final semicolon. White space is collapsed for comparison.
|
|
81
|
+
*/
|
|
82
|
+
export declare function storedTriggerSql(sql: string): string;
|
|
83
|
+
/**
|
|
84
|
+
* Throws the fixed error `device_removed` when a backend error is the abort of
|
|
85
|
+
* an enrollment trigger that found an active tombstone for the device, and
|
|
86
|
+
* returns otherwise. SQLite reports the trigger's message alone, and D1 puts
|
|
87
|
+
* its own prefix and constraint suffix around it. An error that only mentions
|
|
88
|
+
* the word does not match. The abort rolled back the writer's transaction or
|
|
89
|
+
* batch. An enrollment writer calls this before it reports its own fail-closed
|
|
90
|
+
* error, so that a refusal by tombstone is not reported as an unavailable or
|
|
91
|
+
* incomplete write. The aborts of the other enrollment triggers keep the
|
|
92
|
+
* writer's error.
|
|
93
|
+
*/
|
|
94
|
+
export declare function rethrowDeviceRemovedAbort(error: unknown): void;
|
|
95
|
+
/**
|
|
96
|
+
* The one statement that inserts an invitation, on both stores. With removal
|
|
97
|
+
* storage it also records, as `issued_after_removal_seq`, the highest removal
|
|
98
|
+
* sequence at that moment, or 0. It takes 24 bound values in column order.
|
|
99
|
+
*/
|
|
100
|
+
export declare function inviteInsertSql(hasRemovalSchema: boolean): string;
|
|
101
|
+
/**
|
|
102
|
+
* `issued_after_removal_seq` of a new join request, copied from its invitation.
|
|
103
|
+
* When ready, bind the group ID, the plaintext token, and its digest, in that order.
|
|
104
|
+
*/
|
|
105
|
+
export declare function joinRequestRemovalSeqSql(ready: boolean): RemovalColumnSql;
|
|
106
|
+
/**
|
|
107
|
+
* `enrolled_devices.key_id` for a canonical key ID: the ID itself, or an empty
|
|
108
|
+
* string for a key that is not SSH Ed25519. Null is reserved for unfilled rows.
|
|
109
|
+
*/
|
|
110
|
+
export declare function enrollmentKeyIdColumn(keyId: string | null): string;
|
|
111
|
+
export declare const DEVICE_REMOVAL_FILL_DEFAULT_LIMIT = 200;
|
|
112
|
+
export declare const DEVICE_REMOVAL_FILL_MAX_LIMIT = 500;
|
|
113
|
+
/** Bind the row ID to start after, then the page size. */
|
|
114
|
+
export declare const ENROLLMENT_KEY_ID_UNFILLED_SQL = "SELECT rowid AS row_id, public_key\nFROM enrolled_devices WHERE key_id IS NULL AND rowid > ? ORDER BY rowid LIMIT ?";
|
|
115
|
+
/**
|
|
116
|
+
* Bind one JSON array of `{ row_id, public_key, key_id }` twice. The key text is
|
|
117
|
+
* pinned, so a row whose key changed after the read stays unfilled. A row that
|
|
118
|
+
* an active tombstone matches stays unfilled too. The tombstone-match trigger
|
|
119
|
+
* would abort the whole statement for it, and its null key ID keeps removal
|
|
120
|
+
* unavailable until an operator has looked at that enrollment.
|
|
121
|
+
*/
|
|
122
|
+
export declare const ENROLLMENT_KEY_ID_FILL_SQL: string;
|
|
123
|
+
/**
|
|
124
|
+
* Bind the same JSON array once, after the fill in the same transaction. A row
|
|
125
|
+
* of the page that still has its key text and no key ID is one that the fill
|
|
126
|
+
* left alone because an active tombstone matches it.
|
|
127
|
+
*/
|
|
128
|
+
export declare const ENROLLMENT_KEY_ID_BLOCKED_SQL = "SELECT COUNT(*) AS blocked\nFROM enrolled_devices WHERE key_id IS NULL AND EXISTS (\n SELECT 1 FROM json_each(?) j\n WHERE json_extract(j.value, '$.row_id') = enrolled_devices.rowid\n AND json_extract(j.value, '$.public_key') = enrolled_devices.public_key)";
|
|
129
|
+
export interface UnfilledEnrollmentKey {
|
|
130
|
+
row_id: number;
|
|
131
|
+
public_key: string;
|
|
132
|
+
}
|
|
133
|
+
export declare function enrollmentKeyIdFillLimit(limit: unknown): number;
|
|
134
|
+
export interface CoordinatorFillEnrollmentKeyIdsOptions {
|
|
135
|
+
/** Rows to consume at most. The serialized byte limit can end a page earlier. */
|
|
136
|
+
limit?: number;
|
|
137
|
+
/** `next` of the call before, to continue after the rows that call consumed. */
|
|
138
|
+
after?: number | null;
|
|
139
|
+
}
|
|
140
|
+
export interface CoordinatorFillEnrollmentKeyIdsResult {
|
|
141
|
+
/** Rows filled by this call. */
|
|
142
|
+
readonly filled: number;
|
|
143
|
+
/**
|
|
144
|
+
* Rows sent by this call that SQL could not fill because an active tombstone matches
|
|
145
|
+
* them. They keep a null key ID, and removal stays unavailable while they exist.
|
|
146
|
+
*/
|
|
147
|
+
readonly blocked: number;
|
|
148
|
+
/**
|
|
149
|
+
* Consumed rows too large for an empty byte-bounded page, or changed by another
|
|
150
|
+
* write before the fill. Oversized rows stay null and need operator inspection;
|
|
151
|
+
* a blind rerun does not fix them. A later pass can retry rows changed by a writer.
|
|
152
|
+
*/
|
|
153
|
+
readonly skipped: number;
|
|
154
|
+
/** True when unfilled rows remain beyond the consumed cursor, not before it. */
|
|
155
|
+
readonly remaining: boolean;
|
|
156
|
+
/** The last consumed row, including oversized skips. Null when none was consumed. */
|
|
157
|
+
readonly next: number | null;
|
|
158
|
+
}
|
|
159
|
+
export interface CoordinatorRemoveEnrollmentInput {
|
|
160
|
+
groupId: string;
|
|
161
|
+
deviceId: string;
|
|
162
|
+
/** Audit metadata only; it proves nothing about ownership. */
|
|
163
|
+
actorId?: string | null;
|
|
164
|
+
}
|
|
165
|
+
export interface CoordinatorDeviceRemovalEntry {
|
|
166
|
+
readonly removal_seq: number;
|
|
167
|
+
readonly group_id: string;
|
|
168
|
+
readonly device_id: string;
|
|
169
|
+
}
|
|
170
|
+
export type CoordinatorRemoveEnrollmentResult = {
|
|
171
|
+
kind: "removed";
|
|
172
|
+
removal_id: string;
|
|
173
|
+
removals: CoordinatorDeviceRemovalEntry[];
|
|
174
|
+
} | {
|
|
175
|
+
kind: "not_enrolled";
|
|
176
|
+
};
|
|
177
|
+
export interface CoordinatorDeviceRemovalStore {
|
|
178
|
+
/**
|
|
179
|
+
* Fills `enrolled_devices.key_id` for at most `limit` unfilled rows after row
|
|
180
|
+
* `after`. A caller repeats it with `after` set to `next` while `remaining` is
|
|
181
|
+
* true. The sums of `blocked` and `skipped` over that pass count the rows it did not fill.
|
|
182
|
+
*/
|
|
183
|
+
fillEnrollmentKeyIds(options?: CoordinatorFillEnrollmentKeyIdsOptions): Promise<CoordinatorFillEnrollmentKeyIdsResult>;
|
|
184
|
+
/** Removes one enrollment of one group and records its tombstone. No expansion by key. */
|
|
185
|
+
removeEnrollment(input: CoordinatorRemoveEnrollmentInput): Promise<CoordinatorRemoveEnrollmentResult>;
|
|
186
|
+
/**
|
|
187
|
+
* Reads which enrollments a removal of these device IDs would delete, in any
|
|
188
|
+
* group and under any device ID that holds the same key, and writes nothing.
|
|
189
|
+
*/
|
|
190
|
+
previewDeviceRemoval(input: CoordinatorDeviceRemovalPreviewInput): Promise<CoordinatorDeviceRemovalPreviewResult>;
|
|
191
|
+
/** Removes exactly the previewed expanded set and its dependent authority atomically. */
|
|
192
|
+
removeDeviceEnrollments(input: CoordinatorRemoveDeviceEnrollmentsInput): Promise<CoordinatorRemoveDeviceEnrollmentsResult>;
|
|
193
|
+
/** Active removal history, newest first. Requires the same readiness as removal. */
|
|
194
|
+
listDeviceRemovals(options?: CoordinatorListDeviceRemovalsInput): Promise<CoordinatorDeviceRemovalListResult>;
|
|
195
|
+
/** Reads a complete peer-removal snapshot. Key-ID fill is orchestrated by the route. */
|
|
196
|
+
lookupPeerRemovals(input: CoordinatorPeerRemovalLookupInput): Promise<CoordinatorPeerRemovalLookupResult>;
|
|
197
|
+
}
|
|
198
|
+
interface RemovalStatement {
|
|
199
|
+
sql: string;
|
|
200
|
+
values: (string | number | null)[];
|
|
201
|
+
read?: boolean;
|
|
202
|
+
}
|
|
203
|
+
export interface DeviceRemovalBackend {
|
|
204
|
+
/** All statements, including reads, execute in one transaction. */
|
|
205
|
+
batch(statements: RemovalStatement[]): Promise<unknown[]>;
|
|
206
|
+
all(statement: RemovalStatement): Promise<unknown>;
|
|
207
|
+
}
|
|
208
|
+
/** Internal storage capability. The caller authenticates the administrator. */
|
|
209
|
+
export declare class DeviceRemovalOperations implements CoordinatorDeviceRemovalStore {
|
|
210
|
+
private readonly backend;
|
|
211
|
+
private readonly clock;
|
|
212
|
+
constructor(backend: DeviceRemovalBackend, clock?: () => number);
|
|
213
|
+
lookupPeerRemovals(raw: CoordinatorPeerRemovalLookupInput): Promise<CoordinatorPeerRemovalLookupResult>;
|
|
214
|
+
listDeviceRemovals(raw?: CoordinatorListDeviceRemovalsInput): Promise<CoordinatorDeviceRemovalListResult>;
|
|
215
|
+
fillEnrollmentKeyIds(options?: CoordinatorFillEnrollmentKeyIdsOptions): Promise<CoordinatorFillEnrollmentKeyIdsResult>;
|
|
216
|
+
/**
|
|
217
|
+
* Single-group removal: one enrollment, no expansion by key. It refuses with
|
|
218
|
+
* `device_removal_unavailable` while any enrollment has an unfilled key ID or
|
|
219
|
+
* an enrollment trigger is missing, whether or not the device is enrolled.
|
|
220
|
+
*/
|
|
221
|
+
removeEnrollment(raw: CoordinatorRemoveEnrollmentInput): Promise<CoordinatorRemoveEnrollmentResult>;
|
|
222
|
+
/**
|
|
223
|
+
* The target set, read in one transaction or batch. It throws
|
|
224
|
+
* `device_removal_unavailable` under the conditions of a removal, whether or
|
|
225
|
+
* not a device is enrolled, and `device_removal_incomplete` for reads that do
|
|
226
|
+
* not describe one consistent set.
|
|
227
|
+
*/
|
|
228
|
+
private readTarget;
|
|
229
|
+
previewDeviceRemoval(raw: CoordinatorDeviceRemovalPreviewInput): Promise<CoordinatorDeviceRemovalPreviewResult>;
|
|
230
|
+
removeDeviceEnrollments(raw: CoordinatorRemoveDeviceEnrollmentsInput): Promise<CoordinatorRemoveDeviceEnrollmentsResult>;
|
|
231
|
+
}
|
|
232
|
+
export {};
|
|
233
|
+
//# sourceMappingURL=coordinator-device-removal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-removal.d.ts","sourceRoot":"","sources":["../src/coordinator-device-removal.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EACN,KAAK,uCAAuC,EAC5C,KAAK,wCAAwC,EAI7C,MAAM,wCAAwC,CAAC;AAKh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CAA2C,GAClD,OAAO,CAAC,qCAAqC,CAAC,CAqChD;IAED;;;;OAIG;IACG,gBAAgB,CACrB,GAAG,EAAE,gCAAgC,GACnC,OAAO,CAAC,iCAAiC,CAAC,CA4B5C;IAED;;;;;OAKG;YACW,UAAU;IAYlB,oBAAoB,CACzB,GAAG,EAAE,oCAAoC,GACvC,OAAO,CAAC,qCAAqC,CAAC,CAahD;IAEK,uBAAuB,CAC5B,GAAG,EAAE,uCAAuC,GAC1C,OAAO,CAAC,wCAAwC,CAAC,CAwBnD;CACD"}
|
|
@@ -27,6 +27,8 @@ export interface CoordinatorRevokeDeviceActionOptions {
|
|
|
27
27
|
groupId: string;
|
|
28
28
|
deviceId: string;
|
|
29
29
|
expectedDigest?: string;
|
|
30
|
+
/** Require the active tombstone from this Remove receipt for both phases. */
|
|
31
|
+
requiredRemovalId?: string;
|
|
30
32
|
expectedContext?: {
|
|
31
33
|
coordinatorId: string;
|
|
32
34
|
keyId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-revocation-client.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-client.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mCAAmC,6EAC2B,CAAC;AAE5E,UAAU,QAAQ;IACjB,OAAO,EAAE,CAAC,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,mCAAmC,CAAC;CAClD;AACD,MAAM,WAAW,kCAAmC,SAAQ,QAAQ;IACnE,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,oCAAoC;IACpD,YAAY,EAAE,WAAW,GAAG,aAAa,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,iCAAkC,SAAQ,QAAQ;IAClE,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,CAAC,oCAAoC,EAAE,oCAAoC,CAAC,CAAC;CAC1F;AACD,MAAM,WAAW,oCAAoC;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;
|
|
1
|
+
{"version":3,"file":"coordinator-device-revocation-client.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-client.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mCAAmC,6EAC2B,CAAC;AAE5E,UAAU,QAAQ;IACjB,OAAO,EAAE,CAAC,CAAC;IACX,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,OAAO,mCAAmC,CAAC;CAClD;AACD,MAAM,WAAW,kCAAmC,SAAQ,QAAQ;IACnE,KAAK,EAAE,OAAO,CAAC;IACf,eAAe,EAAE,MAAM,CAAC;CACxB;AACD,MAAM,WAAW,oCAAoC;IACpD,YAAY,EAAE,WAAW,GAAG,aAAa,CAAC;IAC1C,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACnB;AACD,MAAM,WAAW,iCAAkC,SAAQ,QAAQ;IAClE,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,EAAE,CAAC,oCAAoC,EAAE,oCAAoC,CAAC,CAAC;CAC1F;AACD,MAAM,WAAW,oCAAoC;IACpD,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE;QAAE,aAAa,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uFAAuF;IACvF,UAAU,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AAmKD,4FAA4F;AAC5F,wBAAsB,6BAA6B,CAClD,IAAI,EAAE,oCAAoC,GACxC,OAAO,CAAC,kCAAkC,GAAG,iCAAiC,CAAC,CA4BjF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-revocation-handler-test-harness.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-handler-test-harness.ts"],"names":[],"mappings":"AAMA,OAAO,EAIN,KAAK,iBAAiB,EAEtB,MAAM,iDAAiD,CAAC;
|
|
1
|
+
{"version":3,"file":"coordinator-device-revocation-handler-test-harness.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-handler-test-harness.ts"],"names":[],"mappings":"AAMA,OAAO,EAIN,KAAK,iBAAiB,EAEtB,MAAM,iDAAiD,CAAC;AAsDzD,kFAAkF;AAClF,wBAAgB,uCAAuC,CACtD,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,QAoB1C"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CoordinatorStore } from "./coordinator-store-contract.js";
|
|
2
2
|
export type CoordinatorDeviceRevocationAction = "preview" | "commit";
|
|
3
3
|
export interface CoordinatorDeviceRevocationHandlerOptions {
|
|
4
|
-
store: Pick<CoordinatorStore, "getEnrollment" | "createDeviceRevocation">;
|
|
4
|
+
store: Pick<CoordinatorStore, "getEnrollment" | "getDeviceRevocationTombstone" | "createDeviceRevocation">;
|
|
5
5
|
/** Server composition only: never derive this from a request or enrollment. */
|
|
6
6
|
trustedCoordinatorId: string | null;
|
|
7
7
|
adminSecret?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-revocation-handler.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-handler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,MAAM,iCAAiC,GAAG,SAAS,GAAG,QAAQ,CAAC;AAIrE,MAAM,WAAW,yCAAyC;IACzD,KAAK,EAAE,IAAI,
|
|
1
|
+
{"version":3,"file":"coordinator-device-revocation-handler.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-handler.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,MAAM,iCAAiC,GAAG,SAAS,GAAG,QAAQ,CAAC;AAIrE,MAAM,WAAW,yCAAyC;IACzD,KAAK,EAAE,IAAI,CACV,gBAAgB,EAChB,eAAe,GAAG,8BAA8B,GAAG,wBAAwB,CAC3E,CAAC;IACF,+EAA+E;IAC/E,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,6FAA6F;IAC7F,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,QAAQ,GAAG,IAAI,CAAC;CACnD;AAOD,eAAO,MAAM,4CAA4C,OAAO,CAAC;AA2QjE;;;GAGG;AACH,wBAAgB,wCAAwC,CACvD,OAAO,EAAE,yCAAyC,GAChD,CAAC,MAAM,EAAE,iCAAiC,EAAE,OAAO,EAAE,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,CA2BpF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-revocation-route.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAM1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,wFAAwF;AACxF,MAAM,WAAW,kCAAkC;IAClD,aAAa,EAAE,MAAM,CAAC;CACtB;AAmCD,wBAAgB,yCAAyC,CACxD,GAAG,EAAE,IAAI,EACT,OAAO,EAAE;IACR,OAAO,CAAC,EAAE,kCAAkC,CAAC;IAC7C,wBAAwB,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7C,YAAY,EAAE,MAAM,gBAAgB,CAAC;IACrC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,KAAK,QAAQ,GAAG,IAAI,CAAC;CAC1F,GACC,IAAI,
|
|
1
|
+
{"version":3,"file":"coordinator-device-revocation-route.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAM1C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,wFAAwF;AACxF,MAAM,WAAW,kCAAkC;IAClD,aAAa,EAAE,MAAM,CAAC;CACtB;AAmCD,wBAAgB,yCAAyC,CACxD,GAAG,EAAE,IAAI,EACT,OAAO,EAAE;IACR,OAAO,CAAC,EAAE,kCAAkC,CAAC;IAC7C,wBAAwB,EAAE,SAAS,OAAO,EAAE,CAAC;IAC7C,YAAY,EAAE,MAAM,gBAAgB,CAAC;IACrC,WAAW,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IACjC,mBAAmB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,aAAa,EAAE,OAAO,KAAK,QAAQ,GAAG,IAAI,CAAC;CAC1F,GACC,IAAI,CAkDN"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-revocation-test-harness.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-test-harness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"coordinator-device-revocation-test-harness.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation-test-harness.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAavE,MAAM,MAAM,iBAAiB,GAAG;IAC/B,KAAK,EAAE,KAAK,CAAC;IACb,KAAK,EAAE;QACN,OAAO,EAAE,MAAM,CAAC;QAChB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAC3D,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC;CAC5C,CAAC;AACF,eAAO,MAAM,0BAA0B,UAYtC,CAAC;AACF,wBAAgB,iBAAiB,CAChC,OAAO,EAAE,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC;;GAKxE;AACD,wBAAgB,eAAe,CAAC,MAAM,SAAW;;;;;;EAQhD;AACD,wBAAsB,gBAAgB,CAAC,CAAC,EAAE,iBAAiB,iBAG1D;AACD,wBAAgB,UAAU,CAAC,CAAC,EAAE,iBAAiB,EAAE,KAAK,SAAY;;;;;;EAQjE;AAED,wBAAgB,gCAAgC,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,iBAAiB,CAAC,QAc1F"}
|
|
@@ -9,11 +9,18 @@ export interface CoordinatorDeviceRevocationRecord {
|
|
|
9
9
|
readonly actor_id: string | null;
|
|
10
10
|
readonly created_at: string;
|
|
11
11
|
}
|
|
12
|
-
export
|
|
12
|
+
export type CoordinatorDeviceRevocationEvidenceKind = "enrollment" | "removal_tombstone";
|
|
13
|
+
export interface CoordinatorDeviceRevocationEvidence {
|
|
13
14
|
groupId: string;
|
|
14
15
|
deviceId: string;
|
|
15
16
|
publicKey: string;
|
|
16
17
|
fingerprint: string;
|
|
18
|
+
}
|
|
19
|
+
export interface CoordinatorCreateDeviceRevocationInput extends CoordinatorDeviceRevocationEvidence {
|
|
20
|
+
/** Existing internal callers supply enrollment evidence. */
|
|
21
|
+
evidenceKind?: CoordinatorDeviceRevocationEvidenceKind;
|
|
22
|
+
/** Opt-in compound Block constraint, copied from the verified Remove receipt. */
|
|
23
|
+
requiredRemovalId?: string;
|
|
17
24
|
/** Audit evidence only; this internal capability requires a trusted caller. */
|
|
18
25
|
actorId?: string | null;
|
|
19
26
|
}
|
|
@@ -37,10 +44,19 @@ export type CoordinatorCreateDeviceRevocationResult = {
|
|
|
37
44
|
};
|
|
38
45
|
export type CoordinatorAuthorizedNonceResult = "recorded" | "nonce_replay" | "device_revoked" | "unknown_device" | "device_disabled" | "group_not_found" | "group_archived";
|
|
39
46
|
export interface CoordinatorDeviceRevocationStore {
|
|
47
|
+
getDeviceRevocationTombstone(groupId: string, deviceId: string, requiredRemovalId?: string): Promise<CoordinatorDeviceRevocationEvidence | null>;
|
|
40
48
|
createDeviceRevocation(input: CoordinatorCreateDeviceRevocationInput): Promise<CoordinatorCreateDeviceRevocationResult>;
|
|
41
49
|
listDeviceRevocations(input: CoordinatorListDeviceRevocationsInput): Promise<CoordinatorDeviceRevocationRecord[]>;
|
|
42
50
|
recordAuthorizedNonce(input: CoordinatorRecordAuthorizedNonceInput): Promise<CoordinatorAuthorizedNonceResult>;
|
|
51
|
+
/** Every revoked subject, for marking listings. Stores without it report no revocations. */
|
|
52
|
+
listRevokedSubjects?(): Promise<CoordinatorRevokedSubject[]>;
|
|
53
|
+
}
|
|
54
|
+
export interface CoordinatorRevokedSubject {
|
|
55
|
+
readonly subject_kind: "device_id" | "ed25519_key";
|
|
56
|
+
readonly subject_value: string;
|
|
43
57
|
}
|
|
58
|
+
/** Above this many subjects the read throws, and listings stay unmarked rather than read further. */
|
|
59
|
+
export declare const REVOKED_SUBJECT_LIST_LIMIT = 5000;
|
|
44
60
|
export declare const DEVICE_REVOCATION_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_device_revocations (\n subject_kind TEXT NOT NULL CHECK(subject_kind IN ('device_id', 'ed25519_key')),\n subject_value TEXT NOT NULL CHECK(\n (subject_kind = 'device_id' AND length(subject_value) BETWEEN 1 AND 256) OR\n (subject_kind = 'ed25519_key' AND length(subject_value) = 64\n AND subject_value NOT GLOB '*[^a-f0-9]*')),\n revocation_id TEXT NOT NULL,\n evidence_group_id TEXT NOT NULL,\n evidence_device_id TEXT NOT NULL,\n evidence_public_key TEXT NOT NULL,\n evidence_fingerprint TEXT NOT NULL,\n actor_id TEXT,\n created_at TEXT NOT NULL,\n PRIMARY KEY (subject_kind, subject_value)\n);\n";
|
|
45
61
|
interface RevocationStatement {
|
|
46
62
|
sql: string;
|
|
@@ -54,13 +70,15 @@ export interface DeviceRevocationBackend {
|
|
|
54
70
|
}
|
|
55
71
|
/** Bind the device ID and derived canonical key ID (or null), in that order. */
|
|
56
72
|
export declare const DEVICE_REVOCATION_SUBJECT_EXISTS_SQL = "EXISTS (\nSELECT 1 FROM coordinator_device_revocations WHERE\n(subject_kind = 'device_id' AND subject_value = ?) OR\n(subject_kind = 'ed25519_key' AND subject_value = ?))";
|
|
57
|
-
/** Internal storage capability only.
|
|
73
|
+
/** Internal storage capability only. Creation and retries require the exact evidence source. */
|
|
58
74
|
export declare class DeviceRevocationOperations implements CoordinatorDeviceRevocationStore {
|
|
59
75
|
private readonly backend;
|
|
60
76
|
private readonly clock;
|
|
61
77
|
constructor(backend: DeviceRevocationBackend, clock?: () => number);
|
|
78
|
+
getDeviceRevocationTombstone(groupId: string, deviceId: string, requiredRemovalId?: string): Promise<CoordinatorDeviceRevocationEvidence | null>;
|
|
62
79
|
createDeviceRevocation(raw: CoordinatorCreateDeviceRevocationInput): Promise<CoordinatorCreateDeviceRevocationResult>;
|
|
63
80
|
listDeviceRevocations(input: CoordinatorListDeviceRevocationsInput): Promise<CoordinatorDeviceRevocationRecord[]>;
|
|
81
|
+
listRevokedSubjects(): Promise<CoordinatorRevokedSubject[]>;
|
|
64
82
|
recordAuthorizedNonce(raw: CoordinatorRecordAuthorizedNonceInput): Promise<CoordinatorAuthorizedNonceResult>;
|
|
65
83
|
}
|
|
66
84
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-revocation.d.ts","sourceRoot":"","sources":["../src/coordinator-device-revocation.ts"],"names":[],"mappings":"AAOA,MAAM,WAAW,iCAAiC;IACjD,QAAQ,CAAC,YAAY,EAAE,WAAW,GAAG,aAAa,CAAC;IACnD,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,kBAAkB,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,I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AAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"coordinator-enrollment-reconciler.d.ts","sourceRoot":"","sources":["../src/coordinator-enrollment-reconciler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,0BAA0B,CAAC;AAE9E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAmBxC,MAAM,WAAW,mCAAmC;IACnD,IAAI,EAAE,QAAQ,GAAG,iBAAiB,CAAC;IACnC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oCAAoC;IACpD,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,mCAAmC,EAAE,CAAC;CAC9C;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,MAAM,CAShF;AA2QD,wBAAsB,sCAAsC,CAC3D,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,qBAAqB,EAAE,CAAC;IACrC,mBAAmB,EAAE,6BAA6B,EAAE,CAAC;IACrD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,GAAG,CAAC,EAAE,MAAM,CAAC;CACb,GACC,OAAO,CAAC,oCAAoC,CAAC,CA4Y/C"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only arrangement of `enrolled_devices` rows that the enrollment triggers
|
|
3
|
+
* would refuse as plain SQL. Each helper has one implementation, a plan of
|
|
4
|
+
* statements, and runs on a better-sqlite3 database or through an async
|
|
5
|
+
* function that takes SQL and values: a fixture's `exec`, or `d1EnrollmentExec`
|
|
6
|
+
* for a D1 database, native or the SQLite adapter. A helper drops a trigger
|
|
7
|
+
* only when the database has it and then creates it again from its current
|
|
8
|
+
* definition, so a database without the enrollment triggers stays without them.
|
|
9
|
+
*/
|
|
10
|
+
export interface EnrollmentTestStatement {
|
|
11
|
+
sql: string;
|
|
12
|
+
values: unknown[];
|
|
13
|
+
}
|
|
14
|
+
/** An async statement runner. It rejects when the statement fails. */
|
|
15
|
+
export type EnrollmentTestExec = (sql: string, ...values: never[]) => Promise<unknown>;
|
|
16
|
+
/** The part of a better-sqlite3 database that the helpers use. */
|
|
17
|
+
export interface EnrollmentTestSqlite {
|
|
18
|
+
prepare(sql: string): {
|
|
19
|
+
run(...values: unknown[]): unknown;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
type Target = EnrollmentTestSqlite | EnrollmentTestExec;
|
|
23
|
+
/** A promise for the async runner. The better-sqlite3 path has finished when it returns. */
|
|
24
|
+
type Result<T extends Target> = T extends EnrollmentTestExec ? Promise<void> : undefined;
|
|
25
|
+
/** The statement runner of a D1 database, native or the SQLite adapter. */
|
|
26
|
+
export declare function d1EnrollmentExec<Statement extends {
|
|
27
|
+
run(): Promise<unknown>;
|
|
28
|
+
}>(db: {
|
|
29
|
+
prepare(sql: string): {
|
|
30
|
+
bind(...values: never[]): Statement;
|
|
31
|
+
};
|
|
32
|
+
}): EnrollmentTestExec;
|
|
33
|
+
/**
|
|
34
|
+
* The statement runner of a test database that binds a value array by number.
|
|
35
|
+
* Each `?` of a helper's statement becomes `?1` to `?n`, in order.
|
|
36
|
+
*/
|
|
37
|
+
export declare function numberedEnrollmentExec(run: (sql: string, values: never[]) => Promise<unknown>): EnrollmentTestExec;
|
|
38
|
+
/**
|
|
39
|
+
* Creates the state that a removal before 0.50 left: the enrollment is gone and
|
|
40
|
+
* no tombstone records it. Every coordinator that an earlier release removed a
|
|
41
|
+
* device from is in that state, so tests keep arranging it, and they arrange it
|
|
42
|
+
* only here. Only the delete trigger is dropped and re-created around the
|
|
43
|
+
* delete. `where` is the condition after WHERE, and no condition deletes every
|
|
44
|
+
* enrollment.
|
|
45
|
+
*/
|
|
46
|
+
export declare function deleteEnrollmentWithoutTombstone<T extends Target>(target: T, where?: string, ...values: unknown[]): Result<T>;
|
|
47
|
+
/**
|
|
48
|
+
* What `removeDevice` did before 0.50: it deletes the presence row, the
|
|
49
|
+
* reciprocal approvals and the enrollment of one device in one group, and no
|
|
50
|
+
* tombstone records it. A test whose subject is not the removal itself arranges
|
|
51
|
+
* "was enrolled and is not any more" this way, so that the enrollment it makes
|
|
52
|
+
* next is not refused as that of a removed device.
|
|
53
|
+
*/
|
|
54
|
+
export declare function removeDeviceWithoutTombstone<T extends Target>(target: T, groupId: string, deviceId: string): Result<T>;
|
|
55
|
+
/**
|
|
56
|
+
* Clears enrollments and every removal tombstone between tests that share one
|
|
57
|
+
* database. Tombstones are immutable by trigger and would refuse the next
|
|
58
|
+
* test's enrollments, so both delete triggers are dropped and re-created around
|
|
59
|
+
* the cleanup. `where` limits the enrollments, never the tombstones. A database
|
|
60
|
+
* from before the tombstone table only has its enrollments cleared.
|
|
61
|
+
*/
|
|
62
|
+
export declare function clearEnrollmentsAndRemovals<T extends Target>(target: T, where?: string, ...values: unknown[]): Result<T>;
|
|
63
|
+
/** The `key_id` an enrollment writer stores for this key text. */
|
|
64
|
+
export declare function enrollmentTestKeyId(publicKey: string): string;
|
|
65
|
+
export interface EnrollmentKeyChange {
|
|
66
|
+
publicKey: string;
|
|
67
|
+
/** Defaults to the fingerprint of the new key text. Null keeps the stored one. */
|
|
68
|
+
fingerprint?: string | null;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A raw key change that passes the enrollment triggers, as a writer's does: one
|
|
72
|
+
* UPDATE sets `public_key`, `fingerprint` and `key_id` together. The UPDATE
|
|
73
|
+
* before it moves `key_id` off its value, because the stale-key trigger cannot
|
|
74
|
+
* tell a restated key ID from one that was left alone. No trigger is dropped.
|
|
75
|
+
* On a test schema without the key ID column only the key text and fingerprint
|
|
76
|
+
* are written.
|
|
77
|
+
* The fingerprint defaults to that of the new key text. A null fingerprint keeps
|
|
78
|
+
* the stored one, for a test that must change the key text and nothing else:
|
|
79
|
+
* one that pins the key against drift apart from the fingerprint, or whose
|
|
80
|
+
* fixture fingerprint is evidence on its own. `where` is the condition after
|
|
81
|
+
* WHERE and must not read `key_id`.
|
|
82
|
+
*/
|
|
83
|
+
export declare function changeEnrollmentKey<T extends Target>(target: T, key: EnrollmentKeyChange, where?: string, ...values: unknown[]): Result<T>;
|
|
84
|
+
/**
|
|
85
|
+
* `public_key || suffix` for the enrollments that `where` selects: each stored
|
|
86
|
+
* key text gains the suffix, which for an SSH key is another text form of the
|
|
87
|
+
* same key. The fingerprint stays. It reads the rows first, so it takes a
|
|
88
|
+
* better-sqlite3 database only.
|
|
89
|
+
*/
|
|
90
|
+
export declare function appendToEnrollmentKey(db: {
|
|
91
|
+
prepare(sql: string): {
|
|
92
|
+
run(...values: unknown[]): unknown;
|
|
93
|
+
all(...values: unknown[]): unknown[];
|
|
94
|
+
};
|
|
95
|
+
}, suffix: string, where?: string, ...values: unknown[]): void;
|
|
96
|
+
/**
|
|
97
|
+
* The same key change as SQL text, for a table of SQL strings that a test runs
|
|
98
|
+
* with `exec`. `where` is written out in full, and the key values become literals.
|
|
99
|
+
*/
|
|
100
|
+
export declare function changeEnrollmentKeySql(key: EnrollmentKeyChange, where?: string): string;
|
|
101
|
+
export interface EnrollmentSeed {
|
|
102
|
+
groupId: string;
|
|
103
|
+
deviceId: string;
|
|
104
|
+
publicKey: string;
|
|
105
|
+
/** Defaults to the fingerprint of the key text. */
|
|
106
|
+
fingerprint?: string;
|
|
107
|
+
identityId?: string | null;
|
|
108
|
+
displayName?: string | null;
|
|
109
|
+
/** Defaults to true. */
|
|
110
|
+
enabled?: boolean;
|
|
111
|
+
createdAt?: string;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* A raw enrollment seed with the key ID a writer would store. An enrollment
|
|
115
|
+
* without a key ID is refused once any tombstone exists, so a seed that may run
|
|
116
|
+
* after a removal goes through here.
|
|
117
|
+
*/
|
|
118
|
+
export declare function seedEnrollment<T extends Target>(target: T, seed: EnrollmentSeed): Result<T>;
|
|
119
|
+
/**
|
|
120
|
+
* What a raw `INSERT OR REPLACE` seed did: the enrollment of that group and
|
|
121
|
+
* device, if any, gives way to the seed. The collision triggers refuse the
|
|
122
|
+
* REPLACE form, so this deletes without a tombstone and then inserts.
|
|
123
|
+
*/
|
|
124
|
+
export declare function replaceEnrollment<T extends Target>(target: T, seed: EnrollmentSeed): Result<T>;
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=coordinator-enrollment-test-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-enrollment-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-enrollment-test-fixtures.ts"],"names":[],"mappings":"AASA;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACvC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,OAAO,EAAE,CAAC;CAClB;AAED,sEAAsE;AACtE,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEvF,kEAAkE;AAClE,MAAM,WAAW,oBAAoB;IACpC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,GAAG,CAAC,GAAG,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,CAAA;KAAE,CAAC;CAC7D;AAED,KAAK,MAAM,GAAG,oBAAoB,GAAG,kBAAkB,CAAC;AACxD,4FAA4F;AAC5F,KAAK,MAA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CAAC,CAAC,SAAS,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,cAAc,GAAG,MAAM,CAAC,CAAC,CAAC,CAW9F"}
|
|
@@ -27,10 +27,10 @@ export declare function historyCases(statement: AuthLinkStatement): {
|
|
|
27
27
|
selected: boolean;
|
|
28
28
|
}[];
|
|
29
29
|
export declare function compareHistorySql(backend: Backend, statement: AuthLinkStatement): Promise<{
|
|
30
|
+
error?: undefined;
|
|
30
31
|
rows: {
|
|
31
32
|
row: string;
|
|
32
33
|
}[];
|
|
33
|
-
error?: undefined;
|
|
34
34
|
} | {
|
|
35
35
|
rows?: undefined;
|
|
36
36
|
error: string;
|