@codemem/core 0.49.0-beta.1 → 0.49.0-beta.3
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/better-sqlite-coordinator-store.d.ts +21 -2
- package/dist/better-sqlite-coordinator-store.d.ts.map +1 -1
- package/dist/coordinator-account-change-authority.d.ts +56 -0
- package/dist/coordinator-account-change-authority.d.ts.map +1 -0
- package/dist/coordinator-account-change-decision.d.ts +141 -0
- package/dist/coordinator-account-change-decision.d.ts.map +1 -0
- package/dist/coordinator-account-change-http-test-fixtures.d.ts +3 -1
- package/dist/coordinator-account-change-http-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-account-change-original-sql-test-fixtures.d.ts +61 -0
- package/dist/coordinator-account-change-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-account-change.d.ts +7 -1
- package/dist/coordinator-account-change.d.ts.map +1 -1
- package/dist/coordinator-account-connection-link.d.ts +1 -1
- package/dist/coordinator-account-connection-link.d.ts.map +1 -1
- package/dist/coordinator-account-connection-schema.d.ts +31 -0
- package/dist/coordinator-account-connection-schema.d.ts.map +1 -1
- package/dist/coordinator-account-connection-session.d.ts +9 -0
- package/dist/coordinator-account-connection-session.d.ts.map +1 -1
- package/dist/coordinator-account-historical-revoke-original-sql-test-fixtures.d.ts +7 -0
- package/dist/coordinator-account-historical-revoke-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-account-historical-revoke.d.ts +8 -2
- package/dist/coordinator-account-historical-revoke.d.ts.map +1 -1
- package/dist/coordinator-account-link-status-client.d.ts +4 -0
- package/dist/coordinator-account-link-status-client.d.ts.map +1 -1
- package/dist/coordinator-account-link-status.d.ts.map +1 -1
- package/dist/coordinator-account-schema-sqlite-test-fixtures.d.ts +58 -0
- package/dist/coordinator-account-schema-sqlite-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-account-schema-test-fixtures.d.ts +20 -0
- package/dist/coordinator-account-schema-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-api.d.ts.map +1 -1
- package/dist/coordinator-auth-browser-owner-purpose-test-harness.d.ts.map +1 -1
- package/dist/coordinator-auth-browser-transaction-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-auth-browser-transaction.d.ts.map +1 -1
- package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts +5 -1
- package/dist/coordinator-auth-controller-consistency-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-auth-controller-history.d.ts +0 -1
- package/dist/coordinator-auth-controller-history.d.ts.map +1 -1
- package/dist/coordinator-auth-controller-original-sql-test-fixtures.d.ts +41 -0
- package/dist/coordinator-auth-controller-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-controller-owner.d.ts +0 -6
- package/dist/coordinator-auth-controller-owner.d.ts.map +1 -1
- package/dist/coordinator-auth-controller-race-test-fixtures.d.ts +38 -0
- package/dist/coordinator-auth-controller-race-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-controller-read-set.d.ts +47 -0
- package/dist/coordinator-auth-controller-read-set.d.ts.map +1 -0
- package/dist/coordinator-auth-controller-stages-original-sql-test-fixtures.d.ts +8 -0
- package/dist/coordinator-auth-controller-stages-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-auth-controller.d.ts +1 -21
- package/dist/coordinator-auth-controller.d.ts.map +1 -1
- package/dist/coordinator-auth-device-claim-eligibility.d.ts +51 -2
- package/dist/coordinator-auth-device-claim-eligibility.d.ts.map +1 -1
- package/dist/coordinator-auth-historical-store-test-fixture.d.ts +2 -0
- package/dist/coordinator-auth-historical-store-test-fixture.d.ts.map +1 -1
- package/dist/coordinator-auth-legacy-assignment.d.ts +4 -2
- package/dist/coordinator-auth-legacy-assignment.d.ts.map +1 -1
- package/dist/coordinator-auth-link-authority-upgrade.d.ts +5 -0
- package/dist/coordinator-auth-link-authority-upgrade.d.ts.map +1 -1
- package/dist/coordinator-auth-link-maintenance-fixtures.d.ts +2 -2
- package/dist/coordinator-auth-link-maintenance-fixtures.d.ts.map +1 -1
- package/dist/coordinator-auth-link-provenance.d.ts.map +1 -1
- package/dist/coordinator-auth-link-revocation-test-harness.d.ts.map +1 -1
- package/dist/coordinator-auth-link-test-fixtures.d.ts +26 -4
- package/dist/coordinator-auth-link-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-auth-link.d.ts +5 -0
- package/dist/coordinator-auth-link.d.ts.map +1 -1
- package/dist/coordinator-auth-read-set.d.ts +99 -0
- package/dist/coordinator-auth-read-set.d.ts.map +1 -0
- package/dist/coordinator-auth-schema-stage.d.ts +36 -0
- package/dist/coordinator-auth-schema-stage.d.ts.map +1 -0
- package/dist/coordinator-auth-schema.d.ts.map +1 -1
- package/dist/coordinator-auth-session.d.ts.map +1 -1
- package/dist/coordinator-auth-store-test-fixtures.d.ts +12 -0
- package/dist/coordinator-auth-store-test-fixtures.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 +10 -0
- package/dist/coordinator-d1-schema-inventory.d.ts.map +1 -0
- package/dist/coordinator-device-claim-binding-contract.d.ts +37 -0
- package/dist/coordinator-device-claim-binding-contract.d.ts.map +1 -0
- package/dist/coordinator-device-claim-binding-reuse.d.ts +23 -0
- package/dist/coordinator-device-claim-binding-reuse.d.ts.map +1 -0
- package/dist/coordinator-device-claim-binding-sql.d.ts +40 -0
- package/dist/coordinator-device-claim-binding-sql.d.ts.map +1 -0
- package/dist/coordinator-device-claim-binding.d.ts +21 -0
- package/dist/coordinator-device-claim-binding.d.ts.map +1 -0
- package/dist/coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts +88 -0
- package/dist/coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-device-ownership-evidence-queries.d.ts +4 -14
- package/dist/coordinator-device-ownership-evidence-queries.d.ts.map +1 -1
- package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts +10 -0
- package/dist/coordinator-device-ownership-evidence-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-device-ownership-evidence.d.ts +11 -3
- package/dist/coordinator-device-ownership-evidence.d.ts.map +1 -1
- package/dist/coordinator-device-rebind-ceremony.d.ts +2 -1
- package/dist/coordinator-device-rebind-ceremony.d.ts.map +1 -1
- package/dist/coordinator-device-rebind-commit.d.ts.map +1 -1
- package/dist/coordinator-device-rebind-proof.d.ts +1 -0
- package/dist/coordinator-device-rebind-proof.d.ts.map +1 -1
- package/dist/coordinator-device-rebind-schema.d.ts +4 -3
- package/dist/coordinator-device-rebind-schema.d.ts.map +1 -1
- package/dist/coordinator-device-rebind-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-device-self-bind-authority.d.ts +29 -0
- package/dist/coordinator-device-self-bind-authority.d.ts.map +1 -0
- package/dist/coordinator-device-self-bind-decision.d.ts +84 -0
- package/dist/coordinator-device-self-bind-decision.d.ts.map +1 -0
- package/dist/coordinator-device-self-bind-original-sql-test-fixtures.d.ts +17 -0
- package/dist/coordinator-device-self-bind-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-device-self-bind-test-fixtures.d.ts +114 -0
- package/dist/coordinator-device-self-bind-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-device-setup-client.d.ts +26 -0
- package/dist/coordinator-device-setup-client.d.ts.map +1 -0
- package/dist/coordinator-device-setup-http.d.ts +9 -0
- package/dist/coordinator-device-setup-http.d.ts.map +1 -0
- package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts +6 -2
- package/dist/coordinator-history-sql-equivalence-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-legacy-completion-owner-proof-original-sql-test-fixtures.d.ts +77 -0
- package/dist/coordinator-legacy-completion-owner-proof-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-legacy-completion-owner-proof-test-fixtures.d.ts +46 -0
- package/dist/coordinator-legacy-completion-owner-proof-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-legacy-completion-owner-proof.d.ts +19 -2
- package/dist/coordinator-legacy-completion-owner-proof.d.ts.map +1 -1
- package/dist/coordinator-legacy-owner-compatibility.d.ts +23 -0
- package/dist/coordinator-legacy-owner-compatibility.d.ts.map +1 -1
- package/dist/coordinator-legacy-owner-resolution-commit-original-sql-test-fixtures.d.ts +63 -0
- package/dist/coordinator-legacy-owner-resolution-commit-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts +3 -1
- package/dist/coordinator-legacy-owner-resolution-commit-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-legacy-owner-resolution-commit.d.ts.map +1 -1
- package/dist/coordinator-owner-enrollment-commit.d.ts.map +1 -1
- package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts +2 -0
- package/dist/coordinator-owner-enrollment-historical-test-fixture.d.ts.map +1 -1
- package/dist/coordinator-owner-enrollment-start-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-owner-negative-consistency.d.ts +11 -17
- package/dist/coordinator-owner-negative-consistency.d.ts.map +1 -1
- package/dist/coordinator-owner-negative-original-sql-test-fixtures.d.ts +44 -0
- package/dist/coordinator-owner-negative-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-owner-negative-race-test-fixtures.d.ts +26 -0
- package/dist/coordinator-owner-negative-race-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-owner-negative-read-set.d.ts +43 -0
- package/dist/coordinator-owner-negative-read-set.d.ts.map +1 -0
- package/dist/coordinator-owner-negative-reads.d.ts +32 -0
- package/dist/coordinator-owner-negative-reads.d.ts.map +1 -0
- package/dist/coordinator-owner-producer-original-sql-test-fixtures.d.ts +26 -0
- package/dist/coordinator-owner-producer-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts +1 -0
- package/dist/coordinator-owner-resolution-review-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-owner-resolution-review.d.ts +1 -0
- package/dist/coordinator-owner-resolution-review.d.ts.map +1 -1
- package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts +8 -2
- package/dist/coordinator-producer-negative-owner-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-recipient-negative-race-test-fixtures.d.ts +54 -0
- package/dist/coordinator-recipient-negative-race-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-recipient-owner-consistency.d.ts +4 -5
- package/dist/coordinator-recipient-owner-consistency.d.ts.map +1 -1
- package/dist/coordinator-recipient-owner-original-sql-test-fixtures.d.ts +30 -0
- package/dist/coordinator-recipient-owner-original-sql-test-fixtures.d.ts.map +1 -0
- package/dist/coordinator-resolved-account-owner-status-query.d.ts +4 -1
- package/dist/coordinator-resolved-account-owner-status-query.d.ts.map +1 -1
- package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts +1 -0
- package/dist/coordinator-resolved-account-owner-status-test-fixtures.d.ts.map +1 -1
- package/dist/coordinator-resolved-account-owner-status.d.ts +2 -0
- package/dist/coordinator-resolved-account-owner-status.d.ts.map +1 -1
- package/dist/{coordinator-runtime-Bdad5KeL.js → coordinator-runtime-BXJQAKFD.js} +3 -3
- package/dist/{coordinator-runtime-Bdad5KeL.js.map → coordinator-runtime-BXJQAKFD.js.map} +1 -1
- package/dist/coordinator-sql-compare.d.ts +22 -0
- package/dist/coordinator-sql-compare.d.ts.map +1 -0
- package/dist/d1-coordinator-store.d.ts +16 -1
- package/dist/d1-coordinator-store.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9048 -8412
- package/dist/index.js.map +1 -1
- package/dist/ingest-events.d.ts.map +1 -1
- package/dist/ingest-pipeline.d.ts +38 -2
- package/dist/ingest-pipeline.d.ts.map +1 -1
- package/dist/internal/cloudflare-coordinator.js +1079 -1074
- package/dist/internal/cloudflare-coordinator.js.map +1 -1
- package/dist/internal/relay-runtime.js +2 -2
- package/dist/linked-legacy-setup-test-fixtures.d.ts +71 -0
- package/dist/linked-legacy-setup-test-fixtures.d.ts.map +1 -0
- package/dist/operational-status.d.ts +3 -0
- package/dist/operational-status.d.ts.map +1 -1
- package/dist/{owner-enrollment-start-DgToUaFZ.js → owner-enrollment-start-BFyBKWvZ.js} +2731 -2315
- package/dist/owner-enrollment-start-BFyBKWvZ.js.map +1 -0
- package/dist/owner-enrollment-start.d.ts.map +1 -1
- package/dist/owner-qualified-consumer-access-test-harness.d.ts.map +1 -1
- package/dist/owner-qualified-consumer-adversarial-test-harness.d.ts +1 -1
- package/dist/owner-qualified-consumer-adversarial-test-harness.d.ts.map +1 -1
- package/dist/owner-qualified-consumer-test-harness.d.ts +3 -0
- package/dist/owner-qualified-consumer-test-harness.d.ts.map +1 -1
- package/dist/owner-qualified-headless-test-harness.d.ts +1 -1
- package/dist/owner-qualified-headless-test-harness.d.ts.map +1 -1
- package/dist/project-scope-settings.d.ts.map +1 -1
- package/dist/raw-event-flush.d.ts.map +1 -1
- package/dist/relay-admission-table-keys-test-fixtures.d.ts +2 -1
- package/dist/relay-admission-table-keys-test-fixtures.d.ts.map +1 -1
- package/dist/{relay-peer-client-DdhDwDFz.js → relay-peer-client-DrTb2oZt.js} +2650 -2627
- package/dist/relay-peer-client-DrTb2oZt.js.map +1 -0
- package/dist/{sync-auth-constants-WKqJ9CX5.js → sync-auth-constants-BVzVfSmn.js} +4476 -3521
- package/dist/sync-auth-constants-BVzVfSmn.js.map +1 -0
- package/dist/{sync-reachability-pass-CSg85Qmd.js → sync-reachability-pass-CUe5bK61.js} +12 -12
- package/dist/{sync-reachability-pass-CSg85Qmd.js.map → sync-reachability-pass-CUe5bK61.js.map} +1 -1
- package/dist/sync-reachability-pass-D9cA54fj.js +2 -0
- package/package.json +3 -3
- package/dist/owner-enrollment-start-DgToUaFZ.js.map +0 -1
- package/dist/relay-peer-client-DdhDwDFz.js.map +0 -1
- package/dist/sync-auth-constants-WKqJ9CX5.js.map +0 -1
- package/dist/sync-reachability-pass-CQe7nZnN.js +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-claim-binding-reuse.d.ts","sourceRoot":"","sources":["../src/coordinator-device-claim-binding-reuse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAE5F,MAAM,WAAW,wBAAwB;IACxC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,kBAAkB,GAAG,2BAA2B,CAAC;IAC7D,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAYD,+EAA+E;AAC/E,wBAAsB,4BAA4B,CACjD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,uBAAuB,EAC9B,aAAa,EAAE,MAAM,EACrB,KAAK,EAAE,MAAM,GACX,OAAO,CAAC,wBAAwB,GAAG,IAAI,GAAG,SAAS,CAAC,CAyBtD;AAED,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,wBAAwB,GAAG,iBAAiB,CAKhG;AAED,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,SAAS,EAAE,iBAAiB,GAAG,iBAAiB,CAM/E;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC9C,IAAI,EAAE,0BAA0B,EAChC,OAAO,EAAE,wBAAwB,GAC/B,iBAAiB,EAAE,CAyBrB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { AuthLinkBackend, AuthLinkStatement } from "./coordinator-auth-link.js";
|
|
2
|
+
import type { CoordinatorAuthLinkConfig } from "./coordinator-auth-link-contract.js";
|
|
3
|
+
import { type DeviceClaimBindingInput } from "./coordinator-device-claim-binding-contract.js";
|
|
4
|
+
import { type ExistingFirstLinkBinding } from "./coordinator-device-claim-binding-reuse.js";
|
|
5
|
+
export interface PreparedDeviceClaimBinding {
|
|
6
|
+
guard: AuthLinkStatement;
|
|
7
|
+
enrollments: string;
|
|
8
|
+
enrollmentCount: number;
|
|
9
|
+
nullCount: number;
|
|
10
|
+
input: DeviceClaimBindingInput;
|
|
11
|
+
coordinatorId: string;
|
|
12
|
+
now: number;
|
|
13
|
+
/** Producer only: preserve this immutable positive ownership instead of minting. */
|
|
14
|
+
existingBinding?: ExistingFirstLinkBinding;
|
|
15
|
+
completedGuard?: AuthLinkStatement;
|
|
16
|
+
/**
|
|
17
|
+
* Re-run the retained-ownership reads. They fail with the binding's own error, so a
|
|
18
|
+
* changed fact refuses the binding exactly as the old pin inside `guard` did, and they
|
|
19
|
+
* run where that pin ran: just before the binding's first write.
|
|
20
|
+
*/
|
|
21
|
+
negativeGuards: AuthLinkStatement[];
|
|
22
|
+
/** The retained facts only, checked again after the enrollment update. */
|
|
23
|
+
completedNegativeGuards: AuthLinkStatement[];
|
|
24
|
+
}
|
|
25
|
+
export declare function deviceClaimBindingGenesisSql(connections: boolean): string;
|
|
26
|
+
/** Captures server metadata only. The returned SQL must run inside the winning batch.
|
|
27
|
+
* Unlike first-link eligibility, existing own claim/link, peer bindings and grants
|
|
28
|
+
* are allowed. No attestation or negative-owner result supplies positive authority.
|
|
29
|
+
*/
|
|
30
|
+
export declare function prepareDeviceClaimBinding(backend: AuthLinkBackend, input: DeviceClaimBindingInput, config: CoordinatorAuthLinkConfig, now: number): Promise<PreparedDeviceClaimBinding | null>;
|
|
31
|
+
/** First-link producer only. Existing ownership keeps its original provenance. */
|
|
32
|
+
export declare function prepareFirstLinkDeviceClaimBinding(backend: AuthLinkBackend, input: DeviceClaimBindingInput, config: CoordinatorAuthLinkConfig, now: number): Promise<PreparedDeviceClaimBinding | null>;
|
|
33
|
+
/** Append after the producer's original strict first-link winning writes, or use
|
|
34
|
+
* the legacy service. Never execute these outside an atomic batch. The claim,
|
|
35
|
+
* genesis attempt/link/audit, and current link must already exist at execution.
|
|
36
|
+
*/
|
|
37
|
+
export declare function deviceClaimBindingStatements(plan: PreparedDeviceClaimBinding, bindingId: string, eventId: string, options?: {
|
|
38
|
+
/** Trusted SQL predicate identifying the exact finalized producer winner, with bound values. */ winning?: AuthLinkStatement;
|
|
39
|
+
}): AuthLinkStatement[];
|
|
40
|
+
//# sourceMappingURL=coordinator-device-claim-binding-sql.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-claim-binding-sql.d.ts","sourceRoot":"","sources":["../src/coordinator-device-claim-binding-sql.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAMrF,OAAO,EAEN,KAAK,uBAAuB,EAC5B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAEN,KAAK,wBAAwB,EAI7B,MAAM,6CAA6C,CAAC;AAIrD,MAAM,WAAW,0BAA0B;IAC1C,KAAK,EAAE,iBAAiB,CAAC;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,uBAAuB,CAAC;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,oFAAoF;IACpF,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC;;;;OAIG;IACH,cAAc,EAAE,iBAAiB,EAAE,CAAC;IACpC,0EAA0E;IAC1E,uBAAuB,EAAE,iBAAiB,EAAE,CAAC;CAC7C;AAwBD,wBAAgB,4BAA4B,CAAC,WAAW,EAAE,OAAO,GAAG,MAAM,CAIzE;AAsBD;;;GAGG;AACH,wBAAsB,yBAAyB,CAC9C,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAE5C;AAED,kFAAkF;AAClF,wBAAsB,kCAAkC,CACvD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,0BAA0B,GAAG,IAAI,CAAC,CAE5C;AAsJD;;;GAGG;AACH,wBAAgB,4BAA4B,CAC3C,IAAI,EAAE,0BAA0B,EAChC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE;IACR,gGAAgG,CAAC,OAAO,CAAC,EAAE,iBAAiB,CAAC;CACxH,GACJ,iBAAiB,EAAE,CA2CrB"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { AuthLinkBackend } from "./coordinator-auth-link.js";
|
|
2
|
+
import type { CoordinatorAuthLinkConfig } from "./coordinator-auth-link-contract.js";
|
|
3
|
+
import { type DeviceClaimBindingInput, type DeviceClaimBindingReadiness, type DeviceClaimBindingReceipt, type DeviceClaimBindingResult } from "./coordinator-device-claim-binding-contract.js";
|
|
4
|
+
export type { DeviceClaimBindingInput, DeviceClaimBindingReadiness, DeviceClaimBindingReceipt, DeviceClaimBindingResult, } from "./coordinator-device-claim-binding-contract.js";
|
|
5
|
+
export { isDeviceClaimBindingConflict } from "./coordinator-device-claim-binding-contract.js";
|
|
6
|
+
export { deviceClaimBindingStatements, type PreparedDeviceClaimBinding, prepareDeviceClaimBinding, prepareFirstLinkDeviceClaimBinding, } from "./coordinator-device-claim-binding-sql.js";
|
|
7
|
+
/** Producer completion/retry status, not a claim-specific binding receipt.
|
|
8
|
+
* Positive current claim genesis and the exact existing ownership row must both
|
|
9
|
+
* verify, and every own enrollment must already name the unchanged Identity.
|
|
10
|
+
*/
|
|
11
|
+
export declare function readFirstLinkDeviceClaimOwnershipComplete(backend: AuthLinkBackend, input: DeviceClaimBindingInput, config: CoordinatorAuthLinkConfig, now: number): Promise<boolean>;
|
|
12
|
+
/** Read-only immutable receipt. Enrollment changes after completion do not rewrite
|
|
13
|
+
* history. The signed boundary still authenticates the exact current key.
|
|
14
|
+
*/
|
|
15
|
+
export declare function readDeviceClaimBindingReceipt(backend: AuthLinkBackend, value: DeviceClaimBindingInput, config: CoordinatorAuthLinkConfig): Promise<DeviceClaimBindingReceipt | null>;
|
|
16
|
+
export declare function readDeviceClaimBindingReadiness(backend: AuthLinkBackend, value: DeviceClaimBindingInput, config: CoordinatorAuthLinkConfig, now: number): Promise<DeviceClaimBindingReadiness>;
|
|
17
|
+
/** Unknown outcomes propagate. Callers must read the receipt before retrying.
|
|
18
|
+
* No grants, membership, other-device or local Identity writes occur here.
|
|
19
|
+
*/
|
|
20
|
+
export declare function completeDeviceClaimBinding(backend: AuthLinkBackend, value: DeviceClaimBindingInput, config: CoordinatorAuthLinkConfig, now: number): Promise<DeviceClaimBindingResult>;
|
|
21
|
+
//# sourceMappingURL=coordinator-device-claim-binding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-claim-binding.d.ts","sourceRoot":"","sources":["../src/coordinator-device-claim-binding.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EAEN,KAAK,uBAAuB,EAC5B,KAAK,2BAA2B,EAChC,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,MAAM,gDAAgD,CAAC;AASxD,YAAY,EACX,uBAAuB,EACvB,2BAA2B,EAC3B,yBAAyB,EACzB,wBAAwB,GACxB,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,4BAA4B,EAAE,MAAM,gDAAgD,CAAC;AAC9F,OAAO,EACN,4BAA4B,EAC5B,KAAK,0BAA0B,EAC/B,yBAAyB,EACzB,kCAAkC,GAClC,MAAM,2CAA2C,CAAC;AAEnD;;;GAGG;AACH,wBAAsB,yCAAyC,CAC9D,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,OAAO,CAAC,CAKlB;AAED;;GAEG;AACH,wBAAsB,6BAA6B,CAClD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,yBAAyB,GAC/B,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CA8B3C;AAED,wBAAsB,+BAA+B,CACpD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,2BAA2B,CAAC,CAUtC;AAED;;GAEG;AACH,wBAAsB,0BAA0B,CAC/C,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,uBAAuB,EAC9B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,wBAAwB,CAAC,CAmBnC"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test-only. This file exists only to pin equivalence with the pre-port SQL.
|
|
3
|
+
*
|
|
4
|
+
* Between the markers are, copied verbatim from main at 075d46647 before ownership
|
|
5
|
+
* evidence moved to read-set guards: the evidence statements of
|
|
6
|
+
* coordinator-device-ownership-evidence-queries.ts, and the collector class of
|
|
7
|
+
* coordinator-device-ownership-evidence.ts. Only the class was renamed; its imports of
|
|
8
|
+
* those statements now resolve to the copies above it. Everything else it imports is
|
|
9
|
+
* unchanged since that commit. Do not edit the copy to follow later changes; delete this
|
|
10
|
+
* file with coordinator-device-ownership-evidence-equivalence.test.ts.
|
|
11
|
+
*/
|
|
12
|
+
import { type ControllerHistorySnapshot } from "./coordinator-auth-controller-history.js";
|
|
13
|
+
import type { AuthLinkStatement } from "./coordinator-auth-link.js";
|
|
14
|
+
import { type OwnershipDecision } from "./coordinator-device-ownership-evidence-classify.js";
|
|
15
|
+
import { type ReviewedWeakLabel } from "./coordinator-legacy-owner-resolution-metadata.js";
|
|
16
|
+
export declare const ROW_LIMIT = 500;
|
|
17
|
+
export declare const BYTE_LIMIT = 750000;
|
|
18
|
+
export interface EvidenceQuery {
|
|
19
|
+
name: string;
|
|
20
|
+
sql: string;
|
|
21
|
+
}
|
|
22
|
+
export declare const CONTROLLER_COLUMNS: string[];
|
|
23
|
+
export declare const RESOLUTION_COLUMNS: string[];
|
|
24
|
+
export declare const EVIDENCE_QUERIES: EvidenceQuery[];
|
|
25
|
+
export declare function readEvidenceQuery(query: EvidenceQuery, encoded: string): AuthLinkStatement;
|
|
26
|
+
export interface CapturedEvidenceRow {
|
|
27
|
+
category: string;
|
|
28
|
+
row_count: number;
|
|
29
|
+
row: string | null;
|
|
30
|
+
}
|
|
31
|
+
export declare function readCombinedEvidenceQuery(encoded: string): AuthLinkStatement;
|
|
32
|
+
export declare function atomicEvidenceQuery(encoded: string): AuthLinkStatement;
|
|
33
|
+
interface EvidenceBackend {
|
|
34
|
+
first<T>(statement: AuthLinkStatement): Promise<T | null>;
|
|
35
|
+
all<T>(statement: AuthLinkStatement): Promise<T[]>;
|
|
36
|
+
}
|
|
37
|
+
interface ActualSigner {
|
|
38
|
+
groupId: string;
|
|
39
|
+
deviceId: string;
|
|
40
|
+
publicKey: string;
|
|
41
|
+
fingerprint: string;
|
|
42
|
+
}
|
|
43
|
+
interface CollectionInput {
|
|
44
|
+
canonicalOwnerId: string;
|
|
45
|
+
actualSigner: ActualSigner;
|
|
46
|
+
verifiedHistory: ControllerHistorySnapshot;
|
|
47
|
+
}
|
|
48
|
+
interface RecheckSnapshot {
|
|
49
|
+
readonly version: 1;
|
|
50
|
+
}
|
|
51
|
+
type OwnershipCollection = {
|
|
52
|
+
kind: "collected";
|
|
53
|
+
decision: OwnershipDecision;
|
|
54
|
+
weakLabels: ReviewedWeakLabel[];
|
|
55
|
+
recheckSnapshot: RecheckSnapshot;
|
|
56
|
+
} | {
|
|
57
|
+
kind: "unavailable";
|
|
58
|
+
authorizationUnavailable: true;
|
|
59
|
+
};
|
|
60
|
+
type SourceVerification = {
|
|
61
|
+
kind: "verified_controller_source" | "source_missing" | "source_revoked" | "source_mismatch";
|
|
62
|
+
} | {
|
|
63
|
+
kind: "unavailable";
|
|
64
|
+
authorizationUnavailable: true;
|
|
65
|
+
};
|
|
66
|
+
/** Internal read-only metadata collector. No result of this class grants access. */
|
|
67
|
+
export declare class OriginalDeviceOwnershipEvidence {
|
|
68
|
+
private readonly backend;
|
|
69
|
+
private readonly snapshots;
|
|
70
|
+
private readonly coordinatorId;
|
|
71
|
+
constructor(backend: EvidenceBackend, config: {
|
|
72
|
+
coordinatorId: string;
|
|
73
|
+
});
|
|
74
|
+
collect(input: CollectionInput): Promise<OwnershipCollection>;
|
|
75
|
+
private verifyHistory;
|
|
76
|
+
private captureRows;
|
|
77
|
+
/** A predicate for a future checked batch, never an admission or a write. */
|
|
78
|
+
prepareAtomicRecheck(snapshot: RecheckSnapshot): AuthLinkStatement;
|
|
79
|
+
/** Private confirmation metadata; only this reader's original capture is accepted. */
|
|
80
|
+
reviewedEvidenceDigest(snapshot: unknown): Promise<string | null>;
|
|
81
|
+
verifyControllerSource(input: {
|
|
82
|
+
sourceRef: unknown;
|
|
83
|
+
expectedOwnerId: string;
|
|
84
|
+
actualSigner: ActualSigner;
|
|
85
|
+
}): Promise<SourceVerification>;
|
|
86
|
+
}
|
|
87
|
+
export {};
|
|
88
|
+
//# sourceMappingURL=coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-ownership-evidence-original-sql-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-original-sql-test-fixtures.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAEN,KAAK,yBAAyB,EAI9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EASN,KAAK,iBAAiB,EACtB,MAAM,qDAAqD,CAAC;AAE7D,OAAO,EAGN,KAAK,iBAAiB,EAEtB,MAAM,mDAAmD,CAAC;AAE3D,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,UAAU,SAAU,CAAC;AAClC,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;CACZ;AAID,eAAO,MAAM,kBAAkB,UAA+B,CAAC;AAC/D,eAAO,MAAM,kBAAkB,UAG7B,CAAC;AAqCH,eAAO,MAAM,gBAAgB,EAAE,aAAa,EA2D3C,CAAC;AAOF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAM1F;AAED,MAAM,WAAW,mBAAmB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;CACnB;AAID,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CA6B5E;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,CAiBtE;AAED,UAAU,eAAe;IACxB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,G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G,iBAAiB,CAIjE;IAED,sFAAsF;IAChF,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGtE;IAEK,sBAAsB,CAAC,KAAK,EAAE;QACnC,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,YAAY,CAAC;KAC3B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2C9B;CACD"}
|
|
@@ -1,19 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Limits and column lists of the ownership evidence categories. The reads themselves are
|
|
3
|
+
* in coordinator-owner-negative-reads.ts.
|
|
4
|
+
*/
|
|
2
5
|
export declare const ROW_LIMIT = 500;
|
|
3
6
|
export declare const BYTE_LIMIT = 750000;
|
|
4
|
-
export interface EvidenceQuery {
|
|
5
|
-
name: string;
|
|
6
|
-
sql: string;
|
|
7
|
-
}
|
|
8
7
|
export declare const CONTROLLER_COLUMNS: string[];
|
|
9
8
|
export declare const RESOLUTION_COLUMNS: string[];
|
|
10
|
-
export declare const EVIDENCE_QUERIES: EvidenceQuery[];
|
|
11
|
-
export declare function readEvidenceQuery(query: EvidenceQuery, encoded: string): AuthLinkStatement;
|
|
12
|
-
export interface CapturedEvidenceRow {
|
|
13
|
-
category: string;
|
|
14
|
-
row_count: number;
|
|
15
|
-
row: string | null;
|
|
16
|
-
}
|
|
17
|
-
export declare function readCombinedEvidenceQuery(encoded: string): AuthLinkStatement;
|
|
18
|
-
export declare function atomicEvidenceQuery(encoded: string): AuthLinkStatement;
|
|
19
9
|
//# sourceMappingURL=coordinator-device-ownership-evidence-queries.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-ownership-evidence-queries.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-queries.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coordinator-device-ownership-evidence-queries.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-queries.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,SAAS,MAAM,CAAC;AAC7B,eAAO,MAAM,UAAU,SAAU,CAAC;AAIlC,eAAO,MAAM,kBAAkB,UAA+B,CAAC;AAC/D,eAAO,MAAM,kBAAkB,UAG7B,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { AuthLinkStatement } from "./coordinator-auth-link.js";
|
|
2
2
|
import { cfg } from "./coordinator-auth-link-test-fixtures.js";
|
|
3
|
+
import { type AtomicReader } from "./coordinator-auth-read-set.js";
|
|
3
4
|
import { type Backend, type Fixture } from "./coordinator-auth-store-test-fixtures.js";
|
|
4
5
|
import { EXPECTED_KEY_ID } from "./coordinator-ed25519-key-id-test-fixtures.js";
|
|
5
6
|
export { cfg, EXPECTED_KEY_ID };
|
|
@@ -16,6 +17,8 @@ export declare function insert(f: Fixture, table: string, row: Row): void;
|
|
|
16
17
|
export declare function evidenceBackend(f: Fixture, backend: Backend): {
|
|
17
18
|
first<T>(statement: AuthLinkStatement): Promise<T | null>;
|
|
18
19
|
all<T>(statement: AuthLinkStatement): Promise<T[]>;
|
|
20
|
+
/** Both stores' backends read a set of statements together, as one snapshot. */
|
|
21
|
+
readBatch<T>(statements: AuthLinkStatement[]): Promise<T[][]>;
|
|
19
22
|
};
|
|
20
23
|
export declare function evidenceTest(backend: Backend): import("vitest").TestAPI<{
|
|
21
24
|
f: Fixture;
|
|
@@ -77,4 +80,11 @@ export declare function sourceRef(row: ReturnType<typeof controller>): {
|
|
|
77
80
|
reviewed_weak_labels_json: string;
|
|
78
81
|
created_at: string;
|
|
79
82
|
};
|
|
83
|
+
/**
|
|
84
|
+
* Runs a capture's recheck guards together and reports them as the old atomic recheck
|
|
85
|
+
* did: 1 while every read still holds, 0 once one changed or for an unknown capture.
|
|
86
|
+
*/
|
|
87
|
+
export declare function recheckMatches(db: AtomicReader, guards: AuthLinkStatement[] | null): Promise<{
|
|
88
|
+
matches: 0 | 1;
|
|
89
|
+
}>;
|
|
80
90
|
//# sourceMappingURL=coordinator-device-ownership-evidence-test-fixtures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-ownership-evidence-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,GAAG,EAAO,MAAM,0CAA0C,CAAC;AACpE,OAAO,EACN,KAAK,OAAO,EAEZ,KAAK,OAAO,EAIZ,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAEN,eAAe,EACf,MAAM,+CAA+C,CAAC;AAQvD,OAAO,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC;AAChC,eAAO,MAAM,SAAS,6BAA6B,CAAC;AACpD,eAAO,MAAM,MAAM;;;;;CAKlB,CAAC;AACF,eAAO,MAAM,QAAQ,qFAC8D,CAAC;AACpF,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAAC;AACzD,wBAAgB,MAAM,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,QAOzD;AAED,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO;IAGpD,KAAK,CAAC,CAAC,aAAa,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IASzD,GAAG,CAAC,CAAC,aAAa,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"coordinator-device-ownership-evidence-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBA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YlD;AACD,wBAAgB,KAAK,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,GAAQ,QAgBhD;AACD,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,GAAE,GAAQ,QAoBrD;AACD,wBAAgB,OAAO,CACtB,CAAC,EAAE,OAAO,EACV,KAAK,GAAE;IACN,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,UAAU,GAAG,UAAU,CAAC;CAC9B,QAyCN;AACD,wBAAsB,YAAY,CAAC,CAAC,EAAE,OAAO;;;;;;;;;GAS5C;AAID,wBAAgB,SAAS,CAAC,GAAG,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;EAuB3D;AAED;;;GAGG;AACH,wBAAsB,cAAc,CACnC,EAAE,EAAE,YAAY,EAChB,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAI,GAChC,OAAO,CAAC;IAAE,OAAO,EAAE,CAAC,GAAG,CAAC,CAAA;CAAE,CAAC,CAE7B"}
|
|
@@ -5,6 +5,11 @@ import { type ReviewedWeakLabel } from "./coordinator-legacy-owner-resolution-me
|
|
|
5
5
|
interface EvidenceBackend {
|
|
6
6
|
first<T>(statement: AuthLinkStatement): Promise<T | null>;
|
|
7
7
|
all<T>(statement: AuthLinkStatement): Promise<T[]>;
|
|
8
|
+
/**
|
|
9
|
+
* Runs reads together, so a capture and each recheck are one snapshot. Required: a
|
|
10
|
+
* one-at-a-time fallback would check the guards at different moments.
|
|
11
|
+
*/
|
|
12
|
+
readBatch<T>(statements: AuthLinkStatement[]): Promise<T[][]>;
|
|
8
13
|
}
|
|
9
14
|
interface ActualSigner {
|
|
10
15
|
groupId: string;
|
|
@@ -45,9 +50,12 @@ export declare class CoordinatorDeviceOwnershipEvidence {
|
|
|
45
50
|
});
|
|
46
51
|
collect(input: CollectionInput): Promise<OwnershipCollection>;
|
|
47
52
|
private verifyHistory;
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
53
|
+
/**
|
|
54
|
+
* Guards that re-run every read of this capture, for a later checked batch: each aborts
|
|
55
|
+
* it once its read changed. Never an admission or a write. Null for a snapshot this
|
|
56
|
+
* reader did not capture, which therefore never matches.
|
|
57
|
+
*/
|
|
58
|
+
recheckGuards(snapshot: RecheckSnapshot): AuthLinkStatement[] | null;
|
|
51
59
|
/** Private confirmation metadata; only this reader's original capture is accepted. */
|
|
52
60
|
reviewedEvidenceDigest(snapshot: unknown): Promise<string | null>;
|
|
53
61
|
verifyControllerSource(input: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-ownership-evidence.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,yBAAyB,
|
|
1
|
+
{"version":3,"file":"coordinator-device-ownership-evidence.d.ts","sourceRoot":"","sources":["../src/coordinator-device-ownership-evidence.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,yBAAyB,EAG9B,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAEpE,OAAO,EAQN,KAAK,iBAAiB,EACtB,MAAM,qDAAqD,CAAC;AAG7D,OAAO,EAGN,KAAK,iBAAiB,EAEtB,MAAM,mDAAmD,CAAC;AAG3D,UAAU,eAAe;IACxB,KAAK,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC1D,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACnD;;;OAGG;IACH,SAAS,CAAC,CAAC,EAAE,UAAU,EAAE,iBAAiB,EAAE,GAAG,OAAO,CAAC,CAAC,E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IAED,sFAAsF;IAChF,sBAAsB,CAAC,QAAQ,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAGtE;IAEK,sBAAsB,CAAC,KAAK,EAAE;QACnC,SAAS,EAAE,OAAO,CAAC;QACnB,eAAe,EAAE,MAAM,CAAC;QACxB,YAAY,EAAE,YAAY,CAAC;KAC3B,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA2C9B;CACD"}
|
|
@@ -99,7 +99,8 @@ export interface DeviceRebindDependencies extends DeviceRebindDeviceDependencies
|
|
|
99
99
|
/**
|
|
100
100
|
* The browser and device ceremony for ADR 0005 Section 8 rebinding. Every
|
|
101
101
|
* step re-checks live authority in its winning statement; pre-reads only pick
|
|
102
|
-
* the refusal reason shown to the person.
|
|
102
|
+
* the refusal reason shown to the person. The pinned self-bind authority is
|
|
103
|
+
* read and decided before the write, and guards in the same batch re-run its reads.
|
|
103
104
|
*/
|
|
104
105
|
export declare function createDeviceRebindCeremony(deps: DeviceRebindDependencies): Readonly<{
|
|
105
106
|
claimBrowser: (request: Request, clientKey: string) => Promise<DeviceRebindResult | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-rebind-ceremony.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-ceremony.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coordinator-device-rebind-ceremony.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-ceremony.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAOvG,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAiBrF,OAAO,EACN,KAAK,cAAc,EAGnB,MAAM,+BAA+B,CAAC;AAIvC,OAAO,EAGN,KAAK,mBAAmB,EAGxB,MAAM,uCAAuC,CAAC;AAW/C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;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AAI,CAAC,qBAAqB,EAAE,4BAA4B,GAAG,gBAAgB,CAAC,CAAC;CACrF;AAkKD;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,wBAAwB;2DAf7C,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;8BAoBlC,OAAO;0EApBP,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;4DAAlC,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;;mBAyjBjD,MAAM;gBACT,kBAAkB;0BACR,MAAM;mBACb,MAAM;UA5jBS,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;;mBAyoBJ,MAAM;gBAAU,kBAAkB;UAzoBhE,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;GAuB7D;AAED,6EAA6E;AAC7E,wBAAgB,6BAA6B,CAAC,IAAI,EAAE,8BAA8B;4DA1BtD,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;;mBAyjBjD,MAAM;gBACT,kBAAkB;0BACR,MAAM;mBACb,MAAM;UA5jBS,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;;mBAyoBJ,MAAM;gBAAU,kBAAkB;UAzoBhE,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;GA4B7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-rebind-commit.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-commit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;
|
|
1
|
+
{"version":3,"file":"coordinator-device-rebind-commit.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-commit.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAqB,MAAM,4BAA4B,CAAC;AAmBrF,0FAA0F;AAC1F,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAG3C,MAAM,MAAM,mBAAmB,GAAG;IACjC,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GACjC;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GACnD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,OAAO,EAAE,mBAAmB,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,SAAS,CAAA;CAAE,CAAC;AAuFvB;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,03BAWF,CAAC;AAuP5B;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,eAAe,EACxB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,MAAM,GACf,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAyBrC;AAED,UAAU,uBAAuB;IAChC,OAAO,EAAE,eAAe,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;GAOG;AACH,wBAAsB,kBAAkB,CACvC,KAAK,EAAE,uBAAuB,GAC5B,OAAO,CAAC,wBAAwB,CAAC,CAkCnC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-rebind-proof.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-proof.ts"],"names":[],"mappings":"AAOA,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IACnC,c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ose current
|
|
4
4
|
* Identity has no account link of its own moves to the Identity linked to the
|
|
5
5
|
* Google account it signs in with. A self-bind keeps the device's Identity
|
|
6
|
-
* (target = current)
|
|
6
|
+
* (target = current). Controller-only connections pin their server authority at
|
|
7
|
+
* start before fresh OIDC and browser consent. Both tables are additive. They never change
|
|
7
8
|
* the owner-enrollment tables, whose schema readiness checks compare exact DDL.
|
|
8
9
|
*
|
|
9
10
|
* Mirror: packages/cloudflare-coordinator-worker/migrations/0038_add_device_rebind.sql
|
|
10
11
|
*/
|
|
11
|
-
export declare const COORDINATOR_DEVICE_REBIND_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_device_rebind_attempts (\n coordinator_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n origin TEXT NOT NULL,\n device_id TEXT NOT NULL,\n public_key TEXT NOT NULL,\n key_id TEXT NOT NULL CHECK (length(key_id) = 64 AND key_id NOT GLOB '*[^0-9a-f]*'),\n fingerprint TEXT NOT NULL,\n current_identity_id TEXT NOT NULL CHECK (length(current_identity_id) BETWEEN 1 AND 256),\n issuer TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL,\n loopback_redirect TEXT,\n browser_start_hash TEXT NOT NULL UNIQUE,\n browser_transaction_hash TEXT UNIQUE,\n browser_binder_hash TEXT,\n account_subject TEXT,\n target_identity_id TEXT,\n link_id TEXT,\n link_authority_kind TEXT CHECK (link_authority_kind IS NULL\n OR link_authority_kind IN ('controller_attestation', 'device_claim')),\n review_digest TEXT CHECK (review_digest IS NULL\n OR (length(review_digest) = 64 AND review_digest NOT GLOB '*[^0-9a-f]*')),\n team_effects_json TEXT CHECK (team_effects_json IS NULL OR json_valid(team_effects_json)),\n enrollment_count INTEGER CHECK (enrollment_count IS NULL OR enrollment_count BETWEEN 1 AND 50),\n confirmation_hash TEXT,\n completion_secret_hash TEXT UNIQUE,\n final_key_proof_hash TEXT,\n state TEXT NOT NULL CHECK (state IN\n ('pending', 'browser_claimed', 'oidc_verified', 'confirmed', 'finalized', 'expired', 'failed')),\n created_at_ms INTEGER NOT NULL,\n expires_at_ms INTEGER NOT NULL CHECK (expires_at_ms = created_at_ms + 600000),\n finalized_at_ms INTEGER,\n binding_id TEXT UNIQUE,\n audit_event_id TEXT UNIQUE,\n final_outcome_json TEXT CHECK (final_outcome_json IS NULL OR json_valid(final_outcome_json)),\n PRIMARY KEY (coordinator_id, attempt_id),\n CHECK (state NOT IN ('confirmed', 'finalized') OR (account_subject IS NOT NULL\n AND target_identity_id IS NOT NULL AND link_id IS NOT NULL AND link_authority_kind IS NOT NULL\n AND review_digest IS NOT NULL AND team_effects_json IS NOT NULL AND enrollment_count IS NOT NULL\n AND confirmation_hash IS NOT NULL AND completion_secret_hash IS NOT NULL)),\n CHECK (state <> 'finalized' OR (finalized_at_ms IS NOT NULL AND binding_id IS NOT NULL\n AND audit_event_id IS NOT NULL AND final_key_proof_hash IS NOT NULL\n AND final_outcome_json IS NOT NULL AND loopback_redirect IS NULL)),\n CHECK (state = 'finalized' OR (finalized_at_ms IS NULL AND binding_id IS NULL\n AND audit_event_id IS NULL AND final_key_proof_hash IS NULL AND final_outcome_json IS NULL)),\n CHECK (state NOT IN ('pending', 'browser_claimed', 'oidc_verified')\n OR (confirmation_hash IS NULL AND completion_secret_hash IS NULL)),\n CHECK (state NOT IN ('pending', 'browser_claimed') OR (account_subject IS NULL\n AND target_identity_id IS NULL AND link_id IS NULL AND link_authority_kind IS NULL\n AND team_effects_json IS NULL AND enrollment_count IS NULL)),\n CHECK (review_digest IS NOT NULL),\n CHECK (state <> 'pending' OR (browser_transaction_hash IS NULL AND browser_binder_hash IS NULL))\n);\n\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_rebind_attempts_device\n ON coordinator_device_rebind_attempts (coordinator_id, device_id, state);\n\n-- Birth facts never change; proofs are set once; only forward transitions are allowed.\n-- The EXISTS clause stops UPDATE OR REPLACE from deleting another row through a unique key.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_pins\nBEFORE UPDATE ON coordinator_device_rebind_attempts\nWHEN OLD.state IN ('finalized', 'expired', 'failed') OR NEW.rowid IS NOT OLD.rowid\n OR EXISTS (SELECT 1 FROM coordinator_device_rebind_attempts o\n WHERE NOT (o.coordinator_id = OLD.coordinator_id AND o.attempt_id = OLD.attempt_id)\n AND (o.browser_transaction_hash = NEW.browser_transaction_hash\n OR o.completion_secret_hash = NEW.completion_secret_hash\n OR o.binding_id = NEW.binding_id OR o.audit_event_id = NEW.audit_event_id))\n OR NEW.coordinator_id IS NOT OLD.coordinator_id OR NEW.attempt_id IS NOT OLD.attempt_id\n OR NEW.origin IS NOT OLD.origin OR NEW.device_id IS NOT OLD.device_id\n OR NEW.public_key IS NOT OLD.public_key OR NEW.key_id IS NOT OLD.key_id\n OR NEW.fingerprint IS NOT OLD.fingerprint OR NEW.current_identity_id IS NOT OLD.current_identity_id\n OR NEW.issuer IS NOT OLD.issuer OR NEW.auth_config_revision IS NOT OLD.auth_config_revision\n OR NEW.browser_start_hash IS NOT OLD.browser_start_hash\n OR NEW.created_at_ms IS NOT OLD.created_at_ms OR NEW.expires_at_ms IS NOT OLD.expires_at_ms\n OR (OLD.browser_transaction_hash IS NOT NULL AND NEW.browser_transaction_hash IS NOT OLD.browser_transaction_hash)\n OR (OLD.browser_binder_hash IS NOT NULL AND NEW.browser_binder_hash IS NOT OLD.browser_binder_hash)\n OR (OLD.account_subject IS NOT NULL AND NEW.account_subject IS NOT OLD.account_subject)\n OR (OLD.target_identity_id IS NOT NULL AND NEW.target_identity_id IS NOT OLD.target_identity_id)\n OR (OLD.link_id IS NOT NULL AND NEW.link_id IS NOT OLD.link_id)\n OR (OLD.review_digest IS NOT NULL AND NEW.review_digest IS NOT OLD.review_digest)\n OR (OLD.team_effects_json IS NOT NULL AND NEW.team_effects_json IS NOT OLD.team_effects_json)\n OR (OLD.enrollment_count IS NOT NULL AND NEW.enrollment_count IS NOT OLD.enrollment_count)\n OR (OLD.confirmation_hash IS NOT NULL AND NEW.confirmation_hash IS NOT OLD.confirmation_hash)\n OR (OLD.completion_secret_hash IS NOT NULL AND NEW.completion_secret_hash IS NOT OLD.completion_secret_hash)\n OR (NEW.loopback_redirect IS NOT OLD.loopback_redirect\n AND NOT (NEW.loopback_redirect IS NULL AND NEW.state IN ('finalized', 'expired', 'failed')))\n OR NOT ((OLD.state = NEW.state)\n OR (OLD.state = 'pending' AND NEW.state IN ('browser_claimed', 'expired', 'failed'))\n OR (OLD.state = 'browser_claimed' AND NEW.state IN ('oidc_verified', 'expired', 'failed'))\n OR (OLD.state = 'oidc_verified' AND NEW.state IN ('confirmed', 'expired', 'failed'))\n OR (OLD.state = 'confirmed' AND NEW.state IN ('finalized', 'expired', 'failed')))\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_immutable');\nEND;\n\n-- REPLACE's implicit deletes may skip DELETE triggers when recursive triggers are off.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_insert_collision\nBEFORE INSERT ON coordinator_device_rebind_attempts\nWHEN EXISTS (SELECT 1 FROM coordinator_device_rebind_attempts\n WHERE rowid = NEW.rowid OR (coordinator_id = NEW.coordinator_id AND attempt_id = NEW.attempt_id)\n OR browser_start_hash = NEW.browser_start_hash\n OR browser_transaction_hash = NEW.browser_transaction_hash\n OR completion_secret_hash = NEW.completion_secret_hash\n OR binding_id = NEW.binding_id OR audit_event_id = NEW.audit_event_id)\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_collision');\nEND;\n\n-- An automatic rowid reads as -1 before insert; positive rowids keep that from matching a row.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_rowid\nAFTER INSERT ON coordinator_device_rebind_attempts\nWHEN NEW.rowid < 1\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_rowid');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_retained\nBEFORE DELETE ON coordinator_device_rebind_attempts\nWHEN OLD.state = 'finalized'\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_immutable');\nEND;\n\nCREATE TABLE IF NOT EXISTS coordinator_device_rebind_audit_log (\n coordinator_id TEXT NOT NULL,\n event_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n action TEXT NOT NULL CHECK (action = 'owner_device_rebound'),\n binding_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n previous_identity_id TEXT NOT NULL,\n target_identity_id TEXT NOT NULL,\n enrollment_count INTEGER NOT NULL CHECK (enrollment_count BETWEEN 1 AND 50),\n created_at_ms INTEGER NOT NULL,\n PRIMARY KEY (coordinator_id, event_id),\n UNIQUE (coordinator_id, attempt_id)\n);\n\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_rebind_audit_target\n ON coordinator_device_rebind_audit_log (coordinator_id, target_identity_id, created_at_ms);\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_insert_collision\nBEFORE INSERT ON coordinator_device_rebind_audit_log\nWHEN EXISTS (SELECT 1 FROM coordinator_device_rebind_audit_log\n WHERE rowid = NEW.rowid\n OR (coordinator_id = NEW.coordinator_id AND (event_id = NEW.event_id OR attempt_id = NEW.attempt_id)))\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_collision');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_rowid\nAFTER INSERT ON coordinator_device_rebind_audit_log\nWHEN NEW.rowid < 1\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_rowid');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_immutable_update\nBEFORE UPDATE ON coordinator_device_rebind_audit_log\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_immutable');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_immutable_delete\nBEFORE DELETE ON coordinator_device_rebind_audit_log\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_immutable');\nEND;\n";
|
|
12
|
+
export declare const COORDINATOR_DEVICE_REBIND_SCHEMA_SQL = "\nCREATE TABLE IF NOT EXISTS coordinator_device_rebind_attempts (\n coordinator_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n origin TEXT NOT NULL,\n device_id TEXT NOT NULL,\n public_key TEXT NOT NULL,\n key_id TEXT NOT NULL CHECK (length(key_id) = 64 AND key_id NOT GLOB '*[^0-9a-f]*'),\n fingerprint TEXT NOT NULL,\n current_identity_id TEXT NOT NULL CHECK (length(current_identity_id) BETWEEN 1 AND 256),\n issuer TEXT NOT NULL,\n auth_config_revision TEXT NOT NULL,\n loopback_redirect TEXT,\n browser_start_hash TEXT NOT NULL UNIQUE,\n browser_transaction_hash TEXT UNIQUE,\n browser_binder_hash TEXT,\n account_subject TEXT,\n target_identity_id TEXT,\n link_id TEXT,\n link_authority_kind TEXT CHECK (link_authority_kind IS NULL\n OR link_authority_kind IN ('controller_attestation', 'device_claim')),\n review_digest TEXT CHECK (review_digest IS NULL\n OR (length(review_digest) = 64 AND review_digest NOT GLOB '*[^0-9a-f]*')),\n team_effects_json TEXT CHECK (team_effects_json IS NULL OR json_valid(team_effects_json)),\n enrollment_count INTEGER CHECK (enrollment_count IS NULL OR enrollment_count BETWEEN 1 AND 50),\n confirmation_hash TEXT,\n completion_secret_hash TEXT UNIQUE,\n final_key_proof_hash TEXT,\n state TEXT NOT NULL CHECK (state IN\n ('pending', 'browser_claimed', 'oidc_verified', 'confirmed', 'finalized', 'expired', 'failed')),\n created_at_ms INTEGER NOT NULL,\n expires_at_ms INTEGER NOT NULL CHECK (expires_at_ms = created_at_ms + 600000),\n finalized_at_ms INTEGER,\n binding_id TEXT UNIQUE,\n audit_event_id TEXT UNIQUE,\n final_outcome_json TEXT CHECK (final_outcome_json IS NULL OR json_valid(final_outcome_json)),\n start_authority_json TEXT CHECK (start_authority_json IS NULL OR json_valid(start_authority_json)),\n PRIMARY KEY (coordinator_id, attempt_id),\n CHECK (state NOT IN ('confirmed', 'finalized') OR (account_subject IS NOT NULL\n AND target_identity_id IS NOT NULL AND link_id IS NOT NULL AND link_authority_kind IS NOT NULL\n AND review_digest IS NOT NULL AND team_effects_json IS NOT NULL AND enrollment_count IS NOT NULL\n AND confirmation_hash IS NOT NULL AND completion_secret_hash IS NOT NULL)),\n CHECK (state <> 'finalized' OR (finalized_at_ms IS NOT NULL AND binding_id IS NOT NULL\n AND audit_event_id IS NOT NULL AND final_key_proof_hash IS NOT NULL\n AND final_outcome_json IS NOT NULL AND loopback_redirect IS NULL)),\n CHECK (state = 'finalized' OR (finalized_at_ms IS NULL AND binding_id IS NULL\n AND audit_event_id IS NULL AND final_key_proof_hash IS NULL AND final_outcome_json IS NULL)),\n CHECK (state NOT IN ('pending', 'browser_claimed', 'oidc_verified')\n OR (confirmation_hash IS NULL AND completion_secret_hash IS NULL)),\n CHECK (state NOT IN ('pending', 'browser_claimed') OR (account_subject IS NULL\n AND target_identity_id IS NULL AND link_id IS NULL AND link_authority_kind IS NULL\n AND team_effects_json IS NULL AND enrollment_count IS NULL)),\n CHECK (review_digest IS NOT NULL),\n CHECK (state <> 'pending' OR (browser_transaction_hash IS NULL AND browser_binder_hash IS NULL))\n);\n\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_rebind_attempts_device\n ON coordinator_device_rebind_attempts (coordinator_id, device_id, state);\n\n-- Birth facts never change; proofs are set once; only forward transitions are allowed.\n-- The EXISTS clause stops UPDATE OR REPLACE from deleting another row through a unique key.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_pins\nBEFORE UPDATE ON coordinator_device_rebind_attempts\nWHEN OLD.state IN ('finalized', 'expired', 'failed') OR NEW.rowid IS NOT OLD.rowid\n OR EXISTS (SELECT 1 FROM coordinator_device_rebind_attempts o\n WHERE NOT (o.coordinator_id = OLD.coordinator_id AND o.attempt_id = OLD.attempt_id)\n AND (o.browser_transaction_hash = NEW.browser_transaction_hash\n OR o.completion_secret_hash = NEW.completion_secret_hash\n OR o.binding_id = NEW.binding_id OR o.audit_event_id = NEW.audit_event_id))\n OR NEW.coordinator_id IS NOT OLD.coordinator_id OR NEW.attempt_id IS NOT OLD.attempt_id\n OR NEW.origin IS NOT OLD.origin OR NEW.device_id IS NOT OLD.device_id\n OR NEW.public_key IS NOT OLD.public_key OR NEW.key_id IS NOT OLD.key_id\n OR NEW.fingerprint IS NOT OLD.fingerprint OR NEW.current_identity_id IS NOT OLD.current_identity_id\n OR NEW.issuer IS NOT OLD.issuer OR NEW.auth_config_revision IS NOT OLD.auth_config_revision\n OR NEW.browser_start_hash IS NOT OLD.browser_start_hash\n OR NEW.start_authority_json IS NOT OLD.start_authority_json\n OR NEW.created_at_ms IS NOT OLD.created_at_ms OR NEW.expires_at_ms IS NOT OLD.expires_at_ms\n OR (OLD.browser_transaction_hash IS NOT NULL AND NEW.browser_transaction_hash IS NOT OLD.browser_transaction_hash)\n OR (OLD.browser_binder_hash IS NOT NULL AND NEW.browser_binder_hash IS NOT OLD.browser_binder_hash)\n OR (OLD.account_subject IS NOT NULL AND NEW.account_subject IS NOT OLD.account_subject)\n OR (OLD.target_identity_id IS NOT NULL AND NEW.target_identity_id IS NOT OLD.target_identity_id)\n OR (OLD.link_id IS NOT NULL AND NEW.link_id IS NOT OLD.link_id)\n OR (OLD.review_digest IS NOT NULL AND NEW.review_digest IS NOT OLD.review_digest)\n OR (OLD.team_effects_json IS NOT NULL AND NEW.team_effects_json IS NOT OLD.team_effects_json)\n OR (OLD.enrollment_count IS NOT NULL AND NEW.enrollment_count IS NOT OLD.enrollment_count)\n OR (OLD.confirmation_hash IS NOT NULL AND NEW.confirmation_hash IS NOT OLD.confirmation_hash)\n OR (OLD.completion_secret_hash IS NOT NULL AND NEW.completion_secret_hash IS NOT OLD.completion_secret_hash)\n OR (NEW.loopback_redirect IS NOT OLD.loopback_redirect\n AND NOT (NEW.loopback_redirect IS NULL AND NEW.state IN ('finalized', 'expired', 'failed')))\n OR NOT ((OLD.state = NEW.state)\n OR (OLD.state = 'pending' AND NEW.state IN ('browser_claimed', 'expired', 'failed'))\n OR (OLD.state = 'browser_claimed' AND NEW.state IN ('oidc_verified', 'expired', 'failed'))\n OR (OLD.state = 'oidc_verified' AND NEW.state IN ('confirmed', 'expired', 'failed'))\n OR (OLD.state = 'confirmed' AND NEW.state IN ('finalized', 'expired', 'failed')))\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_immutable');\nEND;\n\n-- REPLACE's implicit deletes may skip DELETE triggers when recursive triggers are off.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_insert_collision\nBEFORE INSERT ON coordinator_device_rebind_attempts\nWHEN EXISTS (SELECT 1 FROM coordinator_device_rebind_attempts\n WHERE rowid = NEW.rowid OR (coordinator_id = NEW.coordinator_id AND attempt_id = NEW.attempt_id)\n OR browser_start_hash = NEW.browser_start_hash\n OR browser_transaction_hash = NEW.browser_transaction_hash\n OR completion_secret_hash = NEW.completion_secret_hash\n OR binding_id = NEW.binding_id OR audit_event_id = NEW.audit_event_id)\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_collision');\nEND;\n\n-- An automatic rowid reads as -1 before insert; positive rowids keep that from matching a row.\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_rowid\nAFTER INSERT ON coordinator_device_rebind_attempts\nWHEN NEW.rowid < 1\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_rowid');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_attempt_retained\nBEFORE DELETE ON coordinator_device_rebind_attempts\nWHEN OLD.state = 'finalized'\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_attempt_immutable');\nEND;\n\nCREATE TABLE IF NOT EXISTS coordinator_device_rebind_audit_log (\n coordinator_id TEXT NOT NULL,\n event_id TEXT NOT NULL,\n attempt_id TEXT NOT NULL,\n action TEXT NOT NULL CHECK (action = 'owner_device_rebound'),\n binding_id TEXT NOT NULL,\n device_id TEXT NOT NULL,\n previous_identity_id TEXT NOT NULL,\n target_identity_id TEXT NOT NULL,\n enrollment_count INTEGER NOT NULL CHECK (enrollment_count BETWEEN 1 AND 50),\n created_at_ms INTEGER NOT NULL,\n PRIMARY KEY (coordinator_id, event_id),\n UNIQUE (coordinator_id, attempt_id)\n);\n\nCREATE INDEX IF NOT EXISTS idx_coordinator_device_rebind_audit_target\n ON coordinator_device_rebind_audit_log (coordinator_id, target_identity_id, created_at_ms);\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_insert_collision\nBEFORE INSERT ON coordinator_device_rebind_audit_log\nWHEN EXISTS (SELECT 1 FROM coordinator_device_rebind_audit_log\n WHERE rowid = NEW.rowid\n OR (coordinator_id = NEW.coordinator_id AND (event_id = NEW.event_id OR attempt_id = NEW.attempt_id)))\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_collision');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_rowid\nAFTER INSERT ON coordinator_device_rebind_audit_log\nWHEN NEW.rowid < 1\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_rowid');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_immutable_update\nBEFORE UPDATE ON coordinator_device_rebind_audit_log\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_immutable');\nEND;\n\nCREATE TRIGGER IF NOT EXISTS coordinator_device_rebind_audit_immutable_delete\nBEFORE DELETE ON coordinator_device_rebind_audit_log\nBEGIN\n SELECT RAISE(ABORT, 'device_rebind_audit_immutable');\nEND;\n";
|
|
12
13
|
/**
|
|
13
14
|
* The first pre-release attempts table forbade a review digest before OIDC,
|
|
14
15
|
* but the ceremony pins it at start. A coordinator that opened that build has
|
|
@@ -19,7 +20,7 @@ export declare const COORDINATOR_DEVICE_REBIND_SCHEMA_SQL = "\nCREATE TABLE IF N
|
|
|
19
20
|
export declare function upgradePreReleaseRebindAttemptsSql(existingTableSql: string | null, rows: number): string | null;
|
|
20
21
|
/**
|
|
21
22
|
* The backend, only when this database has the current rebind tables. Without
|
|
22
|
-
* them (
|
|
23
|
+
* them (including D1 before migration 0044) rebind routes report not found
|
|
23
24
|
* and the shared OIDC callback skips the rebind hook.
|
|
24
25
|
*/
|
|
25
26
|
export declare function readDeviceRebindBackend(backend: AuthLinkBackend): Promise<AuthLinkBackend | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-rebind-schema.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE
|
|
1
|
+
{"version":3,"file":"coordinator-device-rebind-schema.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAElE;;;;;;;;;GASG;AACH,eAAO,MAAM,oCAAoC,y8RA2KhD,CAAC;AAWF;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CACjD,gBAAgB,EAAE,MAAM,GAAG,IAAI,EAC/B,IAAI,EAAE,MAAM,GACV,MAAM,GAAG,IAAI,CAUf;AAUD;;;;GAIG;AACH,wBAAsB,uBAAuB,CAC5C,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,eAAe,GAAG,IAAI,CAAC,CAMjC;AAoBD;;;;GAIG;AACH,wBAAgB,mCAAmC,IAAI,MAAM,CAqB5D;AAED;;;;GAIG;AACH,wBAAgB,iCAAiC,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAM1F"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coordinator-device-rebind-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-rebind-test-fixtures.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,QAAQ,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"coordinator-device-rebind-test-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E,MAAM,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,GAAG,EAAE,MAAM,CAAC;QACZ,gBAAgB,EAAE,MAAM,CAAC;QACzB,SAAS,EAAE,MAAM,CAAC;KAClB,CAAC;IACF,OAAO,IAAI,OAAO,EAAE,EAAE,CAAC;IACvB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB;AAyFD,+EAA+E;AAC/E,wBAAsB,aAAa,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC,CAmCzE;AAED,qGAAqG;AACrG,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,KAAK,EAAE;IACN,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CACjB,GACC,OAAO,CAAC,IAAI,CAAC,CAkBf"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { AuthLinkBackend, AuthLinkStatement } from "./coordinator-auth-link.js";
|
|
2
|
+
import type { CoordinatorAuthLinkConfig, CoordinatorAuthLinkSigner } from "./coordinator-auth-link-contract.js";
|
|
3
|
+
export interface DeviceSelfBindInput {
|
|
4
|
+
signer: CoordinatorAuthLinkSigner;
|
|
5
|
+
currentIdentityId: string;
|
|
6
|
+
attemptId?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function hasDeviceRebindStartAuthorityColumn(backend: AuthLinkBackend): Promise<boolean>;
|
|
9
|
+
export interface DeviceSelfBindAuthority {
|
|
10
|
+
/** Stored as `start_authority_json` at start; every later step requires the same text. */
|
|
11
|
+
snapshot: string;
|
|
12
|
+
/** These go first in the batch that writes. They re-run every read behind the pin. */
|
|
13
|
+
guards: AuthLinkStatement[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Server proof only. Reads the facts, decides in TypeScript, and returns the pin with
|
|
17
|
+
* the guards that re-run every read. The decision is void unless those guards run in
|
|
18
|
+
* the batch that writes; never authorize from the pin alone.
|
|
19
|
+
* The account link may originate on a peer. Its immutable genesis still has to verify.
|
|
20
|
+
*/
|
|
21
|
+
export declare function prepareDeviceSelfBindAuthority(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<DeviceSelfBindAuthority | null>;
|
|
22
|
+
/** Readiness is deliberately fail closed on D1 before migration 0044. */
|
|
23
|
+
export declare function readDeviceSelfBindEligibility(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<{
|
|
24
|
+
kind: "eligible";
|
|
25
|
+
identityId: string;
|
|
26
|
+
} | {
|
|
27
|
+
kind: "unavailable";
|
|
28
|
+
}>;
|
|
29
|
+
//# sourceMappingURL=coordinator-device-self-bind-authority.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-self-bind-authority.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-authority.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EACX,yBAAyB,EACzB,yBAAyB,EACzB,MAAM,qCAAqC,CAAC;AAW7C,MAAM,WAAW,mBAAmB;IACnC,MAAM,EAAE,yBAAyB,CAAC;IAClC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,wBAAsB,mCAAmC,CACxD,OAAO,EAAE,eAAe,GACtB,OAAO,CAAC,OAAO,CAAC,CAOlB;AAmJD,MAAM,WAAW,uBAAuB;IACvC,0FAA0F;IAC1F,QAAQ,EAAE,MAAM,CAAC;IACjB,sFAAsF;IACtF,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC5B;AAwDD;;;;;GAKG;AACH,wBAAsB,8BAA8B,CACnD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CA0BzC;AAED,yEAAyE;AACzE,wBAAsB,6BAA6B,CAClD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,CAAC,CAS7E"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { type SqlValue } from "./coordinator-sql-compare.js";
|
|
2
|
+
/** Trusted server values: the signed enrollment, the configuration, and derived key facts. */
|
|
3
|
+
export interface SelfBindSubject {
|
|
4
|
+
coordinatorId: string;
|
|
5
|
+
identityId: string;
|
|
6
|
+
groupId: string;
|
|
7
|
+
deviceId: string;
|
|
8
|
+
publicKey: string;
|
|
9
|
+
fingerprint: string;
|
|
10
|
+
keyId: string;
|
|
11
|
+
issuer: string;
|
|
12
|
+
nowMs: number;
|
|
13
|
+
attemptId: string | null;
|
|
14
|
+
/** Every stored text form of this device's key. */
|
|
15
|
+
aliases: string[];
|
|
16
|
+
}
|
|
17
|
+
export interface SelfBindEnrollment {
|
|
18
|
+
group_id: string;
|
|
19
|
+
device_id: string;
|
|
20
|
+
public_key: SqlValue;
|
|
21
|
+
fingerprint: SqlValue;
|
|
22
|
+
identity_id: SqlValue;
|
|
23
|
+
enabled: SqlValue;
|
|
24
|
+
created_at: SqlValue;
|
|
25
|
+
/** For an enrollment in the signed group: 1 when that group exists and is not archived. */
|
|
26
|
+
group_live: SqlValue;
|
|
27
|
+
}
|
|
28
|
+
export interface SelfBindAttestation {
|
|
29
|
+
coordinator_id: string;
|
|
30
|
+
attestation_id: string;
|
|
31
|
+
identity_id: SqlValue;
|
|
32
|
+
group_id: SqlValue;
|
|
33
|
+
device_id: SqlValue;
|
|
34
|
+
public_key: SqlValue;
|
|
35
|
+
fingerprint: SqlValue;
|
|
36
|
+
review_receipt_id: SqlValue;
|
|
37
|
+
evidence_digest: SqlValue;
|
|
38
|
+
enrollment_identity_id: SqlValue;
|
|
39
|
+
revision: SqlValue;
|
|
40
|
+
created_at: SqlValue;
|
|
41
|
+
revoked_at: SqlValue;
|
|
42
|
+
}
|
|
43
|
+
export interface SelfBindLink {
|
|
44
|
+
/** The pinned link columns, in pin order. */
|
|
45
|
+
link: SqlValue[];
|
|
46
|
+
issuer: SqlValue;
|
|
47
|
+
/** SQL verdict: the link's immutable creation records verify. */
|
|
48
|
+
proven: SqlValue;
|
|
49
|
+
/** SQL verdict: a controller-reviewed link has its complete browser creation receipt. */
|
|
50
|
+
controller_receipt: SqlValue;
|
|
51
|
+
/** SQL verdict: the link came from a device without a browser. */
|
|
52
|
+
headless: SqlValue;
|
|
53
|
+
/** The pinned columns of the link's controller review and device claim, if any. */
|
|
54
|
+
linkController: SqlValue[][];
|
|
55
|
+
linkClaim: SqlValue[][];
|
|
56
|
+
}
|
|
57
|
+
/** Everything the decision looks at. A list named `...Conflicts` must be empty. */
|
|
58
|
+
export type SelfBindFacts = {
|
|
59
|
+
/** Enrollments of this device or of any text form of its key. */
|
|
60
|
+
enrollments: SelfBindEnrollment[];
|
|
61
|
+
/** Controller reviews of this device or of any text form of its key. */
|
|
62
|
+
attestations: SelfBindAttestation[];
|
|
63
|
+
/** Active account links of the current Identity. */
|
|
64
|
+
links: SelfBindLink[];
|
|
65
|
+
/** Consumed invites that assigned this device, key or fingerprint to another Identity. */
|
|
66
|
+
inviteConflicts: unknown[];
|
|
67
|
+
bindingConflicts: unknown[];
|
|
68
|
+
claimConflicts: unknown[];
|
|
69
|
+
revocationConflicts: unknown[];
|
|
70
|
+
otherIdentityLinkAttemptConflicts: unknown[];
|
|
71
|
+
otherIdentityLinkAuditConflicts: unknown[];
|
|
72
|
+
ownerAttemptConflicts: unknown[];
|
|
73
|
+
linkAttemptConflicts: unknown[];
|
|
74
|
+
rebindAttemptConflicts: unknown[];
|
|
75
|
+
legacyDecisionConflicts: unknown[];
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Pure decision over the facts read. Returns the pin that the start stores as
|
|
79
|
+
* `start_authority_json` and every later step requires again, or null when this device
|
|
80
|
+
* may not connect this way. The pin is byte-compatible with the SQL `json_object` that
|
|
81
|
+
* produced it before, so attempts started by an earlier release still match.
|
|
82
|
+
*/
|
|
83
|
+
export declare function decideDeviceSelfBind(p: SelfBindSubject, facts: SelfBindFacts): string | null;
|
|
84
|
+
//# sourceMappingURL=coordinator-device-self-bind-decision.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-self-bind-decision.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-decision.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAuB,MAAM,8BAA8B,CAAC;AAElF,8FAA8F;AAC9F,MAAM,WAAW,eAAe;IAC/B,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,mDAAmD;IACnD,OAAO,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,MAAM,WAAW,kBAAkB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,QAAQ,CAAC;IACrB,WAAW,EAAE,QAAQ,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AAO,EAAE,CAAC;IAC5B,cAAc,EAAE,OAAO,EAAE,CAAC;IAC1B,mBAAmB,EAAE,OAAO,EAAE,CAAC;IAC/B,iCAAiC,EAAE,OAAO,EAAE,CAAC;IAC7C,+BAA+B,EAAE,OAAO,EAAE,CAAC;IAC3C,qBAAqB,EAAE,OAAO,EAAE,CAAC;IACjC,oBAAoB,EAAE,OAAO,EAAE,CAAC;IAChC,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClC,uBAAuB,EAAE,OAAO,EAAE,CAAC;CACnC,CAAC;AAsGF;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,EAAE,eAAe,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,GAAG,IAAI,CAO5F"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { AuthLinkBackend, AuthLinkStatement } from "./coordinator-auth-link.js";
|
|
2
|
+
import type { CoordinatorAuthLinkConfig } from "./coordinator-auth-link-contract.js";
|
|
3
|
+
import { type DeviceSelfBindInput } from "./coordinator-device-self-bind-authority.js";
|
|
4
|
+
/** Server proof only. Embed this SELECT in the winning statement, never authorize from a pre-read.
|
|
5
|
+
* The account link may originate on a peer. Its immutable genesis still has to verify.
|
|
6
|
+
*/
|
|
7
|
+
export declare function prepareOriginalSelfBindAuthority(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<AuthLinkStatement | null>;
|
|
8
|
+
export declare const ORIGINAL_CHECK_COUNT: number;
|
|
9
|
+
/** What the original statement answered: its pin, or null when it selected no row. */
|
|
10
|
+
export declare function originalSelfBindSnapshot(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<string | null>;
|
|
11
|
+
/**
|
|
12
|
+
* The original statement's individual checks, by index into CHECKS, that did not hold.
|
|
13
|
+
* Null when the statement was never built. It reuses the original WITH clause and
|
|
14
|
+
* replaces only the final SELECT, which has no bound values.
|
|
15
|
+
*/
|
|
16
|
+
export declare function originalFailedChecks(backend: AuthLinkBackend, input: DeviceSelfBindInput, config: CoordinatorAuthLinkConfig, now: number): Promise<number[] | null>;
|
|
17
|
+
//# sourceMappingURL=coordinator-device-self-bind-original-sql-test-fixtures.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coordinator-device-self-bind-original-sql-test-fixtures.d.ts","sourceRoot":"","sources":["../src/coordinator-device-self-bind-original-sql-test-fixtures.ts"],"names":[],"mappings":"AAuBA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AACrF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAErF,OAAO,EACN,KAAK,mBAAmB,EAExB,MAAM,6CAA6C,CAAC;AAqDrD;;GAEG;AACH,wBAAsB,gCAAgC,CACrD,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CA4CnC;AAGD,eAAO,MAAM,oBAAoB,QAAgB,CAAC;AAElD,sFAAsF;AACtF,wBAAsB,wBAAwB,CAC7C,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAIxB;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACzC,OAAO,EAAE,eAAe,EACxB,KAAK,EAAE,mBAAmB,EAC1B,MAAM,EAAE,yBAAyB,EACjC,GAAG,EAAE,MAAM,GACT,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAU1B"}
|