@dharma-ai-labs/agent-fabric 0.2.109 → 0.2.111
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 +41 -0
- package/dist/codexInboxSession.d.ts +1 -1
- package/dist/cooperativeInboxSession.d.ts +1 -1
- package/dist/demoDeviceTransport.d.ts +33 -0
- package/dist/demoDeviceTransport.d.ts.map +1 -0
- package/dist/demoDeviceTransport.js +52 -0
- package/dist/demoDeviceTransport.js.map +1 -0
- package/dist/demoDeviceTransport.test.d.ts +2 -0
- package/dist/demoDeviceTransport.test.d.ts.map +1 -0
- package/dist/demoDeviceTransport.test.js +178 -0
- package/dist/demoDeviceTransport.test.js.map +1 -0
- package/dist/demoEnrollment.d.ts +2 -1
- package/dist/demoEnrollment.d.ts.map +1 -1
- package/dist/demoEnrollment.js +99 -21
- package/dist/demoEnrollment.js.map +1 -1
- package/dist/demoEnrollment.test.js +288 -2
- package/dist/demoEnrollment.test.js.map +1 -1
- package/dist/demoPackage.js +1 -1
- package/dist/demoPackage.js.map +1 -1
- package/dist/demoSigningTrust.d.ts +24 -0
- package/dist/demoSigningTrust.d.ts.map +1 -0
- package/dist/demoSigningTrust.js +326 -0
- package/dist/demoSigningTrust.js.map +1 -0
- package/dist/demoSigningTrust.test.d.ts +2 -0
- package/dist/demoSigningTrust.test.d.ts.map +1 -0
- package/dist/demoSigningTrust.test.js +445 -0
- package/dist/demoSigningTrust.test.js.map +1 -0
- package/dist/demoSigningUpgradeProof.d.ts +52 -0
- package/dist/demoSigningUpgradeProof.d.ts.map +1 -0
- package/dist/demoSigningUpgradeProof.js +137 -0
- package/dist/demoSigningUpgradeProof.js.map +1 -0
- package/dist/demoSigningUpgradeProof.test.d.ts +2 -0
- package/dist/demoSigningUpgradeProof.test.d.ts.map +1 -0
- package/dist/demoSigningUpgradeProof.test.js +564 -0
- package/dist/demoSigningUpgradeProof.test.js.map +1 -0
- package/dist/demoSigningUpgradeSubmission.d.ts +21 -0
- package/dist/demoSigningUpgradeSubmission.d.ts.map +1 -0
- package/dist/demoSigningUpgradeSubmission.js +178 -0
- package/dist/demoSigningUpgradeSubmission.js.map +1 -0
- package/dist/demoSupervisor.d.ts.map +1 -1
- package/dist/demoSupervisor.js +2 -1
- package/dist/demoSupervisor.js.map +1 -1
- package/dist/demoSupervisor.test.js +35 -0
- package/dist/demoSupervisor.test.js.map +1 -1
- package/dist/demoTransportCommand.test.d.ts +2 -0
- package/dist/demoTransportCommand.test.d.ts.map +1 -0
- package/dist/demoTransportCommand.test.js +28 -0
- package/dist/demoTransportCommand.test.js.map +1 -0
- package/dist/demoTransportContinuity.d.ts +39 -0
- package/dist/demoTransportContinuity.d.ts.map +1 -0
- package/dist/demoTransportContinuity.js +82 -0
- package/dist/demoTransportContinuity.js.map +1 -0
- package/dist/demoTransportContinuity.test.d.ts +2 -0
- package/dist/demoTransportContinuity.test.d.ts.map +1 -0
- package/dist/demoTransportContinuity.test.js +145 -0
- package/dist/demoTransportContinuity.test.js.map +1 -0
- package/dist/demoTransportFetch.d.ts +12 -0
- package/dist/demoTransportFetch.d.ts.map +1 -0
- package/dist/demoTransportFetch.js +109 -0
- package/dist/demoTransportFetch.js.map +1 -0
- package/dist/demoTransportFetch.test.d.ts +2 -0
- package/dist/demoTransportFetch.test.d.ts.map +1 -0
- package/dist/demoTransportFetch.test.js +150 -0
- package/dist/demoTransportFetch.test.js.map +1 -0
- package/dist/demoTransportRequest.d.ts +35 -0
- package/dist/demoTransportRequest.d.ts.map +1 -0
- package/dist/demoTransportRequest.js +193 -0
- package/dist/demoTransportRequest.js.map +1 -0
- package/dist/demoTransportRequest.test.d.ts +2 -0
- package/dist/demoTransportRequest.test.d.ts.map +1 -0
- package/dist/demoTransportRequest.test.js +203 -0
- package/dist/demoTransportRequest.test.js.map +1 -0
- package/dist/demoTransportState.d.ts +31 -0
- package/dist/demoTransportState.d.ts.map +1 -0
- package/dist/demoTransportState.js +204 -0
- package/dist/demoTransportState.js.map +1 -0
- package/dist/demoTransportState.test.d.ts +2 -0
- package/dist/demoTransportState.test.d.ts.map +1 -0
- package/dist/demoTransportState.test.js +192 -0
- package/dist/demoTransportState.test.js.map +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +46 -13
- package/dist/index.js.map +1 -1
- package/dist/providerSessionReplyRecovery.d.ts +1 -1
- package/dist/relaySupervisor.test.js +3 -1
- package/dist/relaySupervisor.test.js.map +1 -1
- package/dist/schemas/demo-enrollment-approval.schema.json +19 -0
- package/dist/schemas/demo-signing-update.schema.json +18 -0
- package/dist/schemas/demo-transport-continuity.schema.json +27 -0
- package/dist/schemas/demo-transport-journal.schema.json +13 -0
- package/dist/schemas/demo-transport-request.schema.json +27 -0
- package/dist/schemas/demo-transport-state.schema.json +13 -0
- package/dist/schemas/lifecycle-event.schema.json +178 -0
- package/dist/schemas/signing-upgrade-context.schema.json +28 -0
- package/dist/schemas/signing-upgrade-source.schema.json +32 -0
- package/dist/usage.d.ts +1 -1
- package/dist/usage.d.ts.map +1 -1
- package/dist/usage.js +1 -1
- package/dist/usage.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -31,6 +31,47 @@ is sent. An acknowledged message proves delivery, not that the recipient agent
|
|
|
31
31
|
used or correctly applied the answer. The Demo peer transport is separate from
|
|
32
32
|
the signed package, knowledge, Atlas, and autonomous-update readiness gates.
|
|
33
33
|
|
|
34
|
+
## Signing Upgrade Proof Preparation
|
|
35
|
+
|
|
36
|
+
For a reviewed Demo signing-consumer upgrade, an operator supplies the bounded
|
|
37
|
+
`dharma.signing-upgrade-context/v1` review JSON for the exact organization and
|
|
38
|
+
repository. It identifies the candidate, predecessor, installed preload hash,
|
|
39
|
+
unchanged original-client inventory, current and requested consumer versions,
|
|
40
|
+
and a proof expiry no more than 15 minutes away. This file is a review request,
|
|
41
|
+
not authorization. Never put a grant, credential or private key in it.
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
dharma demo signing-client-proof --organization-id <org> --repository-id <repo> --normalized-repository <normalized-remote> --review-context <review.json>
|
|
45
|
+
dharma demo signing-client-proof --organization-id <org> --repository-id <repo> --normalized-repository <normalized-remote> --review-context <review.json> --submit
|
|
46
|
+
dharma demo signing-owner-proof --organization-id <org> --repository-id <repo> --normalized-repository <normalized-remote> --review-context <review.json>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
`--submit` records only an original enrolled client's signing-upgrade proof. It
|
|
50
|
+
uses the existing device key and still-valid protected preload, verifies the
|
|
51
|
+
exact server receipt, and preserves the same pending proof for a grant-free
|
|
52
|
+
retry after a lost response. Run the same command with the same review context
|
|
53
|
+
to resume; do not delete the pending proof or change trust files. A recorded
|
|
54
|
+
proof is not activation. Owner proofs still require explicit ordinary-session
|
|
55
|
+
browser review; `signing-owner-proof --submit` is rejected. Expired trust requires
|
|
56
|
+
browser-authorized re-enrollment, not a locally extended anchor.
|
|
57
|
+
|
|
58
|
+
Both commands verify the current Git remote, use the existing enrolled device
|
|
59
|
+
and protected, still-valid preload, and read versions from the actual installed
|
|
60
|
+
CLI/contracts packages. `--dry-run` verifies the repository scope and reports
|
|
61
|
+
only a plan; it does not attest installed trust or issue a signature.
|
|
62
|
+
|
|
63
|
+
Without `--submit`, the JSON result has `stage: "proof_prepared"` and
|
|
64
|
+
`submitted: false`. It contains
|
|
65
|
+
the device signature and source hash, not enrollment credentials. Preparing an
|
|
66
|
+
owner proof does not prove owner authority or approve rotation: the current
|
|
67
|
+
owner must separately review and confirm it in the ordinary browser session.
|
|
68
|
+
The server must independently check current access, preload and inventory for
|
|
69
|
+
every submitted source and final registration. Only client `--submit` sends the
|
|
70
|
+
proof. Neither command rotates or activates keys, extends trust, replaces an original client, alters
|
|
71
|
+
financial records, or bypass browser approval. Missing OS credentials or a
|
|
72
|
+
missing protected signing anchor fail without recreating them. Expired trust requires supported
|
|
73
|
+
browser-authorized re-enrollment, never editing local trust files.
|
|
74
|
+
|
|
34
75
|
## Autonomous organization setup
|
|
35
76
|
|
|
36
77
|
Requires Node.js 22.20.0 through 24.x.
|
|
@@ -20,7 +20,7 @@ export declare function openCodexInboxSession(input: Parameters<typeof openCodex
|
|
|
20
20
|
questionId: string;
|
|
21
21
|
taskId: string;
|
|
22
22
|
completionHash: string;
|
|
23
|
-
reasonCode: "
|
|
23
|
+
reasonCode: "receipt_invalid" | "content_or_contract_blocked" | "delivery_unconfirmed";
|
|
24
24
|
replyReceiptHash?: undefined;
|
|
25
25
|
correlationId?: undefined;
|
|
26
26
|
} | {
|
|
@@ -42,7 +42,7 @@ export declare function openCooperativeInboxSession(input: {
|
|
|
42
42
|
questionId: string;
|
|
43
43
|
taskId: string;
|
|
44
44
|
completionHash: string;
|
|
45
|
-
reasonCode: "
|
|
45
|
+
reasonCode: "receipt_invalid" | "content_or_contract_blocked" | "delivery_unconfirmed";
|
|
46
46
|
replyReceiptHash?: undefined;
|
|
47
47
|
correlationId?: undefined;
|
|
48
48
|
} | {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type SecureSecretStore } from '@dharma-ai-labs/agent-fabric-relay-client';
|
|
2
|
+
import { type DemoDeviceScope } from './demoEnrollment.js';
|
|
3
|
+
export declare function createDemoDeviceTransport(input: DemoDeviceScope, deps?: {
|
|
4
|
+
store?: SecureSecretStore;
|
|
5
|
+
fetcher?: typeof fetch;
|
|
6
|
+
}): Promise<{
|
|
7
|
+
store: SecureSecretStore;
|
|
8
|
+
fetcher: typeof fetch;
|
|
9
|
+
connectTransport: (target: string) => Promise<{
|
|
10
|
+
ok: boolean;
|
|
11
|
+
stage: "demo_transport_verified";
|
|
12
|
+
enrolled: boolean;
|
|
13
|
+
duplicate: boolean;
|
|
14
|
+
deviceId: string;
|
|
15
|
+
repositoryId: string;
|
|
16
|
+
transportOrigin: string;
|
|
17
|
+
expiresAt: string;
|
|
18
|
+
resumed: boolean;
|
|
19
|
+
correlationId?: undefined;
|
|
20
|
+
} | {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
stage: "demo_transport_verified";
|
|
23
|
+
enrolled: boolean;
|
|
24
|
+
duplicate: boolean;
|
|
25
|
+
deviceId: string;
|
|
26
|
+
repositoryId: string;
|
|
27
|
+
transportOrigin: string;
|
|
28
|
+
expiresAt: string;
|
|
29
|
+
correlationId: string;
|
|
30
|
+
resumed: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
}>;
|
|
33
|
+
//# sourceMappingURL=demoDeviceTransport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demoDeviceTransport.d.ts","sourceRoot":"","sources":["../src/demoDeviceTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAG/H,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAWjF,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,eAAe,EACpE,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,KAAK,CAAA;CAAO;;;+BAuBxB,MAAM;;;;;;;;;;;;;;;;;;;;;;;GAY/C"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { loadOrCreateDeviceIdentity, normalizeHqUrl } from '@dharma-ai-labs/agent-fabric-relay-client';
|
|
2
|
+
import { createSystemSecureStore } from '@dharma-ai-labs/agent-fabric-secure-store';
|
|
3
|
+
import { sign } from 'node:crypto';
|
|
4
|
+
import { loadDemoSigningTrust } from './demoEnrollment.js';
|
|
5
|
+
import { createDemoTransportFetcher } from './demoTransportFetch.js';
|
|
6
|
+
import { requestDemoTransportContinuity } from './demoTransportRequest.js';
|
|
7
|
+
function immutableIdentity() {
|
|
8
|
+
throw Object.assign(new Error('Demo transport requires existing_protected_state_required. Preserve the original enrollment.'), { code: 'demo_transport_existing_protected_state_required' });
|
|
9
|
+
}
|
|
10
|
+
// Invoke within withDemoDeviceLock. Keep all config paths and private-key
|
|
11
|
+
// accounts on the original enrollment origin, even when HTTP moves elsewhere.
|
|
12
|
+
export async function createDemoDeviceTransport(input, deps = {}) {
|
|
13
|
+
const scope = structuredClone(input), enrollmentOrigin = normalizeHqUrl(scope.hqUrl);
|
|
14
|
+
const store = deps.store ?? await createSystemSecureStore();
|
|
15
|
+
const fresh = (account) => store.getFresh ? store.getFresh(account) : store.get(account);
|
|
16
|
+
const readOnly = { backend: store.backend, get: fresh, getFresh: fresh,
|
|
17
|
+
async put() { immutableIdentity(); }, async delete() { immutableIdentity(); } };
|
|
18
|
+
const identity = await loadOrCreateDeviceIdentity({ hqUrl: enrollmentOrigin,
|
|
19
|
+
organizationId: `${scope.organizationId}:${scope.repositoryId}`, installationId: scope.installationId, store: readOnly });
|
|
20
|
+
const operationStore = { backend: store.backend, get: fresh, getFresh: fresh,
|
|
21
|
+
async put(account, value) { if (account === identity.account)
|
|
22
|
+
immutableIdentity(); await store.put(account, value); },
|
|
23
|
+
async delete(account) { if (account === identity.account)
|
|
24
|
+
immutableIdentity(); await store.delete(account); } };
|
|
25
|
+
const initial = await loadDemoSigningTrust(scope, { store: operationStore });
|
|
26
|
+
const loadBinding = async (protectedStore) => {
|
|
27
|
+
const trust = await loadDemoSigningTrust(scope, { store: protectedStore });
|
|
28
|
+
const currentIdentity = await loadOrCreateDeviceIdentity({ hqUrl: enrollmentOrigin,
|
|
29
|
+
organizationId: `${scope.organizationId}:${scope.repositoryId}`,
|
|
30
|
+
installationId: scope.installationId, store: protectedStore });
|
|
31
|
+
if (trust.deviceId !== initial.deviceId || currentIdentity.publicKeyEd25519 !== identity.publicKeyEd25519)
|
|
32
|
+
immutableIdentity();
|
|
33
|
+
return { organizationId: scope.organizationId, repositoryId: scope.repositoryId,
|
|
34
|
+
deviceId: trust.deviceId, installationId: scope.installationId,
|
|
35
|
+
publicKeyEd25519: currentIdentity.publicKeyEd25519, enrollmentOrigin,
|
|
36
|
+
protectedKeyset: trust.keyset, minimumPolicyRevision: 1 };
|
|
37
|
+
};
|
|
38
|
+
const connectTransport = async (target) => requestDemoTransportContinuity(await loadBinding(readOnly), target, {
|
|
39
|
+
store: operationStore, fetcher: deps.fetcher, loadBinding: () => loadBinding(readOnly),
|
|
40
|
+
sign: async (payload) => {
|
|
41
|
+
const current = await loadOrCreateDeviceIdentity({ hqUrl: enrollmentOrigin,
|
|
42
|
+
organizationId: `${scope.organizationId}:${scope.repositoryId}`, installationId: scope.installationId, store: readOnly });
|
|
43
|
+
if (current.publicKeyEd25519 !== identity.publicKeyEd25519)
|
|
44
|
+
immutableIdentity();
|
|
45
|
+
return sign(null, Buffer.from(payload), { key: current.privateJwk, format: 'jwk' }).toString('base64url');
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
const fetcher = createDemoTransportFetcher({ store: operationStore, fetcher: deps.fetcher, loadBinding,
|
|
49
|
+
refresh: (_binding, target) => connectTransport(target) });
|
|
50
|
+
return { store: operationStore, fetcher, connectTransport };
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=demoDeviceTransport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demoDeviceTransport.js","sourceRoot":"","sources":["../src/demoDeviceTransport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,0BAA0B,EAAE,cAAc,EAA0B,MAAM,2CAA2C,CAAC;AAC/H,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,oBAAoB,EAAwB,MAAM,qBAAqB,CAAC;AACjF,OAAO,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,8BAA8B,EAAE,MAAM,2BAA2B,CAAC;AAE3E,SAAS,iBAAiB;IACxB,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,8FAA8F,CAAC,EAC3H,EAAE,IAAI,EAAE,kDAAkD,EAAE,CAAC,CAAC;AAClE,CAAC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import { generateKeyPairSync } from 'node:crypto';
|
|
3
|
+
import { mkdtemp, readFile, rm } from 'node:fs/promises';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
5
|
+
import { resolve } from 'node:path';
|
|
6
|
+
import test from 'node:test';
|
|
7
|
+
import { canonicalize, sha256, signCanonicalObject } from '@dharma-ai-labs/agent-fabric-contracts';
|
|
8
|
+
import { connectDemoDevice, scopePath, verifyDemoDevice } from './demoEnrollment.js';
|
|
9
|
+
import { createDemoDeviceTransport } from './demoDeviceTransport.js';
|
|
10
|
+
import { acceptDemoTransport } from './demoTransportState.js';
|
|
11
|
+
async function fixture(t) {
|
|
12
|
+
const stateRoot = await mkdtemp(resolve(tmpdir(), 'dharma-device-transport-'));
|
|
13
|
+
t.after(() => rm(stateRoot, { recursive: true, force: true }));
|
|
14
|
+
const scope = { hqUrl: 'https://original.example', organizationId: 'org_fixture',
|
|
15
|
+
repositoryId: '10000000-0000-4000-8000-000000000001', normalizedRepository: 'github.com/example/private',
|
|
16
|
+
installationId: '40000000-0000-4000-8000-000000000001', stateRoot };
|
|
17
|
+
const deviceId = '30000000-0000-4000-8000-000000000001', signer = generateKeyPairSync('ed25519');
|
|
18
|
+
const issuedAt = new Date(Date.now() - 60_000).toISOString(), expiresAt = new Date(Date.now() + 24 * 60 * 60_000).toISOString();
|
|
19
|
+
const unsigned = { schema: 'dharma.server-signing-keyset/v1', organizationId: scope.organizationId,
|
|
20
|
+
generation: 1, signedByKeyVersion: 'original', issuedAt, expiresAt,
|
|
21
|
+
keys: [{ keyVersion: 'original', publicKeyEd25519: signer.publicKey.export({ format: 'jwk' }).x,
|
|
22
|
+
status: 'active', notBefore: issuedAt, notAfter: expiresAt }] };
|
|
23
|
+
const keyset = { ...unsigned, signature: signCanonicalObject(unsigned, signer.privateKey) };
|
|
24
|
+
const values = new Map();
|
|
25
|
+
const store = { backend: 'linux-secret-service',
|
|
26
|
+
async get(account) { return values.get(account) ?? null; },
|
|
27
|
+
async getFresh(account) { return values.get(account) ?? null; },
|
|
28
|
+
async put(account, value) { values.set(account, value); },
|
|
29
|
+
async delete(account) { values.delete(account); } };
|
|
30
|
+
const calls = [];
|
|
31
|
+
const fetcher = async (resource) => {
|
|
32
|
+
const url = new URL(String(resource));
|
|
33
|
+
calls.push(url.toString());
|
|
34
|
+
if (url.pathname.endsWith('/enrollments'))
|
|
35
|
+
return Response.json({ ok: true, status: 'pending',
|
|
36
|
+
organizationId: scope.organizationId, repositoryId: scope.repositoryId, deviceCode: 'B'.repeat(43),
|
|
37
|
+
expiresAt: new Date(Date.now() + 60_000).toISOString(), verificationUri: `${scope.hqUrl}/demo/fabric/approve?orgId=${scope.organizationId}&repositoryId=${scope.repositoryId}&code=ABCDEF0123456789ABCD` }, { status: 202 });
|
|
38
|
+
if (url.pathname.endsWith('/poll'))
|
|
39
|
+
return Response.json({ ok: true, status: 'approved', deviceId,
|
|
40
|
+
repositoryId: scope.repositoryId, serverPublicKeyEd25519: unsigned.keys[0].publicKeyEd25519, serverSigningKeyset: keyset });
|
|
41
|
+
return Response.json({ ok: true, organizationId: scope.organizationId, repositoryId: scope.repositoryId,
|
|
42
|
+
deviceId, normalizedRepository: scope.normalizedRepository });
|
|
43
|
+
};
|
|
44
|
+
await connectDemoDevice({ ...scope, grant: 'A'.repeat(43), deviceName: 'Fixture', platform: 'linux', maximumWaitMs: 1000 }, { store, fetcher });
|
|
45
|
+
calls.length = 0;
|
|
46
|
+
const config = JSON.parse(await readFile(scopePath(scope, scope.hqUrl), 'utf8'));
|
|
47
|
+
const binding = { organizationId: scope.organizationId, repositoryId: scope.repositoryId, deviceId,
|
|
48
|
+
installationId: scope.installationId, publicKeyEd25519: config.publicKeyEd25519,
|
|
49
|
+
enrollmentOrigin: scope.hqUrl, protectedKeyset: keyset, minimumPolicyRevision: 1 };
|
|
50
|
+
const target = 'https://corrected.example', now = new Date();
|
|
51
|
+
const body = { schema: 'dharma.demo-transport-continuity/v1', purpose: 'same-authority-repository-transport',
|
|
52
|
+
organizationId: binding.organizationId, repositoryId: binding.repositoryId, deviceId,
|
|
53
|
+
installationId: binding.installationId, publicKeyEd25519: binding.publicKeyEd25519,
|
|
54
|
+
enrollmentOrigin: scope.hqUrl, transportOrigin: target, requestNonce: 'N'.repeat(32), policyRevision: 2,
|
|
55
|
+
trustGeneration: 1, installedKeysetHash: sha256(canonicalize(keyset)), signingKeyVersion: 'original',
|
|
56
|
+
issuedAt: now.toISOString(), expiresAt: new Date(now.getTime() + 600_000).toISOString() };
|
|
57
|
+
return { scope, store, fetcher, calls, values, config, binding, target,
|
|
58
|
+
issue: async (resource, init) => {
|
|
59
|
+
calls.push(String(resource));
|
|
60
|
+
const request = JSON.parse(String(init?.body)), now = new Date();
|
|
61
|
+
const issued = { ...body, ...request, issuedAt: now.toISOString(), expiresAt: new Date(now.getTime() + 600_000).toISOString() };
|
|
62
|
+
const correlationId = new Headers(init?.headers).get('x-dharma-correlation-id');
|
|
63
|
+
return Response.json({ ok: true, certificate: { ...issued, signature: signCanonicalObject(issued, signer.privateKey) },
|
|
64
|
+
duplicate: false, correlationId }, { headers: { 'x-dharma-correlation-id': correlationId } });
|
|
65
|
+
},
|
|
66
|
+
shortCertificate: () => {
|
|
67
|
+
const issued = { ...body, expiresAt: new Date(Date.now() + 30_000).toISOString() };
|
|
68
|
+
return { ...issued, signature: signCanonicalObject(issued, signer.privateKey) };
|
|
69
|
+
},
|
|
70
|
+
certificate: { ...body, signature: signCanonicalObject(body, signer.privateKey) } };
|
|
71
|
+
}
|
|
72
|
+
test('enrolled status resolves the new transport under original config/key accounts and keeps its sequence', async (t) => {
|
|
73
|
+
const f = await fixture(t), enrollmentRecords = new Map(f.values);
|
|
74
|
+
await acceptDemoTransport(f.certificate, f.binding, { transportOrigin: f.target, requestNonce: f.certificate.requestNonce }, { store: f.store });
|
|
75
|
+
const deps = await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: f.fetcher });
|
|
76
|
+
await verifyDemoDevice(f.scope, deps);
|
|
77
|
+
assert.equal(f.calls.length, 1);
|
|
78
|
+
assert.equal(new URL(f.calls[0]).origin, f.target);
|
|
79
|
+
const config = JSON.parse(await readFile(scopePath(f.scope, f.scope.hqUrl), 'utf8'));
|
|
80
|
+
for (const field of ['hqUrl', 'deviceId', 'installationId', 'publicKeyEd25519', 'enrolledAt'])
|
|
81
|
+
assert.equal(config[field], f.config[field]);
|
|
82
|
+
assert.equal(config.nextSequence, f.config.nextSequence + 1);
|
|
83
|
+
for (const [account, value] of enrollmentRecords)
|
|
84
|
+
assert.equal(f.values.get(account), value);
|
|
85
|
+
});
|
|
86
|
+
test('ordinary unmapped status keeps its original origin and signing behavior', async (t) => {
|
|
87
|
+
const f = await fixture(t), before = [...f.values];
|
|
88
|
+
await verifyDemoDevice(f.scope, await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: f.fetcher }));
|
|
89
|
+
assert.equal(new URL(f.calls[0]).origin, f.scope.hqUrl);
|
|
90
|
+
assert.deepEqual([...f.values], before);
|
|
91
|
+
});
|
|
92
|
+
test('a missing or corrupted enrolled identity never generates a replacement', async (t) => {
|
|
93
|
+
const f = await fixture(t);
|
|
94
|
+
const identityAccount = [...f.values].find(([, value]) => value.includes('"d":'))[0];
|
|
95
|
+
for (const value of [null, 'corrupted']) {
|
|
96
|
+
if (value === null)
|
|
97
|
+
f.values.delete(identityAccount);
|
|
98
|
+
else
|
|
99
|
+
f.values.set(identityAccount, value);
|
|
100
|
+
const before = [...f.values];
|
|
101
|
+
await assert.rejects(createDemoDeviceTransport(f.scope, { store: f.store, fetcher: f.fetcher }));
|
|
102
|
+
assert.deepEqual([...f.values], before);
|
|
103
|
+
}
|
|
104
|
+
assert.equal(f.calls.length, 0);
|
|
105
|
+
});
|
|
106
|
+
test('operation dependencies prohibit replacement of the original identity while retaining trust-update capability', async (t) => {
|
|
107
|
+
const f = await fixture(t), before = [...f.values];
|
|
108
|
+
const identityAccount = [...f.values].find(([, value]) => value.includes('"d":'))[0];
|
|
109
|
+
const deps = await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: f.fetcher });
|
|
110
|
+
await assert.rejects(deps.store.put(identityAccount, 'replacement'), /existing_protected_state_required/);
|
|
111
|
+
await assert.rejects(deps.store.delete(identityAccount), /existing_protected_state_required/);
|
|
112
|
+
assert.deepEqual([...f.values], before);
|
|
113
|
+
});
|
|
114
|
+
test('lost status responses resume the same original pending request after transport setup restarts', async (t) => {
|
|
115
|
+
const f = await fixture(t), before = new Map(f.values), sequences = [];
|
|
116
|
+
await acceptDemoTransport(f.certificate, f.binding, { transportOrigin: f.target, requestNonce: f.certificate.requestNonce }, { store: f.store });
|
|
117
|
+
let lost = false;
|
|
118
|
+
const network = async (resource, init) => {
|
|
119
|
+
assert.equal(new URL(String(resource)).origin, f.target);
|
|
120
|
+
sequences.push(new Headers(init?.headers).get('x-dharma-sequence'));
|
|
121
|
+
const response = await f.fetcher(resource, init);
|
|
122
|
+
if (!lost) {
|
|
123
|
+
lost = true;
|
|
124
|
+
throw new TypeError('Fixture response lost after acceptance');
|
|
125
|
+
}
|
|
126
|
+
return response;
|
|
127
|
+
};
|
|
128
|
+
await assert.rejects(verifyDemoDevice(f.scope, await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: network })), /response lost/);
|
|
129
|
+
const pendingPath = `${scopePath(f.scope, f.scope.hqUrl)}.pending-status.json`;
|
|
130
|
+
const pending = JSON.parse(await readFile(pendingPath, 'utf8'));
|
|
131
|
+
assert.equal(new URL(pending.url).origin, f.scope.hqUrl);
|
|
132
|
+
await verifyDemoDevice(f.scope, await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: network }));
|
|
133
|
+
assert.deepEqual(sequences, [String(f.config.nextSequence), String(f.config.nextSequence)]);
|
|
134
|
+
const after = JSON.parse(await readFile(scopePath(f.scope, f.scope.hqUrl), 'utf8'));
|
|
135
|
+
assert.equal(after.nextSequence, f.config.nextSequence + 1);
|
|
136
|
+
for (const [account, value] of before)
|
|
137
|
+
assert.equal(f.values.get(account), value);
|
|
138
|
+
await assert.rejects(readFile(pendingPath), { code: 'ENOENT' });
|
|
139
|
+
});
|
|
140
|
+
test('grant-free issuance cannot consume the business sequence, and pending status resumes unchanged', async (t) => {
|
|
141
|
+
const f = await fixture(t), before = new Map(f.values), sequences = [];
|
|
142
|
+
let lost = true;
|
|
143
|
+
const network = async (resource, init) => {
|
|
144
|
+
if (String(resource).includes('/transport-continuity'))
|
|
145
|
+
return f.issue(resource, init);
|
|
146
|
+
sequences.push(new Headers(init?.headers).get('x-dharma-sequence'));
|
|
147
|
+
if (lost) {
|
|
148
|
+
lost = false;
|
|
149
|
+
throw new TypeError('Fixture status response lost');
|
|
150
|
+
}
|
|
151
|
+
return f.fetcher(resource, init);
|
|
152
|
+
};
|
|
153
|
+
await assert.rejects(verifyDemoDevice(f.scope, await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: network })), /response lost/);
|
|
154
|
+
const pendingPath = `${scopePath(f.scope, f.scope.hqUrl)}.pending-status.json`;
|
|
155
|
+
const pendingBefore = await readFile(pendingPath, 'utf8');
|
|
156
|
+
const deps = await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: network });
|
|
157
|
+
await deps.connectTransport(f.target);
|
|
158
|
+
assert.equal(await readFile(pendingPath, 'utf8'), pendingBefore);
|
|
159
|
+
assert.equal(JSON.parse(await readFile(scopePath(f.scope, f.scope.hqUrl), 'utf8')).nextSequence, f.config.nextSequence);
|
|
160
|
+
await verifyDemoDevice(f.scope, deps);
|
|
161
|
+
assert.deepEqual(sequences, [String(f.config.nextSequence), String(f.config.nextSequence)]);
|
|
162
|
+
assert.equal(JSON.parse(await readFile(scopePath(f.scope, f.scope.hqUrl), 'utf8')).nextSequence, f.config.nextSequence + 1);
|
|
163
|
+
for (const [account, value] of before)
|
|
164
|
+
assert.equal(f.values.get(account), value);
|
|
165
|
+
});
|
|
166
|
+
test('routine status refreshes near-expiry transport autonomously before unchanged signed work', async (t) => {
|
|
167
|
+
const f = await fixture(t), before = new Map(f.values);
|
|
168
|
+
await acceptDemoTransport(f.shortCertificate(), f.binding, { transportOrigin: f.target, requestNonce: f.certificate.requestNonce }, { store: f.store });
|
|
169
|
+
const network = (resource, init) => String(resource).includes('/transport-continuity') ? f.issue(resource, init) : f.fetcher(resource, init);
|
|
170
|
+
await verifyDemoDevice(f.scope, await createDemoDeviceTransport(f.scope, { store: f.store, fetcher: network }));
|
|
171
|
+
assert.equal(f.calls.length, 2);
|
|
172
|
+
assert.ok(f.calls[0].includes('/transport-continuity'));
|
|
173
|
+
assert.ok(f.calls[1].includes('/status'));
|
|
174
|
+
assert.equal(JSON.parse(await readFile(scopePath(f.scope, f.scope.hqUrl), 'utf8')).nextSequence, f.config.nextSequence + 1);
|
|
175
|
+
for (const [account, value] of before)
|
|
176
|
+
assert.equal(f.values.get(account), value);
|
|
177
|
+
});
|
|
178
|
+
//# sourceMappingURL=demoDeviceTransport.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"demoDeviceTransport.test.js","sourceRoot":"","sources":["../src/demoDeviceTransport.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,IAA0B,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAEnG,OAAO,EAAE,iBAAiB,EAAE,SAAS,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACrF,OAAO,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AA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AM,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAE,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC;IACrG,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IAC5H,KAAK,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,MAAM;QAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC,CAAC;AACpF,CAAC,CAAC,CAAC"}
|
package/dist/demoEnrollment.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type SecureSecretStore } from '@dharma-ai-labs/agent-fabric-relay-client';
|
|
2
2
|
import { type TrustedServerSigningKeyset } from '@dharma-ai-labs/agent-fabric-contracts';
|
|
3
|
+
import { type DemoSigningDependencies } from './demoSigningTrust.js';
|
|
3
4
|
export interface DemoDeviceConnectOptions {
|
|
4
5
|
hqUrl: string;
|
|
5
6
|
organizationId: string;
|
|
@@ -21,7 +22,7 @@ export interface DemoDeviceConnectDependencies {
|
|
|
21
22
|
expectedAcceptedSequence?: number;
|
|
22
23
|
}
|
|
23
24
|
export declare function scopePath(input: DemoDeviceScope, origin: string): string;
|
|
24
|
-
export declare function loadDemoSigningTrust(input: DemoDeviceScope): Promise<{
|
|
25
|
+
export declare function loadDemoSigningTrust(input: DemoDeviceScope, deps?: DemoSigningDependencies): Promise<{
|
|
25
26
|
publicKey: import("crypto").KeyObject;
|
|
26
27
|
keyset: TrustedServerSigningKeyset;
|
|
27
28
|
deviceId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"demoEnrollment.d.ts","sourceRoot":"","sources":["../src/demoEnrollment.ts"],"names":[],"mappings":"AAGA,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC/H,OAAO,EAAoC,KAAK,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"demoEnrollment.d.ts","sourceRoot":"","sources":["../src/demoEnrollment.ts"],"names":[],"mappings":"AAGA,OAAO,EAA8C,KAAK,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC/H,OAAO,EAAoC,KAAK,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AAC3H,OAAO,EAAkF,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAMrJ,MAAM,WAAW,wBAAwB;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,OAAO,CAAC;IAChD,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,wBAAwB,EACzD,OAAO,GAAG,gBAAgB,GAAG,cAAc,GAAG,sBAAsB,GAAG,gBAAgB,GAAG,WAAW,CAAC,CAAC;AAkBzG,MAAM,WAAW,6BAA6B;IAC5C,KAAK,CAAC,EAAE,iBAAiB,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;IACvB,KAAK,CAAC,EAAE,CAAC,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