@ddtcorex/dsh-maestro-core 0.15.1 → 0.16.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 +7 -7
- package/assets/icon.svg +4 -0
- package/cordis.patch.yml +0 -12
- package/lib/client.js +3 -1744
- package/lib/health-poller.js +1 -1
- package/lib/self-kill-guard.d.ts +25 -8
- package/lib/self-kill-guard.js +81 -27
- package/lib/types/client/config/components/BrandMark.d.ts +3 -3
- package/lib/types/client/index.d.ts.map +1 -1
- package/locale/en.json +6 -0
- package/package.json +9 -5
- package/src/client/config/components/BrandMark.tsx +3 -3
- package/src/client/index.tsx +0 -2
- package/src/host/health-poller.ts +1 -1
- package/src/host/self-kill-guard.ts +84 -26
- package/lib/sync/backup-config.d.ts +0 -55
- package/lib/sync/backup-config.js +0 -119
- package/lib/sync/backup-service.d.ts +0 -123
- package/lib/sync/backup-service.js +0 -486
- package/lib/sync/bidirectional.d.ts +0 -39
- package/lib/sync/bidirectional.js +0 -25
- package/lib/sync/cli.d.ts +0 -38
- package/lib/sync/cli.js +0 -528
- package/lib/sync/config.d.ts +0 -59
- package/lib/sync/config.js +0 -72
- package/lib/sync/fingerprint.d.ts +0 -29
- package/lib/sync/fingerprint.js +0 -65
- package/lib/sync/hashing.d.ts +0 -22
- package/lib/sync/hashing.js +0 -77
- package/lib/sync/index.d.ts +0 -6
- package/lib/sync/index.js +0 -619
- package/lib/sync/machine-id.d.ts +0 -29
- package/lib/sync/machine-id.js +0 -66
- package/lib/sync/merge.d.ts +0 -31
- package/lib/sync/merge.js +0 -86
- package/lib/sync/peer-host.d.ts +0 -22
- package/lib/sync/peer-host.js +0 -62
- package/lib/sync/process-runner.d.ts +0 -31
- package/lib/sync/process-runner.js +0 -161
- package/lib/sync/remote-agent.d.ts +0 -41
- package/lib/sync/remote-agent.js +0 -216
- package/lib/sync/remote-cache.d.ts +0 -18
- package/lib/sync/remote-cache.js +0 -60
- package/lib/sync/remote-manifest.d.ts +0 -20
- package/lib/sync/remote-manifest.js +0 -86
- package/lib/sync/s3-object-store.d.ts +0 -38
- package/lib/sync/s3-object-store.js +0 -126
- package/lib/sync/session-plan.d.ts +0 -29
- package/lib/sync/session-plan.js +0 -213
- package/lib/sync/sigv4.d.ts +0 -20
- package/lib/sync/sigv4.js +0 -57
- package/lib/sync/snapshot.d.ts +0 -16
- package/lib/sync/snapshot.js +0 -143
- package/lib/sync/ssh-mux.d.ts +0 -12
- package/lib/sync/ssh-mux.js +0 -48
- package/lib/sync/store-root.d.ts +0 -44
- package/lib/sync/store-root.js +0 -67
- package/lib/sync/sync-plan.d.ts +0 -24
- package/lib/sync/sync-plan.js +0 -366
- package/lib/sync/sync-service.d.ts +0 -183
- package/lib/sync/sync-service.js +0 -926
- package/lib/sync/sync-types.d.ts +0 -87
- package/lib/sync/sync-types.js +0 -1
- package/lib/sync/transport.d.ts +0 -75
- package/lib/sync/transport.js +0 -196
- package/lib/sync/tunnel-restore.d.ts +0 -77
- package/lib/sync/tunnel-restore.js +0 -142
- package/lib/sync/validation.d.ts +0 -12
- package/lib/sync/validation.js +0 -96
- package/lib/types/client/sync/R2SyncPanel.d.ts +0 -6
- package/lib/types/client/sync/R2SyncPanel.d.ts.map +0 -1
- package/lib/types/client/sync/SyncPanel.d.ts +0 -12
- package/lib/types/client/sync/SyncPanel.d.ts.map +0 -1
- package/lib/types/client/sync/confirm-dialog.d.ts +0 -43
- package/lib/types/client/sync/confirm-dialog.d.ts.map +0 -1
- package/lib/types/client/sync/index.d.ts +0 -10
- package/lib/types/client/sync/index.d.ts.map +0 -1
- package/lib/types/client/sync/ui.d.ts +0 -75
- package/lib/types/client/sync/ui.d.ts.map +0 -1
- package/lib/types/client/sync/use-backup.d.ts +0 -50
- package/lib/types/client/sync/use-backup.d.ts.map +0 -1
- package/lib/types/client/sync/use-sync.d.ts +0 -88
- package/lib/types/client/sync/use-sync.d.ts.map +0 -1
- package/src/client/sync/R2SyncPanel.tsx +0 -260
- package/src/client/sync/SyncPanel.tsx +0 -422
- package/src/client/sync/confirm-dialog.tsx +0 -202
- package/src/client/sync/index.tsx +0 -286
- package/src/client/sync/ui.tsx +0 -297
- package/src/client/sync/use-backup.ts +0 -207
- package/src/client/sync/use-sync.ts +0 -502
- package/src/host/sync/backup-config.ts +0 -158
- package/src/host/sync/backup-service.ts +0 -506
- package/src/host/sync/bidirectional.ts +0 -66
- package/src/host/sync/cli.ts +0 -530
- package/src/host/sync/config.ts +0 -96
- package/src/host/sync/fingerprint.ts +0 -83
- package/src/host/sync/hashing.ts +0 -91
- package/src/host/sync/index.ts +0 -697
- package/src/host/sync/machine-id.ts +0 -81
- package/src/host/sync/merge.ts +0 -99
- package/src/host/sync/peer-host.ts +0 -65
- package/src/host/sync/process-runner.ts +0 -177
- package/src/host/sync/remote-agent.ts +0 -212
- package/src/host/sync/remote-cache.ts +0 -68
- package/src/host/sync/remote-manifest.ts +0 -91
- package/src/host/sync/s3-object-store.ts +0 -144
- package/src/host/sync/session-plan.ts +0 -237
- package/src/host/sync/sigv4.ts +0 -81
- package/src/host/sync/snapshot.ts +0 -132
- package/src/host/sync/ssh-mux.ts +0 -55
- package/src/host/sync/store-root.ts +0 -83
- package/src/host/sync/sync-plan.ts +0 -366
- package/src/host/sync/sync-service.ts +0 -960
- package/src/host/sync/sync-types.ts +0 -102
- package/src/host/sync/transport.ts +0 -256
- package/src/host/sync/tunnel-restore.ts +0 -160
- package/src/host/sync/validation.ts +0 -104
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// src/host/remote-cache.ts — remote stat-keyed fingerprint cache (fp.tsv).
|
|
2
|
-
//
|
|
3
|
-
// The REMOTE-side counterpart of the local fingerprint index (§4.2, spec §4.7
|
|
4
|
-
// clarification, operator decision C 2026-09-02). It is a pure speed hint:
|
|
5
|
-
// - the manifest script READS fp.tsv and skips sha256sum when the file's
|
|
6
|
-
// ino+size+mtimeNs+ctimeNs triple matches (GNU stat %.Y/%.Z ns fractions);
|
|
7
|
-
// - preview NEVER writes it — only push-apply or an explicit warm command runs
|
|
8
|
-
// buildWarmCacheScript, which hashes misses and atomically renames the cache.
|
|
9
|
-
// Exactness never depends on the cache: a miss re-hashes; every write target is
|
|
10
|
-
// verified by CAS at publish.
|
|
11
|
-
import { normalizeEligiblePath } from './validation.js';
|
|
12
|
-
|
|
13
|
-
export const REMOTE_CACHE_REL = '.maestro-sync/fp.tsv';
|
|
14
|
-
|
|
15
|
-
export function remoteCachePath(dshRoot: string): string {
|
|
16
|
-
return `${dshRoot}/${REMOTE_CACHE_REL}`;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface FpCacheEntry {
|
|
20
|
-
ino: number;
|
|
21
|
-
size: number;
|
|
22
|
-
mtimeNs: string;
|
|
23
|
-
ctimeNs: string;
|
|
24
|
-
sha256: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** Parse fp.tsv lines: `rel<TAB>ino<TAB>size<TAB>mtimeNs<TAB>ctimeNs<TAB>sha256`. */
|
|
28
|
-
export function parseFpCache(buf: Buffer): Map<string, FpCacheEntry> {
|
|
29
|
-
const out = new Map<string, FpCacheEntry>();
|
|
30
|
-
for (const line of buf.toString('utf-8').split('\n')) {
|
|
31
|
-
if (!line.trim()) continue;
|
|
32
|
-
const [rel, inoRaw, sizeRaw, mtimeNs, ctimeNs, sha256] = line.split('\t');
|
|
33
|
-
if (!rel || !sha256) continue;
|
|
34
|
-
try {
|
|
35
|
-
normalizeEligiblePath(rel);
|
|
36
|
-
} catch {
|
|
37
|
-
continue;
|
|
38
|
-
}
|
|
39
|
-
const ino = Number(inoRaw);
|
|
40
|
-
const size = Number(sizeRaw);
|
|
41
|
-
if (!Number.isFinite(ino) || !Number.isFinite(size)) continue;
|
|
42
|
-
out.set(rel, { ino, size, mtimeNs, ctimeNs, sha256 });
|
|
43
|
-
}
|
|
44
|
-
return out;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Warm script: re-hash every eligible file fresh and rewrite fp.tsv atomically
|
|
49
|
-
* (tmp + rename). Run ONLY from the push-apply path or an explicit warm
|
|
50
|
-
* command — never from preview. One stat batch via xargs keeps fork counts low;
|
|
51
|
-
* `set -- $st` splits the four stat fields (none contain whitespace).
|
|
52
|
-
*/
|
|
53
|
-
export function buildWarmCacheScript(dshRoot: string): string {
|
|
54
|
-
const cache = remoteCachePath(dshRoot);
|
|
55
|
-
return [
|
|
56
|
-
`mkdir -p "${dshRoot}/.maestro-sync";`,
|
|
57
|
-
`find ${dshRoot}/maestro-memory ${dshRoot}/sessions`,
|
|
58
|
-
`\\( -name node_modules -o -name .git -o -name .supervisor -o -name profiles \\) -prune -o -type f -print0`,
|
|
59
|
-
`| xargs -0 stat --printf='%i %s %.Y %.Z\\t%n\\0' 2>/dev/null`,
|
|
60
|
-
`| while IFS= read -r -d '' rec; do`,
|
|
61
|
-
`st=\${rec%%$'\\t'*}; abs=\${rec#*$'\\t'}; rel=\${abs#${dshRoot}/};`,
|
|
62
|
-
`set -- $st;`,
|
|
63
|
-
`sha=$(sha256sum -- "${dshRoot}/$rel" 2>/dev/null | awk '{print $1}');`,
|
|
64
|
-
`printf '%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' "$rel" "$1" "$2" "$3" "$4" "$sha";`,
|
|
65
|
-
`done > "${cache}.tmp.$$";`,
|
|
66
|
-
`mv "${cache}.tmp.$$" "${cache}";`,
|
|
67
|
-
].join(' ');
|
|
68
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
// src/host/remote-manifest.ts — one-pass remote inventory of eligible files.
|
|
2
|
-
//
|
|
3
|
-
// The fixed remote script walks only the eligible subtrees (same prune rules
|
|
4
|
-
// as transport.list), emits "sha<TAB>size<TAB>mtime<TAB>rel\0" per file, and
|
|
5
|
-
// the parser validates every relative path via normalizeEligiblePath before it
|
|
6
|
-
// can enter a plan. NUL framing keeps any discovered name safe on the wire;
|
|
7
|
-
// the parser sorts deterministically. mtimeSec is informational only — it is
|
|
8
|
-
// never an equality proof (equality uses sha256+size).
|
|
9
|
-
import { normalizeEligiblePath } from './validation.js';
|
|
10
|
-
import { remoteCachePath } from './remote-cache.js';
|
|
11
|
-
|
|
12
|
-
export interface RemoteManifestEntry {
|
|
13
|
-
path: string;
|
|
14
|
-
sha256: string;
|
|
15
|
-
size: number;
|
|
16
|
-
mtimeSec: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Raised when the peer has not moved its store to the 4.0 root yet.
|
|
21
|
-
*
|
|
22
|
-
* Before this guard the peer's `find` simply matched nothing, the plan read as
|
|
23
|
-
* "the peer has no memory", and the next push would have looked like the first
|
|
24
|
-
* one. A named refusal is worth more than a silent empty inventory.
|
|
25
|
-
*/
|
|
26
|
-
export class StoreNotMigratedError extends Error {
|
|
27
|
-
readonly code = 'STORE_NOT_MIGRATED'
|
|
28
|
-
constructor(readonly remotePath: string) {
|
|
29
|
-
super(`remote store not migrated: ${remotePath} has no migrated-v4 marker; run the new build on that machine first`)
|
|
30
|
-
this.name = 'StoreNotMigratedError'
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export function buildRemoteManifestScript(dshRoot: string): string {
|
|
35
|
-
// Fixed script; dshRoot is the validated absolute root (same trust rule as transport.list).
|
|
36
|
-
// Cache-aware, READ-ONLY (spec §4.7 clarification, decision C): it consults
|
|
37
|
-
// <root>/.maestro-sync/fp.tsv and reuses a cached sha256 when the file's
|
|
38
|
-
// ino+size+mtimeNs+ctimeNs triple (GNU stat '%.Y'/'%.Z' ns fractions) still
|
|
39
|
-
// matches, skipping sha256sum for unchanged files. The cache is loaded ONCE
|
|
40
|
-
// in a single awk pass, read straight from the file inside awk (getline — a
|
|
41
|
-
// `-v cache=...` copy exceeds the 128 KiB per-arg limit once fp.tsv grows,
|
|
42
|
-
// E2BIG "Argument list too long", measured 2026-09-02); only MISS records are
|
|
43
|
-
// sha256sum'd in the bash loop. NEVER writes.
|
|
44
|
-
// Every loop-body statement must end with ';' — space-separated assignments
|
|
45
|
-
// inside a `do...done` one-liner break bash's parser (verified 2026-09-02).
|
|
46
|
-
const cache = remoteCachePath(dshRoot);
|
|
47
|
-
return [
|
|
48
|
-
// Preflight sentinel: no 4.0 marker means the peer still holds the old
|
|
49
|
-
// root, so an empty inventory must not be mistaken for an empty store.
|
|
50
|
-
`if [ ! -f ${dshRoot}/maestro-memory/.maestro-memory/migrated-v4 ] && [ -d ${dshRoot}/dsh-maestro-memory ]; then printf 'STORE_NOT_MIGRATED\\t0\\t0\\t%s\\0' ${dshRoot}/dsh-maestro-memory; exit 0; fi;`,
|
|
51
|
-
`find ${dshRoot}/maestro-memory ${dshRoot}/sessions`,
|
|
52
|
-
`\\( -name node_modules -o -name .git -o -name .supervisor -o -name profiles \\) -prune -o -type f -print0`,
|
|
53
|
-
`| xargs -0 stat --printf='%i %s %.Y %.Z\\t%n\\n' 2>/dev/null`,
|
|
54
|
-
`| awk -F '\\t' -v root='${dshRoot}/' -v cachefile='${cache}' 'BEGIN{while((getline line < cachefile) > 0){if(line=="")continue; m=split(line,a,"\\t"); if(m>=6){c[a[1]]=(a[2]" "a[3]" "a[4]" "a[5])"\\t"a[6]"\\t"a[3]"\\t"a[4];}} close(cachefile);} {st=$1; rel=$2; sub(root,"",rel); if(rel in c){split(c[rel],e,"\\t"); if(e[1]==st){print "H\\t"rel"\\t"e[2]"\\t"e[3]"\\t"e[4]; next;}} print "M\\t"rel"\\t"st;}'`,
|
|
55
|
-
`| while IFS= read -r rec; do`,
|
|
56
|
-
`tag=\${rec%%$'\\t'*}; rest=\${rec#*$'\\t'};`,
|
|
57
|
-
`if [ "$tag" = "H" ]; then`,
|
|
58
|
-
`rel=\${rest%%$'\\t'*}; rest=\${rest#*$'\\t'}; sha=\${rest%%$'\\t'*}; rest=\${rest#*$'\\t'}; size=\${rest%%$'\\t'*}; mtime=\${rest#*$'\\t'};`,
|
|
59
|
-
`printf '%s\\t%s\\t%s\\t%s\\0' "$sha" "$size" "$mtime" "$rel";`,
|
|
60
|
-
`else`,
|
|
61
|
-
`rel=\${rest%%$'\\t'*}; st=\${rest#*$'\\t'};`,
|
|
62
|
-
`sha=$(sha256sum -- "${dshRoot}/$rel" 2>/dev/null | awk '{print $1}');`,
|
|
63
|
-
`set -- $st;`,
|
|
64
|
-
`printf '%s\\t%s\\t%s\\t%s\\0' "$sha" "$2" "$3" "$rel";`,
|
|
65
|
-
`fi;`,
|
|
66
|
-
`done`,
|
|
67
|
-
].join(' ');
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export function parseRemoteManifest(buf: Buffer): RemoteManifestEntry[] {
|
|
71
|
-
const out: RemoteManifestEntry[] = [];
|
|
72
|
-
const parts = buf.toString('utf-8').split('\0');
|
|
73
|
-
for (const part of parts) {
|
|
74
|
-
if (!part) continue;
|
|
75
|
-
if (part.startsWith('STORE_NOT_MIGRATED\t')) {
|
|
76
|
-
throw new StoreNotMigratedError(part.split('\t').slice(3).join('\t'));
|
|
77
|
-
}
|
|
78
|
-
const [sha, sizeRaw, mtimeRaw, ...rest] = part.split('\t');
|
|
79
|
-
const p = rest.join('\t');
|
|
80
|
-
const size = Number(sizeRaw);
|
|
81
|
-
const mtimeSec = Number(mtimeRaw);
|
|
82
|
-
if (!sha || !p || !Number.isFinite(size) || !Number.isFinite(mtimeSec)) continue;
|
|
83
|
-
try {
|
|
84
|
-
normalizeEligiblePath(p);
|
|
85
|
-
} catch {
|
|
86
|
-
continue; // ineligible — never enters the plan
|
|
87
|
-
}
|
|
88
|
-
out.push({ path: p, sha256: sha, size, mtimeSec });
|
|
89
|
-
}
|
|
90
|
-
return out.sort((a, b) => a.path.localeCompare(b.path));
|
|
91
|
-
}
|
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
// src/host/s3-object-store.ts — dependency-free S3 object store client
|
|
2
|
-
// (SigV4 + global fetch) for Cloudflare R2 / AWS S3 backup (spec §5.2).
|
|
3
|
-
//
|
|
4
|
-
// Path-style URLs ({endpoint}/{bucket}/{key}) work for R2, AWS (with
|
|
5
|
-
// forcePathStyle) and the hermetic fake. ETag is a CAS token, stripped of the
|
|
6
|
-
// wrapping quotes S3 returns; content integrity lives in SHA-256 (blob keys +
|
|
7
|
-
// manifest metadata), never in the ETag (multipart/encryption break it).
|
|
8
|
-
import * as fsMod from 'node:fs';
|
|
9
|
-
import * as path from 'node:path';
|
|
10
|
-
import { sha256Hex, signRequest } from './sigv4.js';
|
|
11
|
-
|
|
12
|
-
export interface S3Config {
|
|
13
|
-
endpoint: string;
|
|
14
|
-
region: string;
|
|
15
|
-
accessKeyId: string;
|
|
16
|
-
secretAccessKey: string;
|
|
17
|
-
timeoutMs?: number;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface S3ListEntry {
|
|
21
|
-
key: string;
|
|
22
|
-
size: number;
|
|
23
|
-
lastModified: string;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export interface S3HeadResult {
|
|
27
|
-
size: number;
|
|
28
|
-
etag: string; // quotes stripped — a CAS token, not a content checksum
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const EMPTY_SHA = sha256Hex('');
|
|
32
|
-
|
|
33
|
-
export class S3ObjectStore {
|
|
34
|
-
constructor(private readonly cfg: S3Config, private readonly f: typeof fetch = fetch) {}
|
|
35
|
-
|
|
36
|
-
private async request(
|
|
37
|
-
method: string,
|
|
38
|
-
bucket: string,
|
|
39
|
-
key: string,
|
|
40
|
-
opts: { query?: string; body?: Buffer; etag?: string; ifNoneMatch?: boolean } = {},
|
|
41
|
-
): Promise<{ status: number; headers: Record<string, string>; body: Buffer }> {
|
|
42
|
-
const url = `${this.cfg.endpoint}/${bucket}${key ? '/' + key : ''}${opts.query ? '?' + opts.query : ''}`;
|
|
43
|
-
const host = new URL(this.cfg.endpoint).host;
|
|
44
|
-
const bodySha = opts.body ? sha256Hex(opts.body) : EMPTY_SHA;
|
|
45
|
-
const headers: Record<string, string> = { 'Content-Type': 'application/octet-stream' };
|
|
46
|
-
if (opts.body) headers['Content-Length'] = String(opts.body.length);
|
|
47
|
-
if (opts.etag) headers['If-Match'] = opts.etag;
|
|
48
|
-
if (opts.ifNoneMatch) headers['If-None-Match'] = '*';
|
|
49
|
-
const signed = signRequest({
|
|
50
|
-
method, host, path: `/${bucket}${key ? '/' + key : ''}`, query: opts.query,
|
|
51
|
-
headers, bodySha256: bodySha,
|
|
52
|
-
region: this.cfg.region, service: 's3',
|
|
53
|
-
accessKeyId: this.cfg.accessKeyId, secretAccessKey: this.cfg.secretAccessKey,
|
|
54
|
-
now: new Date(),
|
|
55
|
-
});
|
|
56
|
-
const controller = new AbortController();
|
|
57
|
-
const timer = setTimeout(() => controller.abort(), this.cfg.timeoutMs ?? 30_000);
|
|
58
|
-
try {
|
|
59
|
-
const res = await this.f(url, {
|
|
60
|
-
method,
|
|
61
|
-
headers: { ...headers, Authorization: signed.authorization, 'X-Amz-Date': signed.amzDate, 'X-Amz-Content-Sha256': signed.xAmzContentSha256 },
|
|
62
|
-
// Buffer satisfies BodyInit at runtime (undici accepts it); the TS overloads
|
|
63
|
-
// only admit Blob/string/URLSearchParams/ArrayBuffer — cast is intentional.
|
|
64
|
-
body: (opts.body as unknown as BodyInit) ?? undefined,
|
|
65
|
-
signal: controller.signal,
|
|
66
|
-
});
|
|
67
|
-
if (res.status === 412) {
|
|
68
|
-
return { status: 412, headers: {}, body: Buffer.alloc(0) };
|
|
69
|
-
}
|
|
70
|
-
if (res.status === 404 && method !== 'DELETE') {
|
|
71
|
-
return { status: 404, headers: {}, body: Buffer.alloc(0) };
|
|
72
|
-
}
|
|
73
|
-
if (res.status < 200 || res.status > 299) {
|
|
74
|
-
throw Object.assign(new Error(`S3 ${method} ${key} failed: ${res.status}`), { phase: 'backup', code: 'S3_ERROR' });
|
|
75
|
-
}
|
|
76
|
-
const body = Buffer.from(await res.arrayBuffer());
|
|
77
|
-
return { status: res.status, headers: Object.fromEntries(res.headers.entries()) as Record<string, string>, body };
|
|
78
|
-
} finally {
|
|
79
|
-
clearTimeout(timer);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
async list(bucket: string, prefix: string): Promise<S3ListEntry[]> {
|
|
84
|
-
const out: S3ListEntry[] = [];
|
|
85
|
-
let token: string | undefined;
|
|
86
|
-
for (;;) {
|
|
87
|
-
const q = `list-type=2&prefix=${encodeURIComponent(prefix)}&max-keys=1000${token ? `&continuation-token=${encodeURIComponent(token)}` : ''}`;
|
|
88
|
-
const r = await this.request('GET', bucket, '', { query: q });
|
|
89
|
-
const xml = r.body.toString('utf-8');
|
|
90
|
-
const keys = [...xml.matchAll(/<Contents><Key>([^<]+)<\/Key><Size>(\d+)<\/Size><LastModified>([^<]+)<\/LastModified>/g)];
|
|
91
|
-
for (const m of keys) out.push({ key: m[1]!, size: Number(m[2]!), lastModified: m[3]! });
|
|
92
|
-
if (!xml.includes('<IsTruncated>true</IsTruncated>')) break;
|
|
93
|
-
const next = xml.match(/<NextContinuationToken>([^<]+)<\/NextContinuationToken>/)?.[1];
|
|
94
|
-
if (!next) break;
|
|
95
|
-
token = next;
|
|
96
|
-
}
|
|
97
|
-
return out;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
async head(bucket: string, key: string): Promise<S3HeadResult | null> {
|
|
101
|
-
const r = await this.request('HEAD', bucket, key);
|
|
102
|
-
if (r.status === 404) return null;
|
|
103
|
-
const etag = (r.headers['etag'] ?? '""').replace(/"/g, '');
|
|
104
|
-
return { size: Number(r.headers['content-length'] ?? 0), etag };
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
async get(bucket: string, key: string, destDir: string): Promise<S3HeadResult> {
|
|
108
|
-
const r = await this.request('GET', bucket, key);
|
|
109
|
-
const full = path.join(destDir, key);
|
|
110
|
-
fsMod.mkdirSync(path.dirname(full), { recursive: true });
|
|
111
|
-
fsMod.writeFileSync(full, r.body);
|
|
112
|
-
return { size: r.body.length, etag: (r.headers['etag'] ?? '""').replace(/"/g, '') };
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* If-None-Match:* put — idempotent blob semantics: a 412 (already present)
|
|
117
|
-
* is a silent no-op because blobs are content-addressed (same key ⇒ same
|
|
118
|
-
* bytes), so a retry never corrupts.
|
|
119
|
-
*/
|
|
120
|
-
async putIfAbsent(bucket: string, key: string, body: Buffer): Promise<void> {
|
|
121
|
-
const r = await this.request('PUT', bucket, key, { body, ifNoneMatch: true });
|
|
122
|
-
if (r.status === 412) return;
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/** CAS put: If-Match (or If-None-Match when the object must be absent); a 412 ⇒ CONCURRENT_MODIFICATION. */
|
|
126
|
-
async putConditional(bucket: string, key: string, body: Buffer, opts: { ifMatch?: string; ifNoneMatch?: boolean } = {}): Promise<void> {
|
|
127
|
-
const r = await this.request('PUT', bucket, key, { body, etag: opts.ifMatch, ifNoneMatch: opts.ifNoneMatch });
|
|
128
|
-
if (r.status === 412) {
|
|
129
|
-
throw Object.assign(new Error(`CONCURRENT_MODIFICATION: ${key}`), { phase: 'backup', code: 'CONCURRENT_MODIFICATION', detail: key });
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
/** Batched DeleteObjects (≤1000 keys per request). */
|
|
134
|
-
async deleteKeys(bucket: string, keys: string[]): Promise<void> {
|
|
135
|
-
for (let i = 0; i < keys.length; i += 1000) {
|
|
136
|
-
const batch = keys.slice(i, i + 1000);
|
|
137
|
-
const xml = `<?xml version="1.0"?><Delete>${batch
|
|
138
|
-
.map((k) => `<Object><Key>${k.replace(/&/g, '&').replace(/</g, '<')}</Key></Object>`)
|
|
139
|
-
.join('')}<Quiet>false</Quiet></Delete>`;
|
|
140
|
-
const r = await this.request('POST', bucket, '', { query: 'delete', body: Buffer.from(xml) });
|
|
141
|
-
if (r.status !== 200) throw Object.assign(new Error(`DeleteObjects failed: ${r.status}`), { phase: 'gc', code: 'S3_ERROR' });
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
}
|
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Binary-safe session planning for DSH Zstd artifacts.
|
|
3
|
-
* Bytes remain bytes: .jsonl.zstd is staged and merged only through validated Zstd artifact API.
|
|
4
|
-
* Session handling is Buffer/path-only and preserves DSH standalone checksummed Zstd header frame.
|
|
5
|
-
*/
|
|
6
|
-
import { constants, zstdCompressSync, zstdDecompressSync } from 'node:zlib';
|
|
7
|
-
|
|
8
|
-
const ZSTD_MAGIC = 0xFD2FB528;
|
|
9
|
-
const ZSTD_CHECKSUM_OPTIONS = {
|
|
10
|
-
params: { [constants.ZSTD_c_checksumFlag]: 1 },
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export interface SessionIdentity {
|
|
14
|
-
/** decompressed header line Buffer (UTF-8 without trailing newline) */
|
|
15
|
-
header: Buffer;
|
|
16
|
-
sessionId: string;
|
|
17
|
-
cwd: string;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface ZstdFrameRange {
|
|
21
|
-
start: number;
|
|
22
|
-
end: number;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/** Locate complete Zstd frames, throwing on corrupt/truncated structure. Never converts Zstd bytes to string. */
|
|
26
|
-
function scanZstdFrames(source: Buffer): ZstdFrameRange[] {
|
|
27
|
-
const frames: ZstdFrameRange[] = [];
|
|
28
|
-
let offset = 0;
|
|
29
|
-
|
|
30
|
-
while (offset < source.length) {
|
|
31
|
-
const start = offset;
|
|
32
|
-
if (source.length - offset < 4 || source.readUInt32LE(offset) !== ZSTD_MAGIC) {
|
|
33
|
-
throw new Error('corrupt Zstandard session artifact');
|
|
34
|
-
}
|
|
35
|
-
if (source.length - offset < 5) {
|
|
36
|
-
throw new Error('incomplete Zstandard frame header');
|
|
37
|
-
}
|
|
38
|
-
offset += 4;
|
|
39
|
-
const descriptor = source.readUInt8(offset++);
|
|
40
|
-
if ((descriptor & 0x18) !== 0) throw new Error('corrupt Zstandard frame descriptor');
|
|
41
|
-
|
|
42
|
-
const contentSizeFlag = descriptor >>> 6;
|
|
43
|
-
const singleSegment = (descriptor & 0x20) !== 0;
|
|
44
|
-
const dictionaryFlag = descriptor & 0x03;
|
|
45
|
-
const dictionaryBytes = dictionaryFlag === 3 ? 4 : dictionaryFlag;
|
|
46
|
-
const contentSizeBytes = contentSizeFlag === 0 ? (singleSegment ? 1 : 0) : 1 << contentSizeFlag;
|
|
47
|
-
const frameHeaderBytes = (singleSegment ? 0 : 1) + dictionaryBytes + contentSizeBytes;
|
|
48
|
-
if (source.length - offset < frameHeaderBytes) throw new Error('incomplete Zstandard frame header');
|
|
49
|
-
offset += frameHeaderBytes;
|
|
50
|
-
|
|
51
|
-
for (;;) {
|
|
52
|
-
if (source.length - offset < 3) throw new Error('incomplete Zstandard frame block');
|
|
53
|
-
const blockHeader = source.readUIntLE(offset, 3);
|
|
54
|
-
offset += 3;
|
|
55
|
-
const lastBlock = (blockHeader & 1) !== 0;
|
|
56
|
-
const blockType = (blockHeader >>> 1) & 0x03;
|
|
57
|
-
const blockSize = blockHeader >>> 3;
|
|
58
|
-
if (blockType === 3) throw new Error('corrupt Zstandard frame block');
|
|
59
|
-
const payloadBytes = blockType === 1 ? 1 : blockSize;
|
|
60
|
-
if (source.length - offset < payloadBytes) throw new Error('incomplete Zstandard frame payload');
|
|
61
|
-
offset += payloadBytes;
|
|
62
|
-
if (lastBlock) break;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
if ((descriptor & 0x04) !== 0) {
|
|
66
|
-
if (source.length - offset < 4) throw new Error('incomplete Zstandard frame checksum');
|
|
67
|
-
offset += 4;
|
|
68
|
-
}
|
|
69
|
-
frames.push({ start, end: offset });
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
return frames;
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
function parseHeaderLine(headerBytes: Buffer, label: string): { line: string; record: Record<string, unknown> } {
|
|
76
|
-
if (headerBytes.length === 0 || headerBytes[headerBytes.length - 1] !== 0x0A) {
|
|
77
|
-
throw new Error(`${label} session artifact has no standalone header frame`);
|
|
78
|
-
}
|
|
79
|
-
if (headerBytes.indexOf(0x0A) !== headerBytes.length - 1) {
|
|
80
|
-
throw new Error(`${label} session artifact header frame not standalone`);
|
|
81
|
-
}
|
|
82
|
-
const line = headerBytes.subarray(0, -1).toString('utf8');
|
|
83
|
-
let value: unknown;
|
|
84
|
-
try {
|
|
85
|
-
value = JSON.parse(line);
|
|
86
|
-
} catch {
|
|
87
|
-
throw new Error(`${label} session artifact has an invalid session header`);
|
|
88
|
-
}
|
|
89
|
-
const record = value as Record<string, unknown> | null;
|
|
90
|
-
const hasValidInteger = (field: string) => {
|
|
91
|
-
const v = (record as any)?.[field];
|
|
92
|
-
return typeof v === 'number' && Number.isSafeInteger(v) && v >= 0 && !Object.is(v, -0);
|
|
93
|
-
};
|
|
94
|
-
if (
|
|
95
|
-
record === null ||
|
|
96
|
-
typeof record !== 'object' ||
|
|
97
|
-
(record as any).type !== 'session' ||
|
|
98
|
-
typeof (record as any).version !== 'number' ||
|
|
99
|
-
typeof (record as any).id !== 'string' ||
|
|
100
|
-
!hasValidInteger('createdAt') ||
|
|
101
|
-
!hasValidInteger('delegationDepth') ||
|
|
102
|
-
((record as any).origin !== undefined && (record as any).origin !== 'subagent') ||
|
|
103
|
-
((record as any).agentPreset !== undefined && typeof (record as any).agentPreset !== 'string')
|
|
104
|
-
) {
|
|
105
|
-
throw new Error(`${label} session artifact has an invalid session header`);
|
|
106
|
-
}
|
|
107
|
-
if ((record as any).cwd !== undefined && typeof (record as any).cwd !== 'string') {
|
|
108
|
-
throw new Error(`${label} session artifact has an invalid session header`);
|
|
109
|
-
}
|
|
110
|
-
return { line, record: record as Record<string, unknown> };
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* Validates Zstd header frame and extracts identity.
|
|
115
|
-
* - Validates Zstd magic and frame structure via checksum-aware decompression.
|
|
116
|
-
* - Decompresses only the first frame (standalone header) and validates JSONL header.
|
|
117
|
-
* - Never converts raw Zstd bytes to UTF-8 string.
|
|
118
|
-
*/
|
|
119
|
-
export function parseSessionIdentity(buffer: Buffer): SessionIdentity {
|
|
120
|
-
if (!Buffer.isBuffer(buffer)) throw new Error('session buffer must be Buffer');
|
|
121
|
-
if (buffer.length === 0) throw new Error('empty session buffer');
|
|
122
|
-
if (buffer.length < 4) throw new Error('corrupt Zstandard session artifact');
|
|
123
|
-
if (buffer.readUInt32LE(0) !== ZSTD_MAGIC) throw new Error('corrupt Zstandard session artifact');
|
|
124
|
-
|
|
125
|
-
const frames = scanZstdFrames(buffer);
|
|
126
|
-
if (frames.length === 0) throw new Error('session artifact has no Zstandard frames');
|
|
127
|
-
|
|
128
|
-
let headerBytes: Buffer;
|
|
129
|
-
try {
|
|
130
|
-
headerBytes = zstdDecompressSync(buffer.subarray(frames[0]!.start, frames[0]!.end));
|
|
131
|
-
} catch (e: any) {
|
|
132
|
-
throw new Error(`invalid Zstd header frame: ${e?.message ?? String(e)}`);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
const { line, record } = parseHeaderLine(headerBytes, 'session');
|
|
136
|
-
|
|
137
|
-
const sessionId = String((record as any).id);
|
|
138
|
-
const cwd = typeof (record as any).cwd === 'string' ? String((record as any).cwd) : '';
|
|
139
|
-
const header = Buffer.from(line, 'utf8');
|
|
140
|
-
return { header, sessionId, cwd };
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* Compare header identity, not just path.
|
|
145
|
-
* Returns true if both buffers represent the same session (same id, cwd, and header line).
|
|
146
|
-
*/
|
|
147
|
-
export function isSameSession(a: Buffer, b: Buffer): boolean {
|
|
148
|
-
try {
|
|
149
|
-
const idA = parseSessionIdentity(a);
|
|
150
|
-
const idB = parseSessionIdentity(b);
|
|
151
|
-
return idA.sessionId === idB.sessionId && idA.cwd === idB.cwd && idA.header.equals(idB.header);
|
|
152
|
-
} catch {
|
|
153
|
-
return false;
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
function mergePlaintextLines(localText: string, remoteText: string): { merged: string; added: number } {
|
|
158
|
-
const localLines = String(localText ?? '')
|
|
159
|
-
.split('\n')
|
|
160
|
-
.filter((line) => line.length > 0);
|
|
161
|
-
const remoteLines = String(remoteText ?? '')
|
|
162
|
-
.split('\n')
|
|
163
|
-
.filter((line) => line.length > 0);
|
|
164
|
-
|
|
165
|
-
const seen = new Set<string>(localLines);
|
|
166
|
-
const mergedArr = [...localLines];
|
|
167
|
-
let added = 0;
|
|
168
|
-
|
|
169
|
-
for (const line of remoteLines) {
|
|
170
|
-
if (!seen.has(line)) {
|
|
171
|
-
seen.add(line);
|
|
172
|
-
mergedArr.push(line);
|
|
173
|
-
added++;
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
const merged = mergedArr.length > 0 ? mergedArr.join('\n') + '\n' : '';
|
|
178
|
-
return { merged, added };
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
/**
|
|
182
|
-
* Merge two valid session buffers via binary path and return merged Buffer with added count.
|
|
183
|
-
* - Validates both buffers via validated Zstd artifact API (checksum, header frame).
|
|
184
|
-
* - Preserves DSH standalone checksummed Zstd header frame (first frame is header alone).
|
|
185
|
-
* - Never converts Zstd bytes to UTF-8 string; only decompressed plaintext is stringified for line union.
|
|
186
|
-
* - Throws if headers differ (conflict) or either buffer is invalid/truncated.
|
|
187
|
-
*/
|
|
188
|
-
export function mergeSessionBuffers(local: Buffer, remote: Buffer): { merged: Buffer; added: number } {
|
|
189
|
-
const localId = parseSessionIdentity(local);
|
|
190
|
-
const remoteId = parseSessionIdentity(remote);
|
|
191
|
-
|
|
192
|
-
if (localId.sessionId !== remoteId.sessionId || localId.cwd !== remoteId.cwd || !localId.header.equals(remoteId.header)) {
|
|
193
|
-
throw new Error('cannot merge session buffers with different headers');
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
const localFrames = scanZstdFrames(local);
|
|
197
|
-
const remoteFrames = scanZstdFrames(remote);
|
|
198
|
-
|
|
199
|
-
const localPlainBufs: Buffer[] = [];
|
|
200
|
-
for (const f of localFrames) {
|
|
201
|
-
try {
|
|
202
|
-
localPlainBufs.push(zstdDecompressSync(local.subarray(f.start, f.end)));
|
|
203
|
-
} catch (e: any) {
|
|
204
|
-
throw new Error(`local session decompress failed: ${e?.message ?? String(e)}`);
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
const remotePlainBufs: Buffer[] = [];
|
|
208
|
-
for (const f of remoteFrames) {
|
|
209
|
-
try {
|
|
210
|
-
remotePlainBufs.push(zstdDecompressSync(remote.subarray(f.start, f.end)));
|
|
211
|
-
} catch (e: any) {
|
|
212
|
-
throw new Error(`remote session decompress failed: ${e?.message ?? String(e)}`);
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
const localText = Buffer.concat(localPlainBufs).toString('utf8');
|
|
217
|
-
const remoteText = Buffer.concat(remotePlainBufs).toString('utf8');
|
|
218
|
-
|
|
219
|
-
const { merged, added } = mergePlaintextLines(localText, remoteText);
|
|
220
|
-
|
|
221
|
-
if (added === 0) {
|
|
222
|
-
return { merged: local, added: 0 };
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
const headerLine = localId.header.toString('utf8');
|
|
226
|
-
if (!merged.startsWith(headerLine + '\n')) {
|
|
227
|
-
throw new Error('merged session artifact lost its header');
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
const body = merged.slice(headerLine.length + 1);
|
|
231
|
-
const frames: Buffer[] = [zstdCompressSync(headerLine + '\n', ZSTD_CHECKSUM_OPTIONS as any)];
|
|
232
|
-
if (body.length > 0) {
|
|
233
|
-
frames.push(zstdCompressSync(body, ZSTD_CHECKSUM_OPTIONS as any));
|
|
234
|
-
}
|
|
235
|
-
const mergedBuf = Buffer.concat(frames);
|
|
236
|
-
return { merged: mergedBuf, added };
|
|
237
|
-
}
|
package/src/host/sync/sigv4.ts
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
// src/host/sigv4.ts — AWS Signature Version 4 (S3 service) with zero deps.
|
|
2
|
-
//
|
|
3
|
-
// Computes the canonical request, the string-to-sign, and the signing key
|
|
4
|
-
// chain exactly per the AWS docs; the pinned known-answer test keeps it honest.
|
|
5
|
-
// ETag is a CAS/version token, never a content checksum — our content
|
|
6
|
-
// integrity lives in SHA-256 (blob keys + manifest metadata).
|
|
7
|
-
import { createHash, createHmac } from 'node:crypto';
|
|
8
|
-
|
|
9
|
-
export function sha256Hex(data: string | Buffer): string {
|
|
10
|
-
return createHash('sha256').update(data).digest('hex');
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
function hmac(key: Buffer, data: string): Buffer {
|
|
14
|
-
return createHmac('sha256', key).update(data).digest();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
function isoDate(d: Date): string {
|
|
18
|
-
return d.toISOString().replace(/[-:]/g, '').replace(/\.\d{3}Z$/, 'Z'); // YYYYMMDDTHHMMSSZ
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function scopeDate(d: Date): string {
|
|
22
|
-
return isoDate(d).slice(0, 8);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface SignRequestOpts {
|
|
26
|
-
method: string;
|
|
27
|
-
host: string;
|
|
28
|
-
path: string;
|
|
29
|
-
query?: string;
|
|
30
|
-
headers: Record<string, string>;
|
|
31
|
-
bodySha256: string;
|
|
32
|
-
region: string;
|
|
33
|
-
service: string;
|
|
34
|
-
accessKeyId: string;
|
|
35
|
-
secretAccessKey: string;
|
|
36
|
-
now: Date;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface SignedRequest {
|
|
40
|
-
authorization: string;
|
|
41
|
-
amzDate: string;
|
|
42
|
-
xAmzContentSha256: string;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
export function signRequest(opts: SignRequestOpts): SignedRequest {
|
|
46
|
-
const amzDate = isoDate(opts.now);
|
|
47
|
-
const date = scopeDate(opts.now);
|
|
48
|
-
const raw: Record<string, string> = {
|
|
49
|
-
host: opts.host,
|
|
50
|
-
'x-amz-content-sha256': opts.bodySha256,
|
|
51
|
-
'x-amz-date': amzDate,
|
|
52
|
-
...opts.headers,
|
|
53
|
-
};
|
|
54
|
-
// Signed headers are lower-cased; look up through a normalized map so mixed
|
|
55
|
-
// case (e.g. 'Content-Length') never hits an undefined value.
|
|
56
|
-
const headers: Record<string, string> = {};
|
|
57
|
-
for (const [k, v] of Object.entries(raw)) headers[k.toLowerCase()] = v;
|
|
58
|
-
const signedKeys = Object.keys(headers).sort();
|
|
59
|
-
const canonicalHeaders = signedKeys.map((k) => `${k}:${headers[k]!.trim().replace(/\s+/g, ' ')}\n`).join('');
|
|
60
|
-
const canonicalQuery = (opts.query ?? '').split('&').filter(Boolean).sort().join('&');
|
|
61
|
-
const canonicalRequest = [
|
|
62
|
-
opts.method.toUpperCase(),
|
|
63
|
-
opts.path,
|
|
64
|
-
canonicalQuery,
|
|
65
|
-
canonicalHeaders,
|
|
66
|
-
signedKeys.join(';'),
|
|
67
|
-
opts.bodySha256,
|
|
68
|
-
].join('\n');
|
|
69
|
-
const scope = `${date}/${opts.region}/${opts.service}/aws4_request`;
|
|
70
|
-
const stringToSign = ['AWS4-HMAC-SHA256', amzDate, scope, sha256Hex(canonicalRequest)].join('\n');
|
|
71
|
-
const kDate = hmac(Buffer.from(`AWS4${opts.secretAccessKey}`, 'utf8'), date);
|
|
72
|
-
const kRegion = hmac(kDate, opts.region);
|
|
73
|
-
const kService = hmac(kRegion, opts.service);
|
|
74
|
-
const kSigning = hmac(kService, 'aws4_request');
|
|
75
|
-
const signature = createHmac('sha256', kSigning).update(stringToSign).digest('hex');
|
|
76
|
-
return {
|
|
77
|
-
authorization: `AWS4-HMAC-SHA256 Credential=${opts.accessKeyId}/${scope}, SignedHeaders=${signedKeys.join(';')}, Signature=${signature}`,
|
|
78
|
-
amzDate,
|
|
79
|
-
xAmzContentSha256: opts.bodySha256,
|
|
80
|
-
};
|
|
81
|
-
}
|