@interop/was-react 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -25
- package/dist/auth/loginFlow.d.ts +8 -5
- package/dist/auth/loginFlow.d.ts.map +1 -1
- package/dist/auth/loginFlow.js +46 -16
- package/dist/auth/loginFlow.js.map +1 -1
- package/dist/auth/loginRequest.d.ts +27 -81
- package/dist/auth/loginRequest.d.ts.map +1 -1
- package/dist/auth/loginRequest.js +94 -41
- package/dist/auth/loginRequest.js.map +1 -1
- package/dist/auth/verifyResponse.d.ts +3 -3
- package/dist/auth/verifyResponse.d.ts.map +1 -1
- package/dist/auth/verifyResponse.js +16 -13
- package/dist/auth/verifyResponse.js.map +1 -1
- package/dist/auth/walletRequestTypes.d.ts +8 -6
- package/dist/auth/walletRequestTypes.d.ts.map +1 -1
- package/dist/config.d.ts +19 -13
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +0 -0
- package/dist/config.js.map +1 -1
- package/dist/identity/seedCredential.d.ts +39 -38
- package/dist/identity/seedCredential.d.ts.map +1 -1
- package/dist/identity/seedCredential.js +79 -77
- package/dist/identity/seedCredential.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/react/documentApp.d.ts +6 -6
- package/dist/react/documentApp.d.ts.map +1 -1
- package/dist/react/documentApp.js +7 -6
- package/dist/react/documentApp.js.map +1 -1
- package/dist/react/hooks.d.ts +1 -1
- package/dist/react/hooks.js +1 -1
- package/dist/session/authStore.d.ts +1 -1
- package/dist/session/authStore.js +6 -6
- package/dist/session/authStore.js.map +1 -1
- package/dist/storage/adopt.d.ts +3 -3
- package/dist/storage/adopt.js +5 -5
- package/dist/storage/entityStore.d.ts +1 -1
- package/dist/storage/localStore.d.ts +2 -2
- package/dist/storage/localStore.js +2 -2
- package/dist/storage/storageManager.d.ts +8 -3
- package/dist/storage/storageManager.d.ts.map +1 -1
- package/dist/storage/storageManager.js +19 -12
- package/dist/storage/storageManager.js.map +1 -1
- package/dist/sync/lww.d.ts +4 -4
- package/dist/sync/lww.js +7 -7
- package/dist/sync/lwwConflictHandler.d.ts +4 -4
- package/dist/sync/lwwConflictHandler.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedCredential.d.ts","sourceRoot":"","sources":["../../src/identity/seedCredential.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"seedCredential.d.ts","sourceRoot":"","sources":["../../src/identity/seedCredential.ts"],"names":[],"mappings":"AA0BA,OAAO,KAAK,EACV,qBAAqB,EACrB,uBAAuB,EACxB,MAAM,8BAA8B,CAAA;AAGrC,OAAO,EAAkB,KAAK,cAAc,EAAE,MAAM,aAAa,CAAA;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAIzD;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,qBAAqB,CAAA;AAEzD;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,SAAS,MAAM,EAG9C,CAAA;AAEF;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,UAAU,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,QAAQ,EAAE,cAAc,CAAA;CACzB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE1D;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAEzD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,IAAI,EACJ,MAAM,EACN,MAAM,EACN,OAAO,EACP,cAAc,EACf,EAAE;IACD,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,cAAc,CAAA;CAC/B,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAuBjC;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,mBAAmB,CAAC,EACxC,UAAU,EACV,MAAM,EACN,MAAM,EACP,EAAE;IACD,UAAU,EAAE,qBAAqB,CAAA;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,OAAO,CAAC,oBAAoB,CAAC,CA2DhC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,YAAY,EACZ,MAAM,EACP,EAAE;IACD,YAAY,EAAE,uBAAuB,CAAA;IACrC,MAAM,EAAE,MAAM,CAAA;CACf,GAAG,qBAAqB,GAAG,IAAI,CAW/B"}
|
|
@@ -3,31 +3,36 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* The app-key credential: a self-issued VC holding the app's 32-byte master
|
|
6
|
-
* seed, stored in (and recovered from) the user's wallet.
|
|
7
|
-
*
|
|
6
|
+
* seed, stored in (and recovered from) the user's wallet.
|
|
7
|
+
*
|
|
8
|
+
* The credential's vocabulary is fixed and shared by every application: the
|
|
9
|
+
* `type` array is exactly `['VerifiableCredential', 'AppKeyCredential']`, and
|
|
10
|
+
* the `@context` is the VC 1.0 context plus the hosted App Connect context
|
|
11
|
+
* (`https://w3id.org/byoe/app-connect/v1`, resolved as a static context by the
|
|
12
|
+
* document loader, so verification still needs no fetch). Nothing in the
|
|
13
|
+
* credential is app-scoped.
|
|
8
14
|
*
|
|
9
15
|
* The credential is self-issued: `issuer === credentialSubject.id`, and both
|
|
10
16
|
* equal the did:key controller DERIVED FROM THE EMBEDDED SEED -- so possession
|
|
11
17
|
* of the credential is possession of the identity, and a parsed credential can
|
|
12
18
|
* be re-checked against its own seed. `credentialSubject.origin` binds the
|
|
13
19
|
* credential to this app's web origin (the anti-phishing guard checked at
|
|
14
|
-
* login)
|
|
15
|
-
*
|
|
16
|
-
*
|
|
20
|
+
* login), and `credentialSubject.appUrl` identifies WHICH application on that
|
|
21
|
+
* origin it belongs to: the app identity is scoped to the triple (user,
|
|
22
|
+
* origin, `appUrl`).
|
|
17
23
|
*/
|
|
18
24
|
import { base64urlnopad } from '@scure/base';
|
|
19
25
|
import * as vc from '@interop/vc';
|
|
20
26
|
import { Ed25519Signature2020 } from '@interop/ed25519-signature';
|
|
21
|
-
import {
|
|
27
|
+
import { CONTEXT_URL_V1 } from 'byoe-context';
|
|
22
28
|
import { asArray } from '../jsonLd.js';
|
|
23
29
|
import { deriveIdentity } from './agents.js';
|
|
24
30
|
const VC_1_CONTEXT_URL = 'https://www.w3.org/2018/credentials/v1';
|
|
25
31
|
/**
|
|
26
|
-
* The marker type every app key carries
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
* foreign app key at store time.
|
|
32
|
+
* The marker type every app key carries, mapped to one stable IRI for every
|
|
33
|
+
* app by the hosted App Connect context. It makes "presents as an app key" a
|
|
34
|
+
* term check rather than a shape heuristic, which is what lets the wallet
|
|
35
|
+
* refuse a foreign app key at store time.
|
|
31
36
|
*
|
|
32
37
|
* It is a self-declaration, not evidence: the `type` array of a planted
|
|
33
38
|
* credential is attacker-controlled like the rest of it. The marker makes the
|
|
@@ -36,30 +41,12 @@ const VC_1_CONTEXT_URL = 'https://www.w3.org/2018/credentials/v1';
|
|
|
36
41
|
*/
|
|
37
42
|
export const APP_KEY_CREDENTIAL_TYPE = 'AppKeyCredential';
|
|
38
43
|
/**
|
|
39
|
-
* The
|
|
40
|
-
* restated here.
|
|
41
|
-
*/
|
|
42
|
-
const BYOE_TERMS = CONTEXT_V1['@context'];
|
|
43
|
-
const APP_KEY_CREDENTIAL_TYPE_IRI = BYOE_TERMS.AppKeyCredential;
|
|
44
|
-
/**
|
|
45
|
-
* Builds the inline context object for the credential's terms, so it stays
|
|
46
|
-
* verifiable with no remote vocabulary fetch. The marker type and the `seed` /
|
|
47
|
-
* `origin` claims carry shared `https://w3id.org/byoe#` IRIs (imported from
|
|
48
|
-
* `byoe-context`) -- they mean the same thing for every app, so they do not
|
|
49
|
-
* belong under a per-app `vocabBase`, which keeps only the app's own type
|
|
50
|
-
* term.
|
|
44
|
+
* The credential's fixed two-entry `type` array, in this order.
|
|
51
45
|
*/
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
[credentialType]: `${vocabBase}${credentialType}`,
|
|
57
|
-
seed: BYOE_TERMS.seed,
|
|
58
|
-
origin: BYOE_TERMS.origin,
|
|
59
|
-
name: BYOE_TERMS.name,
|
|
60
|
-
description: BYOE_TERMS.description
|
|
61
|
-
};
|
|
62
|
-
}
|
|
46
|
+
export const APP_KEY_TYPE_ARRAY = Object.freeze([
|
|
47
|
+
'VerifiableCredential',
|
|
48
|
+
APP_KEY_CREDENTIAL_TYPE
|
|
49
|
+
]);
|
|
63
50
|
/**
|
|
64
51
|
* Encodes bytes as base64url (no padding), browser- and Node-safe.
|
|
65
52
|
*/
|
|
@@ -79,29 +66,28 @@ export function base64urlToBytes(text) {
|
|
|
79
66
|
* @param options {object}
|
|
80
67
|
* @param options.seed {Uint8Array} the 32-byte master seed
|
|
81
68
|
* @param options.origin {string} this app's web origin (anti-phishing bind)
|
|
69
|
+
* @param options.appUrl {string} this app's canonical URL, in its
|
|
70
|
+
* serialized form (see `serializedAppUrl`); identifies the application among
|
|
71
|
+
* the applications on its origin
|
|
82
72
|
* @param options.appName {string} human-readable app name, shown by the
|
|
83
73
|
* wallet on the credential (`name`/`description`)
|
|
84
|
-
* @param options.config {SeedCredentialConfig} credential type + vocab
|
|
85
74
|
* @param options.documentLoader {DocumentLoader}
|
|
86
75
|
* @returns {Promise<IVerifiableCredential>}
|
|
87
76
|
*/
|
|
88
|
-
export async function issueSeedCredential({ seed, origin,
|
|
77
|
+
export async function issueSeedCredential({ seed, origin, appUrl, appName, documentLoader }) {
|
|
89
78
|
// `deriveIdentity` enforces the 32-byte seed rule.
|
|
90
79
|
const { controllerDid, keyAgent } = await deriveIdentity({ seed });
|
|
91
80
|
const credential = {
|
|
92
|
-
'@context': [VC_1_CONTEXT_URL,
|
|
81
|
+
'@context': [VC_1_CONTEXT_URL, CONTEXT_URL_V1],
|
|
93
82
|
id: `urn:uuid:${crypto.randomUUID()}`,
|
|
94
|
-
type: [
|
|
95
|
-
'VerifiableCredential',
|
|
96
|
-
APP_KEY_CREDENTIAL_TYPE,
|
|
97
|
-
config.credentialType
|
|
98
|
-
],
|
|
83
|
+
type: [...APP_KEY_TYPE_ARRAY],
|
|
99
84
|
name: `${appName} app key`,
|
|
100
85
|
description: `The ${appName} app keeps this key in your wallet so it can open your encrypted data on this and other devices.`,
|
|
101
86
|
issuer: controllerDid,
|
|
102
87
|
credentialSubject: {
|
|
103
88
|
id: controllerDid,
|
|
104
89
|
seed: bytesToBase64url(seed),
|
|
90
|
+
appUrl,
|
|
105
91
|
origin
|
|
106
92
|
}
|
|
107
93
|
};
|
|
@@ -113,79 +99,95 @@ export async function issueSeedCredential({ seed, origin, appName, config, docum
|
|
|
113
99
|
}));
|
|
114
100
|
}
|
|
115
101
|
/**
|
|
116
|
-
* Parses
|
|
117
|
-
* `AppKeyCredential` marker type, the
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
102
|
+
* Parses an app-key credential and enforces the App Connect spec's six parse
|
|
103
|
+
* checks, in order: the `AppKeyCredential` marker type, the `appUrl` claim
|
|
104
|
+
* matching what this request sent (exact string), self-issue (issuer ===
|
|
105
|
+
* subject id), the origin binding (exact string, against this app's own live
|
|
106
|
+
* origin -- the same value it sent as the request `domain`), a well-formed
|
|
107
|
+
* 32-byte base64url-no-pad seed, and -- the strongest check -- that the DID
|
|
108
|
+
* derived from the embedded seed IS the credential's subject/issuer DID. (The
|
|
109
|
+
* cryptographic proof on the credential is verified separately at the
|
|
110
|
+
* presentation level.)
|
|
122
111
|
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
* since the seed-to-DID binding below is the boundary either way.
|
|
112
|
+
* These duplicate checks the wallet already made; that is the point. They are
|
|
113
|
+
* defense in depth over an origin binding and an identity binding this app is
|
|
114
|
+
* fully able to check itself.
|
|
127
115
|
*
|
|
128
116
|
* @param options {object}
|
|
129
117
|
* @param options.credential {IVerifiableCredential}
|
|
130
|
-
* @param options.origin {string}
|
|
131
|
-
* @param options.
|
|
118
|
+
* @param options.origin {string} this app's own live browser origin
|
|
119
|
+
* @param options.appUrl {string} the serialized `appUrl` this request sent
|
|
132
120
|
* @returns {Promise<ParsedSeedCredential>}
|
|
133
121
|
*/
|
|
134
|
-
export async function parseSeedCredential({ credential, origin,
|
|
135
|
-
const { credentialType } = config;
|
|
122
|
+
export async function parseSeedCredential({ credential, origin, appUrl }) {
|
|
136
123
|
const types = asArray(credential.type);
|
|
137
|
-
if (!types.includes(credentialType)) {
|
|
138
|
-
throw new Error(`Credential is not a ${credentialType} credential.`);
|
|
139
|
-
}
|
|
140
124
|
if (!types.includes(APP_KEY_CREDENTIAL_TYPE)) {
|
|
141
|
-
throw new Error(
|
|
125
|
+
throw new Error(`The app-key credential does not carry the ` +
|
|
142
126
|
`${APP_KEY_CREDENTIAL_TYPE} type.`);
|
|
143
127
|
}
|
|
128
|
+
const subject = credential.credentialSubject;
|
|
129
|
+
if (subject?.appUrl !== appUrl) {
|
|
130
|
+
throw new Error(`The app-key credential's appUrl "${subject?.appUrl ?? ''}" does not ` +
|
|
131
|
+
`match this app's appUrl "${appUrl}".`);
|
|
132
|
+
}
|
|
144
133
|
const issuer = typeof credential.issuer === 'string'
|
|
145
134
|
? credential.issuer
|
|
146
135
|
: credential.issuer?.id;
|
|
147
|
-
const subject = credential.credentialSubject;
|
|
148
136
|
if (!issuer || !subject?.id || issuer !== subject.id) {
|
|
149
|
-
throw new Error(
|
|
137
|
+
throw new Error('The app-key credential is not self-issued.');
|
|
150
138
|
}
|
|
151
139
|
if (subject.origin !== origin) {
|
|
152
|
-
throw new Error(
|
|
140
|
+
throw new Error(`The app-key credential's origin "${subject.origin ?? ''}" does not match this app's origin "${origin}".`);
|
|
153
141
|
}
|
|
154
142
|
if (typeof subject.seed !== 'string' || subject.seed.length === 0) {
|
|
155
|
-
throw new Error(
|
|
143
|
+
throw new Error('The app-key credential carries no seed.');
|
|
144
|
+
}
|
|
145
|
+
// Fail closed on anything that is not base64url-no-pad decoding to exactly
|
|
146
|
+
// 32 bytes -- never truncate or pad.
|
|
147
|
+
let seed;
|
|
148
|
+
try {
|
|
149
|
+
seed = base64urlToBytes(subject.seed);
|
|
150
|
+
}
|
|
151
|
+
catch (err) {
|
|
152
|
+
throw new Error('The app-key seed is not valid base64url (no padding).', {
|
|
153
|
+
cause: err
|
|
154
|
+
});
|
|
156
155
|
}
|
|
157
|
-
const seed = base64urlToBytes(subject.seed);
|
|
158
156
|
if (seed.length !== 32) {
|
|
159
|
-
throw new Error(
|
|
157
|
+
throw new Error(`The app-key seed must decode to 32 bytes (got ${seed.length}).`);
|
|
160
158
|
}
|
|
161
159
|
// Derived once and handed back on the result: the same agents the caller
|
|
162
160
|
// would otherwise re-derive from this seed right after.
|
|
163
161
|
const identity = await deriveIdentity({ seed });
|
|
164
162
|
if (identity.controllerDid !== subject.id) {
|
|
165
|
-
throw new Error(
|
|
163
|
+
throw new Error('The app-key seed does not derive the credential subject DID.');
|
|
166
164
|
}
|
|
167
165
|
return { seed, controllerDid: identity.controllerDid, identity };
|
|
168
166
|
}
|
|
169
167
|
/**
|
|
170
|
-
* Finds the
|
|
171
|
-
* wallet returned none (the
|
|
168
|
+
* Finds the app-key credential inside a wallet response VP, or `null` when the
|
|
169
|
+
* wallet returned none (the wallet-unsupported signal).
|
|
172
170
|
*
|
|
173
|
-
* Matched on the
|
|
174
|
-
*
|
|
175
|
-
*
|
|
176
|
-
*
|
|
171
|
+
* Matched on the `credentialSubject.appUrl` claim ALONE: per the App Connect
|
|
172
|
+
* spec's response-verification step 3, the `AppKeyCredential` marker type must
|
|
173
|
+
* NOT be required here. Requiring it would make "the wallet returned a
|
|
174
|
+
* credential that is wrong" indistinguishable from "the wallet returned
|
|
175
|
+
* nothing" -- a returned credential missing the marker must surface as a parse
|
|
176
|
+
* error from {@link parseSeedCredential}, not as a `null` a caller would read
|
|
177
|
+
* as first run and answer by silently minting a second key.
|
|
177
178
|
*
|
|
178
179
|
* @param options {object}
|
|
179
180
|
* @param options.presentation {IVerifiablePresentation}
|
|
180
|
-
* @param options.
|
|
181
|
+
* @param options.appUrl {string} the serialized `appUrl` this request sent
|
|
181
182
|
* @returns {IVerifiableCredential | null}
|
|
182
183
|
*/
|
|
183
|
-
export function findSeedCredential({ presentation,
|
|
184
|
+
export function findSeedCredential({ presentation, appUrl }) {
|
|
184
185
|
const embedded = presentation
|
|
185
186
|
.verifiableCredential;
|
|
186
187
|
for (const entry of asArray(embedded)) {
|
|
187
|
-
const
|
|
188
|
-
|
|
188
|
+
const subject = entry
|
|
189
|
+
.credentialSubject;
|
|
190
|
+
if (subject?.appUrl === appUrl) {
|
|
189
191
|
return entry;
|
|
190
192
|
}
|
|
191
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seedCredential.js","sourceRoot":"","sources":["../../src/identity/seedCredential.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"seedCredential.js","sourceRoot":"","sources":["../../src/identity/seedCredential.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,aAAa,CAAA;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAKjE,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAC7C,OAAO,EAA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AM,EAAE,CAAC;YAC/B,OAAO,KAA8B,CAAA;QACvC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -15,16 +15,16 @@ export { parseInvocationTarget, parseGrants, type ParsedGrants } from './grants.
|
|
|
15
15
|
export { deriveIdentity, DEFAULT_IDENTITY_HANDLE, type IdentityAgents } from './identity/agents.js';
|
|
16
16
|
export { createDocumentLoader, type DocumentLoader } from './identity/documentLoader.js';
|
|
17
17
|
export { createSeedStore, createDescriptorCache, type SeedStore } from './identity/seedStore.js';
|
|
18
|
-
export { APP_KEY_CREDENTIAL_TYPE, issueSeedCredential, parseSeedCredential, findSeedCredential, bytesToBase64url, base64urlToBytes, type
|
|
18
|
+
export { APP_KEY_CREDENTIAL_TYPE, APP_KEY_TYPE_ARRAY, issueSeedCredential, parseSeedCredential, findSeedCredential, bytesToBase64url, base64urlToBytes, type ParsedSeedCredential } from './identity/seedCredential.js';
|
|
19
19
|
export { persistAppSession, restoreAppSession, clearAppSession, isExpired, isNearExpiry, earliestExpiry, type AppSessionRecord, type RestoredAppSession } from './identity/appSession.js';
|
|
20
20
|
export { DEFAULT_MEDIATOR_BASE, loadChapi, chapiGet } from './auth/chapi.js';
|
|
21
|
-
export { RW_ACTIONS,
|
|
21
|
+
export { RW_ACTIONS, SHARED_ACTIONS, actionCeiling, newChallenge, buildAppConnectVpr, type GrantRequestCollection } from './auth/loginRequest.js';
|
|
22
22
|
export { verifyLoginPresentation, grantsOf, checkGrants, type CheckedGrants } from './auth/verifyResponse.js';
|
|
23
23
|
export { loginWithWallet, requestGrants, LoginCancelledError, WalletUnsupportedError, type LoginConfig, type LoginPhase, type LoginOutcome } from './auth/loginFlow.js';
|
|
24
24
|
export type { IVPRDetails, IVPRQuery, IDIDAuthenticationQuery, IAppConnectQuery, IAppConnectCapabilityQuery, ICapabilityQueryDetail, IVerifiableCredential, IVerifiablePresentation, IZcap } from './auth/walletRequestTypes.js';
|
|
25
25
|
export * from './sync/index.js';
|
|
26
26
|
export { LocalStore } from './storage/localStore.js';
|
|
27
|
-
export { setLocalStore, requireStore, hasStore, clearLocalStore, setRemoteStore, requireRemoteStore, hasRemoteStore, clearRemoteStore,
|
|
27
|
+
export { setLocalStore, requireStore, hasStore, clearLocalStore, setRemoteStore, requireRemoteStore, hasRemoteStore, clearRemoteStore, getWriterId } from './storage/storageManager.js';
|
|
28
28
|
export { createEntityStore, type EntityStore } from './storage/entityStore.js';
|
|
29
29
|
export { WasRemoteStore, remoteDescriptorSource, type DeclarationResult, type EqualityQueryPage } from './storage/wasRemoteStore.js';
|
|
30
30
|
export { SharedCollectionReader, SharedCollectionUnavailableError, SHARED_CHANGES_PAGE_SIZE, type SharedResource } from './storage/sharedCollectionReader.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAGH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,KAAK,YAAY,EAClB,MAAM,aAAa,CAAA;AAIpB,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,uBAAuB,EACvB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAGH,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,YAAY,EACjB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EACnB,MAAM,aAAa,CAAA;AAGpB,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,KAAK,YAAY,EAClB,MAAM,aAAa,CAAA;AAIpB,OAAO,EACL,cAAc,EACd,uBAAuB,EACvB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EACL,oBAAoB,EACpB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,eAAe,EACf,qBAAqB,EACrB,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,oBAAoB,EAC1B,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,YAAY,EACZ,cAAc,EACd,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EACxB,MAAM,0BAA0B,CAAA;AAGjC,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AAC5E,OAAO,EACL,UA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AC/B,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAG1E,OAAO,EACL,eAAe,EACf,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,YAAY,EAClB,MAAM,oBAAoB,CAAA;AAG3B,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,UAAU,EACV,QAAQ,EACR,SAAS,EACT,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,aAAa,EACb,KAAK,UAAU,EACf,iBAAiB,EACjB,uBAAuB,EACvB,sBAAsB,EACtB,KAAK,WAAW,EACjB,MAAM,kBAAkB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,11 +19,11 @@ export { parseInvocationTarget, parseGrants } from './grants.js';
|
|
|
19
19
|
export { deriveIdentity, DEFAULT_IDENTITY_HANDLE } from './identity/agents.js';
|
|
20
20
|
export { createDocumentLoader } from './identity/documentLoader.js';
|
|
21
21
|
export { createSeedStore, createDescriptorCache } from './identity/seedStore.js';
|
|
22
|
-
export { APP_KEY_CREDENTIAL_TYPE, issueSeedCredential, parseSeedCredential, findSeedCredential, bytesToBase64url, base64urlToBytes } from './identity/seedCredential.js';
|
|
22
|
+
export { APP_KEY_CREDENTIAL_TYPE, APP_KEY_TYPE_ARRAY, issueSeedCredential, parseSeedCredential, findSeedCredential, bytesToBase64url, base64urlToBytes } from './identity/seedCredential.js';
|
|
23
23
|
export { persistAppSession, restoreAppSession, clearAppSession, isExpired, isNearExpiry, earliestExpiry } from './identity/appSession.js';
|
|
24
24
|
// Auth: CHAPI bridge, VPR construction, response verification, login flow.
|
|
25
25
|
export { DEFAULT_MEDIATOR_BASE, loadChapi, chapiGet } from './auth/chapi.js';
|
|
26
|
-
export { RW_ACTIONS,
|
|
26
|
+
export { RW_ACTIONS, SHARED_ACTIONS, actionCeiling, newChallenge, buildAppConnectVpr } from './auth/loginRequest.js';
|
|
27
27
|
export { verifyLoginPresentation, grantsOf, checkGrants } from './auth/verifyResponse.js';
|
|
28
28
|
export { loginWithWallet, requestGrants, LoginCancelledError, WalletUnsupportedError } from './auth/loginFlow.js';
|
|
29
29
|
// The collection-agnostic RxDB-WAS replication core.
|
|
@@ -32,7 +32,7 @@ export * from './sync/index.js';
|
|
|
32
32
|
// stores, the delegated remote store, sync status, rehydrate mechanism, and the
|
|
33
33
|
// replication controller.
|
|
34
34
|
export { LocalStore } from './storage/localStore.js';
|
|
35
|
-
export { setLocalStore, requireStore, hasStore, clearLocalStore, setRemoteStore, requireRemoteStore, hasRemoteStore, clearRemoteStore,
|
|
35
|
+
export { setLocalStore, requireStore, hasStore, clearLocalStore, setRemoteStore, requireRemoteStore, hasRemoteStore, clearRemoteStore, getWriterId } from './storage/storageManager.js';
|
|
36
36
|
export { createEntityStore } from './storage/entityStore.js';
|
|
37
37
|
export { WasRemoteStore, remoteDescriptorSource } from './storage/wasRemoteStore.js';
|
|
38
38
|
export { SharedCollectionReader, SharedCollectionUnavailableError, SHARED_CHANGES_PAGE_SIZE } from './storage/sharedCollectionReader.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;GAQG;AAEH,0BAA0B;AAC1B,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,oBAAoB,EACpB,yBAAyB,EACzB,uBAAuB,EACvB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EAQ1B,MAAM,aAAa,CAAA;AAEpB,oCAAoC;AACpC,OAAO,EACL,qBAAqB,EACrB,WAAW,EAEZ,MAAM,aAAa,CAAA;AAEpB,8EAA8E;AAC9E,2CAA2C;AAC3C,OAAO,EACL,cAAc,EACd,uBAAuB,EAExB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,E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sB,EAEvB,MAAM,kBAAkB,CAAA"}
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
*
|
|
13
13
|
* The facade is a degenerate entity store: one collection (the app-named
|
|
14
14
|
* sandbox collection) holding one logical document under a fixed id. The
|
|
15
|
-
* stored row wraps the app's data (`{ id, updatedAt,
|
|
15
|
+
* stored row wraps the app's data (`{ id, updatedAt, writerId, data }`) so app
|
|
16
16
|
* fields can never collide with the LWW fields the sync layer requires, and
|
|
17
|
-
* the facade stamps `updatedAt`/`
|
|
17
|
+
* the facade stamps `updatedAt`/`writerId` on every write itself. Hydration
|
|
18
18
|
* goes through `LocalStore.hydrateSingleton`, which LWW-reconciles the
|
|
19
19
|
* duplicate envelope rows two devices can mint for the same logical document.
|
|
20
20
|
*
|
|
@@ -28,7 +28,6 @@
|
|
|
28
28
|
* outgrown one document should move to `createEntityStore`.
|
|
29
29
|
*/
|
|
30
30
|
import type { StoreRegistry, WasAppConfig, WasExpiryConfig, WasSyncConfig } from '../config.js';
|
|
31
|
-
import type { SeedCredentialConfig } from '../identity/seedCredential.js';
|
|
32
31
|
import type { SessionStatus } from '../session/authStore.js';
|
|
33
32
|
import type { SyncRollup } from '../storage/syncStatusStore.js';
|
|
34
33
|
/**
|
|
@@ -121,25 +120,26 @@ export interface DocumentApp<T extends object> {
|
|
|
121
120
|
* @param options {object}
|
|
122
121
|
* @param options.appName {string} human-readable name (consent reason lines)
|
|
123
122
|
* @param options.appOrigin {string} this app's own web origin
|
|
123
|
+
* @param options.appUrl {string} this app's canonical URL (absolute,
|
|
124
|
+
* fragment-less, same-origin with `appOrigin`)
|
|
124
125
|
* @param [options.mediatorBase] {string} CHAPI mediator base URL
|
|
125
126
|
* @param options.document {object} `collectionId` (the WAS sandbox
|
|
126
127
|
* collection id) and `initial` (the document value before the first write)
|
|
127
|
-
* @param options.credential {SeedCredentialConfig} seed-credential naming
|
|
128
128
|
* @param [options.dbName] {string} local database base name
|
|
129
129
|
* @param [options.storageKeyPrefix] {string} localStorage key prefix
|
|
130
130
|
* @param [options.sync] {WasSyncConfig} replication tuning
|
|
131
131
|
* @param [options.expiry] {WasExpiryConfig} near-expiry warning tuning
|
|
132
132
|
* @returns {DocumentApp<T>}
|
|
133
133
|
*/
|
|
134
|
-
export declare function defineDocumentApp<T extends object>({ appName, appOrigin, mediatorBase, document,
|
|
134
|
+
export declare function defineDocumentApp<T extends object>({ appName, appOrigin, appUrl, mediatorBase, document, dbName, storageKeyPrefix, sync, expiry }: {
|
|
135
135
|
appName: string;
|
|
136
136
|
appOrigin: string;
|
|
137
|
+
appUrl: string;
|
|
137
138
|
mediatorBase?: string;
|
|
138
139
|
document: {
|
|
139
140
|
collectionId: string;
|
|
140
141
|
initial: T;
|
|
141
142
|
};
|
|
142
|
-
credential: SeedCredentialConfig;
|
|
143
143
|
dbName?: string;
|
|
144
144
|
storageKeyPrefix?: string;
|
|
145
145
|
sync?: WasSyncConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentApp.d.ts","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACd,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"documentApp.d.ts","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,KAAK,EACV,aAAa,EACb,YAAY,EACZ,eAAe,EACf,aAAa,EACd,MAAM,cAAc,CAAA;AACrB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAG5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAA;AAG/D;;GAEG;AACH,eAAO,MAAM,uBAAuB,aAAa,CAAA;AAO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f,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,CAAC,CAAA;KAAE,CAAA;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,IAAI,CAAC,EAAE,aAAa,CAAA;IACpB,MAAM,CAAC,EAAE,eAAe,CAAA;CACzB,GAAG,WAAW,CAAC,CAAC,CAAC,CAiIjB"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createEntityStore } from '../storage/entityStore.js';
|
|
2
|
-
import {
|
|
2
|
+
import { getWriterId, requireStore } from '../storage/storageManager.js';
|
|
3
3
|
import { useLogin, useLogout, useSyncStatus } from './hooks.js';
|
|
4
4
|
/**
|
|
5
5
|
* The localStore / RxDB collection key the facade's one collection uses.
|
|
@@ -21,31 +21,32 @@ export const DOCUMENT_EXPORT_FORMAT = 'was-document/v1';
|
|
|
21
21
|
* @param options {object}
|
|
22
22
|
* @param options.appName {string} human-readable name (consent reason lines)
|
|
23
23
|
* @param options.appOrigin {string} this app's own web origin
|
|
24
|
+
* @param options.appUrl {string} this app's canonical URL (absolute,
|
|
25
|
+
* fragment-less, same-origin with `appOrigin`)
|
|
24
26
|
* @param [options.mediatorBase] {string} CHAPI mediator base URL
|
|
25
27
|
* @param options.document {object} `collectionId` (the WAS sandbox
|
|
26
28
|
* collection id) and `initial` (the document value before the first write)
|
|
27
|
-
* @param options.credential {SeedCredentialConfig} seed-credential naming
|
|
28
29
|
* @param [options.dbName] {string} local database base name
|
|
29
30
|
* @param [options.storageKeyPrefix] {string} localStorage key prefix
|
|
30
31
|
* @param [options.sync] {WasSyncConfig} replication tuning
|
|
31
32
|
* @param [options.expiry] {WasExpiryConfig} near-expiry warning tuning
|
|
32
33
|
* @returns {DocumentApp<T>}
|
|
33
34
|
*/
|
|
34
|
-
export function defineDocumentApp({ appName, appOrigin, mediatorBase, document,
|
|
35
|
+
export function defineDocumentApp({ appName, appOrigin, appUrl, mediatorBase, document, dbName, storageKeyPrefix, sync, expiry }) {
|
|
35
36
|
const { collectionId, initial } = document;
|
|
36
37
|
const docStore = createEntityStore(DOCUMENT_COLLECTION_KEY);
|
|
37
38
|
// Resolved once, under the same prefix the config hands the session layer,
|
|
38
39
|
// so the facade's stamps and the adoption repair share one identity.
|
|
39
|
-
const
|
|
40
|
+
const writerId = getWriterId({
|
|
40
41
|
...(storageKeyPrefix !== undefined && { storageKeyPrefix })
|
|
41
42
|
});
|
|
42
43
|
const config = {
|
|
43
44
|
appName,
|
|
44
45
|
appOrigin,
|
|
46
|
+
appUrl,
|
|
45
47
|
...(mediatorBase !== undefined && { mediatorBase }),
|
|
46
48
|
collections: [{ key: DOCUMENT_COLLECTION_KEY, id: collectionId }],
|
|
47
49
|
onboarding: 'local-first',
|
|
48
|
-
credential,
|
|
49
50
|
...(dbName !== undefined && { dbName }),
|
|
50
51
|
...(storageKeyPrefix !== undefined && { storageKeyPrefix }),
|
|
51
52
|
...(sync !== undefined && { sync }),
|
|
@@ -78,7 +79,7 @@ export function defineDocumentApp({ appName, appOrigin, mediatorBase, document,
|
|
|
78
79
|
await docStore.getState().upsert({
|
|
79
80
|
id: DOCUMENT_ID,
|
|
80
81
|
updatedAt: new Date().toISOString(),
|
|
81
|
-
|
|
82
|
+
writerId,
|
|
82
83
|
data
|
|
83
84
|
});
|
|
84
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentApp.js","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"documentApp.js","sourceRoot":"","sources":["../../src/react/documentApp.ts"],"names":[],"mappings":"AAoCA,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAC7D,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,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AAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;QAC3D,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,EAAE,CAAA;QAC3D,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,aAAa,EAAE,CAAA;QAC5C,MAAM,MAAM,GAAG,SAAS,EAAE,CAAA;QAC1B,0EAA0E;QAC1E,+DAA+D;QAC/D,MAAM,GAAG,GAAG,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,OAAO,CAAC,CAAA;QACnE,OAAO;YACL,GAAG;YACH,MAAM;YACN,MAAM;YACN,IAAI,EAAE,SAAS;YACf,UAAU;YACV,UAAU;YACV,OAAO,EAAE,GAAG,EAAE,CAAC,KAAK,EAAE;YACtB,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE;YAC1B,UAAU,EAAE,cAAc;YAC1B,KAAK;SACN,CAAA;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,EAAE,CAAA;AAC7C,CAAC"}
|
package/dist/react/hooks.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export declare function useAuthStore(): WasAuthStore;
|
|
|
19
19
|
export declare function useSession(): {
|
|
20
20
|
status: ReturnType<WasAuthStore['getState']>['status'];
|
|
21
21
|
onboarding: ReturnType<WasAuthStore['getState']>['onboarding'];
|
|
22
|
-
|
|
22
|
+
writerId: string;
|
|
23
23
|
authenticating: boolean;
|
|
24
24
|
phase: ReturnType<WasAuthStore['getState']>['phase'];
|
|
25
25
|
error: string | null;
|
package/dist/react/hooks.js
CHANGED
|
@@ -38,7 +38,7 @@ export function useSession() {
|
|
|
38
38
|
return useStore(store, useShallow(state => ({
|
|
39
39
|
status: state.status,
|
|
40
40
|
onboarding: state.onboarding,
|
|
41
|
-
|
|
41
|
+
writerId: state.writerId,
|
|
42
42
|
authenticating: state.phase !== null,
|
|
43
43
|
phase: state.phase,
|
|
44
44
|
error: state.error,
|
|
@@ -64,7 +64,7 @@ export interface AuthState {
|
|
|
64
64
|
* every entity insert and update; the adoption repair uses the same value,
|
|
65
65
|
* so one install writes under one identity.
|
|
66
66
|
*/
|
|
67
|
-
|
|
67
|
+
writerId: string;
|
|
68
68
|
/**
|
|
69
69
|
* The current login phase, for the login page's progress line, and the single
|
|
70
70
|
* source of truth for "a Login With Wallet flow is in flight" (non-`null`
|
|
@@ -43,7 +43,7 @@ import { clearAppSession, peekAppSession, persistAppSession, restoreAppSession,
|
|
|
43
43
|
import { loginWithWallet, requestGrants, LoginCancelledError } from '../auth/loginFlow.js';
|
|
44
44
|
import { parseGrants } from '../grants.js';
|
|
45
45
|
import { LocalStore, dbNameForController } from '../storage/localStore.js';
|
|
46
|
-
import { clearLocalStore, clearRemoteStore,
|
|
46
|
+
import { clearLocalStore, clearRemoteStore, getWriterId, hasStore, requireStore, setLocalStore, setRemoteStore } from '../storage/storageManager.js';
|
|
47
47
|
import { cancelScheduledRehydrates, clearAllEntityStores, hydrateAll, patchFromChange } from '../storage/rehydrate.js';
|
|
48
48
|
import { mergeAdopted } from '../storage/adopt.js';
|
|
49
49
|
import { readRemoteDescriptors, startWasSync } from '../storage/wasSync.js';
|
|
@@ -68,10 +68,10 @@ import { useSyncStatusStore } from '../storage/syncStatusStore.js';
|
|
|
68
68
|
export function createAuthStore({ config, registry, seedStore, storage }) {
|
|
69
69
|
const dbName = config.dbName ?? DEFAULT_DB_NAME;
|
|
70
70
|
const onboarding = config.onboarding ?? DEFAULT_ONBOARDING;
|
|
71
|
-
// Resolve the per-install LWW
|
|
71
|
+
// Resolve the per-install LWW writer id ONCE, honoring the configured
|
|
72
72
|
// localStorage prefix, so every stamp -- the app's own writes and the
|
|
73
73
|
// adoption repair -- carries the same attribution identity.
|
|
74
|
-
const
|
|
74
|
+
const writerId = getWriterId({
|
|
75
75
|
...(config.storageKeyPrefix !== undefined && {
|
|
76
76
|
storageKeyPrefix: config.storageKeyPrefix
|
|
77
77
|
})
|
|
@@ -106,7 +106,7 @@ export function createAuthStore({ config, registry, seedStore, storage }) {
|
|
|
106
106
|
visibility: collection.visibility
|
|
107
107
|
})
|
|
108
108
|
})),
|
|
109
|
-
|
|
109
|
+
appUrl: config.appUrl,
|
|
110
110
|
...(config.sharedCollections && {
|
|
111
111
|
sharedCollections: config.sharedCollections.map(entry => entry.id)
|
|
112
112
|
}),
|
|
@@ -326,7 +326,7 @@ export function createAuthStore({ config, registry, seedStore, storage }) {
|
|
|
326
326
|
});
|
|
327
327
|
setLocalStore(local);
|
|
328
328
|
if (adopt) {
|
|
329
|
-
await mergeAdopted({ store: local, entities: adopt.entities,
|
|
329
|
+
await mergeAdopted({ store: local, entities: adopt.entities, writerId });
|
|
330
330
|
}
|
|
331
331
|
await hydrateAll(registry);
|
|
332
332
|
}
|
|
@@ -789,7 +789,7 @@ export function createAuthStore({ config, registry, seedStore, storage }) {
|
|
|
789
789
|
return {
|
|
790
790
|
status: 'boot',
|
|
791
791
|
onboarding,
|
|
792
|
-
|
|
792
|
+
writerId,
|
|
793
793
|
phase: null,
|
|
794
794
|
error: null,
|
|
795
795
|
controllerDid: null,
|