@cef-ai/cli 2.9.1 → 4.0.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 +1 -1
- package/dist/commands/eval.d.ts +14 -18
- package/dist/commands/eval.d.ts.map +1 -1
- package/dist/commands/eval.js +78 -99
- package/dist/commands/eval.js.map +1 -1
- package/dist/commands/eval.test.js +124 -43
- package/dist/commands/eval.test.js.map +1 -1
- package/dist/lib/eval-auth.d.ts +1 -124
- package/dist/lib/eval-auth.d.ts.map +1 -1
- package/dist/lib/eval-auth.js +8 -343
- package/dist/lib/eval-auth.js.map +1 -1
- package/dist/lib/eval-vault.d.ts +35 -0
- package/dist/lib/eval-vault.d.ts.map +1 -0
- package/dist/lib/eval-vault.js +54 -0
- package/dist/lib/eval-vault.js.map +1 -0
- package/dist/lib/eval-workflow.d.ts +11 -0
- package/dist/lib/eval-workflow.d.ts.map +1 -1
- package/dist/lib/eval-workflow.js +19 -1
- package/dist/lib/eval-workflow.js.map +1 -1
- package/package.json +6 -8
- package/dist/lib/eval-auth.test.d.ts +0 -2
- package/dist/lib/eval-auth.test.d.ts.map +0 -1
- package/dist/lib/eval-auth.test.js +0 -192
- package/dist/lib/eval-auth.test.js.map +0 -1
- package/dist/lib/eval-store.d.ts +0 -62
- package/dist/lib/eval-store.d.ts.map +0 -1
- package/dist/lib/eval-store.js +0 -334
- package/dist/lib/eval-store.js.map +0 -1
- package/dist/lib/eval-store.test.d.ts +0 -2
- package/dist/lib/eval-store.test.d.ts.map +0 -1
- package/dist/lib/eval-store.test.js +0 -155
- package/dist/lib/eval-store.test.js.map +0 -1
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { mkdtemp, readdir, readFile, rm, stat } from "node:fs/promises";
|
|
2
|
-
import os from "node:os";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { afterEach, beforeEach, describe, expect, it } from "vitest";
|
|
5
|
-
import { CREDENTIAL_REFRESH_MARGIN_MS, ddcTokenCannotOpenStore, fileCredentialCache, mintGatewayCredentials, mintedCredentials, resolveGatewayAccess, } from "./eval-auth.js";
|
|
6
|
-
let dir;
|
|
7
|
-
beforeEach(async () => {
|
|
8
|
-
dir = await mkdtemp(path.join(os.tmpdir(), "cef-eval-auth-"));
|
|
9
|
-
});
|
|
10
|
-
afterEach(async () => {
|
|
11
|
-
await rm(dir, { recursive: true, force: true });
|
|
12
|
-
});
|
|
13
|
-
const HOUR = 3600_000;
|
|
14
|
-
/** A mint that hands out `k1`, `k2`, … each valid for an hour from `now()`. */
|
|
15
|
-
function minter(now) {
|
|
16
|
-
let n = 0;
|
|
17
|
-
const mint = async () => {
|
|
18
|
-
n++;
|
|
19
|
-
return { accessKeyId: `k${n}`, secretAccessKey: `s${n}`, expiresAt: now() + HOUR };
|
|
20
|
-
};
|
|
21
|
-
return { mint, count: () => n };
|
|
22
|
-
}
|
|
23
|
-
describe("a minted credential", () => {
|
|
24
|
-
it("is reused while it has time left, and replaced before it expires", async () => {
|
|
25
|
-
let t = 0;
|
|
26
|
-
const m = minter(() => t);
|
|
27
|
-
const source = mintedCredentials({ mint: m.mint, now: () => t });
|
|
28
|
-
expect((await source.get()).accessKeyId).toBe("k1");
|
|
29
|
-
t = HOUR - CREDENTIAL_REFRESH_MARGIN_MS - 1;
|
|
30
|
-
expect((await source.get()).accessKeyId).toBe("k1");
|
|
31
|
-
// Inside the margin: a long run must not carry it to the gateway's 403.
|
|
32
|
-
t = HOUR - CREDENTIAL_REFRESH_MARGIN_MS + 1;
|
|
33
|
-
expect((await source.get()).accessKeyId).toBe("k2");
|
|
34
|
-
expect(m.count()).toBe(2);
|
|
35
|
-
});
|
|
36
|
-
it("is minted once for callers asking at the same time", async () => {
|
|
37
|
-
const m = minter(() => 0);
|
|
38
|
-
const source = mintedCredentials({ mint: m.mint, now: () => 0 });
|
|
39
|
-
const got = await Promise.all([source.get(), source.get(), source.get()]);
|
|
40
|
-
expect(got.map((c) => c.accessKeyId)).toEqual(["k1", "k1", "k1"]);
|
|
41
|
-
expect(m.count()).toBe(1);
|
|
42
|
-
});
|
|
43
|
-
it("is replaced after the gateway refused it", async () => {
|
|
44
|
-
const m = minter(() => 0);
|
|
45
|
-
const source = mintedCredentials({ mint: m.mint, now: () => 0 });
|
|
46
|
-
await source.get();
|
|
47
|
-
expect(await source.invalidate()).toBe(true);
|
|
48
|
-
expect((await source.get()).accessKeyId).toBe("k2");
|
|
49
|
-
});
|
|
50
|
-
it("is shared between commands through an owner-only cache file", async () => {
|
|
51
|
-
const file = path.join(dir, "nested", "creds.json");
|
|
52
|
-
const t = Date.now();
|
|
53
|
-
const m = minter(() => t);
|
|
54
|
-
const first = mintedCredentials({ mint: m.mint, now: () => t, cache: fileCredentialCache(file, "gw|alice") });
|
|
55
|
-
expect((await first.get()).accessKeyId).toBe("k1");
|
|
56
|
-
// A second command: same gateway and wallet, no new mint.
|
|
57
|
-
const second = mintedCredentials({ mint: m.mint, now: () => t, cache: fileCredentialCache(file, "gw|alice") });
|
|
58
|
-
expect((await second.get()).accessKeyId).toBe("k1");
|
|
59
|
-
expect(m.count()).toBe(1);
|
|
60
|
-
// Another wallet does not get alice's.
|
|
61
|
-
const other = mintedCredentials({ mint: m.mint, now: () => t, cache: fileCredentialCache(file, "gw|bob") });
|
|
62
|
-
expect((await other.get()).accessKeyId).toBe("k2");
|
|
63
|
-
expect((await stat(file)).mode & 0o777).toBe(0o600);
|
|
64
|
-
// A refused credential leaves the cache, so the next command does not pick it up again.
|
|
65
|
-
await second.invalidate();
|
|
66
|
-
expect(Object.keys(JSON.parse(await readFile(file, "utf8")))).toEqual(["gw|bob"]);
|
|
67
|
-
});
|
|
68
|
-
it("keeps every entry when several commands write the cache at once", async () => {
|
|
69
|
-
const file = path.join(dir, "creds.json");
|
|
70
|
-
const expiresAt = Date.now() + HOUR;
|
|
71
|
-
const wallets = Array.from({ length: 8 }, (_, i) => `gw|w${i}`);
|
|
72
|
-
// Each write is a read-modify-write of the whole file; unserialised, they drop each other's entries.
|
|
73
|
-
await Promise.all(wallets.map((k) => fileCredentialCache(file, k).write({ accessKeyId: k, secretAccessKey: "s", expiresAt })));
|
|
74
|
-
expect(Object.keys(JSON.parse(await readFile(file, "utf8"))).sort()).toEqual(wallets);
|
|
75
|
-
expect((await stat(file)).mode & 0o777).toBe(0o600);
|
|
76
|
-
expect((await readdir(dir)).sort()).toEqual(["creds.json"]);
|
|
77
|
-
});
|
|
78
|
-
it("is not reused from the cache when it is about to expire", async () => {
|
|
79
|
-
const file = path.join(dir, "creds.json");
|
|
80
|
-
let t = Date.now();
|
|
81
|
-
const m = minter(() => t);
|
|
82
|
-
await mintedCredentials({ mint: m.mint, now: () => t, cache: fileCredentialCache(file, "k") }).get();
|
|
83
|
-
t += HOUR - CREDENTIAL_REFRESH_MARGIN_MS + 1;
|
|
84
|
-
expect((await mintedCredentials({ mint: m.mint, now: () => t, cache: fileCredentialCache(file, "k") }).get()).accessKeyId).toBe("k2");
|
|
85
|
-
});
|
|
86
|
-
});
|
|
87
|
-
describe("resolving gateway access", () => {
|
|
88
|
-
const signer = { address: "5Alice" };
|
|
89
|
-
it("mints through the source and keeps the bucket the AS pubkey names", async () => {
|
|
90
|
-
let n = 0;
|
|
91
|
-
const access = await resolveGatewayAccess({ asPubkey: `0x${"ab".repeat(32)}`, endpoint: "https://gw.example/" }, signer, {
|
|
92
|
-
cacheFile: null,
|
|
93
|
-
mint: async () => ({ endpoint: "x", bucket: "x", accessKeyId: `k${++n}`, secretAccessKey: "s", expiresAt: Date.now() + HOUR }),
|
|
94
|
-
});
|
|
95
|
-
expect(access).toMatchObject({ endpoint: "https://gw.example", bucket: `as-${"ab".repeat(30)}` });
|
|
96
|
-
expect((await access.credentials.get()).accessKeyId).toBe("k1");
|
|
97
|
-
expect(n).toBe(1);
|
|
98
|
-
});
|
|
99
|
-
it("serves explicit keys as given, and cannot replace them", async () => {
|
|
100
|
-
const access = await resolveGatewayAccess({ accessKey: "AK", secret: "SK", bucket: "b", endpoint: "https://gw" });
|
|
101
|
-
expect(await access.credentials.get()).toEqual({ accessKeyId: "AK", secretAccessKey: "SK" });
|
|
102
|
-
expect(await access.credentials.invalidate()).toBe(false);
|
|
103
|
-
});
|
|
104
|
-
it.each([
|
|
105
|
-
[{ accessKey: "AK" }, /--access-key is set but --secret \(or \$CEF_EVAL_SECRET\) is not/],
|
|
106
|
-
[{ secret: "SK" }, /--secret is set but --access-key \(or \$CEF_EVAL_KEY\) is not/],
|
|
107
|
-
])("refuses half of an explicit key pair instead of falling through to the wallet (%o)", async (half, error) => {
|
|
108
|
-
const saved = { key: process.env.CEF_EVAL_KEY, secret: process.env.CEF_EVAL_SECRET };
|
|
109
|
-
delete process.env.CEF_EVAL_KEY;
|
|
110
|
-
delete process.env.CEF_EVAL_SECRET;
|
|
111
|
-
try {
|
|
112
|
-
// A wallet is present, so without the check this would quietly mint and ignore the flag.
|
|
113
|
-
await expect(resolveGatewayAccess({ asPubkey: `0x${"ab".repeat(32)}`, endpoint: "https://gw", ...half }, signer, {
|
|
114
|
-
cacheFile: null,
|
|
115
|
-
mint: async () => ({ endpoint: "x", bucket: "x", accessKeyId: "minted", secretAccessKey: "s", expiresAt: Date.now() + HOUR }),
|
|
116
|
-
})).rejects.toThrow(error);
|
|
117
|
-
}
|
|
118
|
-
finally {
|
|
119
|
-
if (saved.key !== undefined)
|
|
120
|
-
process.env.CEF_EVAL_KEY = saved.key;
|
|
121
|
-
if (saved.secret !== undefined)
|
|
122
|
-
process.env.CEF_EVAL_SECRET = saved.secret;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
describe("choosing a credential when $CEF_DDC_ACCESS_TOKEN is set", () => {
|
|
127
|
-
const ENV = ["CEF_DDC_ACCESS_TOKEN", "CEF_KEYSTORE", "CEF_SECRET_PHRASE", "CEF_EVAL_KEY", "CEF_EVAL_SECRET"];
|
|
128
|
-
const saved = {};
|
|
129
|
-
let registryToken = "";
|
|
130
|
-
beforeEach(async () => {
|
|
131
|
-
for (const k of ENV) {
|
|
132
|
-
saved[k] = process.env[k];
|
|
133
|
-
delete process.env[k];
|
|
134
|
-
}
|
|
135
|
-
// What ROC's Access tab mints for `cef push`: full access, one bucket, no subject.
|
|
136
|
-
const ddc = (await import("@cere-ddc-sdk/ddc-client"));
|
|
137
|
-
const owner = new ddc.UriSigner("//cef-eval-test-owner");
|
|
138
|
-
await owner.isReady();
|
|
139
|
-
registryToken = (await ddc.AuthToken.fullAccess({ bucketId: 4044n }).sign(owner)).toString();
|
|
140
|
-
process.env.CEF_DDC_ACCESS_TOKEN = registryToken;
|
|
141
|
-
});
|
|
142
|
-
afterEach(() => {
|
|
143
|
-
for (const k of ENV) {
|
|
144
|
-
if (saved[k] === undefined)
|
|
145
|
-
delete process.env[k];
|
|
146
|
-
else
|
|
147
|
-
process.env[k] = saved[k];
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
const AS = `0x${"cd".repeat(32)}`;
|
|
151
|
-
const neverMint = async () => { throw new Error("must not mint"); };
|
|
152
|
-
it("refuses the token alone, naming its bucket, the dataset bucket, and what to use instead", async () => {
|
|
153
|
-
const err = await resolveGatewayAccess({ asPubkey: AS, endpoint: "https://gw" }, undefined, { cacheFile: null, mint: neverMint })
|
|
154
|
-
.then(() => undefined, (e) => e);
|
|
155
|
-
expect(err?.message).toMatch(/\$CEF_DDC_ACCESS_TOKEN .*cannot open dataset storage/);
|
|
156
|
-
expect(err?.message).toContain("limited to DDC bucket 4044");
|
|
157
|
-
expect(err?.message).toContain("cannot be delegated");
|
|
158
|
-
expect(err?.message).toContain(`as-${"cd".repeat(30)}`);
|
|
159
|
-
expect(err?.message).toContain("--access-key/--secret");
|
|
160
|
-
});
|
|
161
|
-
it("uses explicit keys over the token", async () => {
|
|
162
|
-
const access = await resolveGatewayAccess({ asPubkey: AS, accessKey: "AK", secret: "SK", endpoint: "https://gw" });
|
|
163
|
-
expect(await access.credentials.get()).toEqual({ accessKeyId: "AK", secretAccessKey: "SK" });
|
|
164
|
-
});
|
|
165
|
-
it("mints with a wallet when one is given beside the token", async () => {
|
|
166
|
-
let minted = 0;
|
|
167
|
-
const access = await resolveGatewayAccess({ asPubkey: AS, endpoint: "https://gw" }, { address: "5Alice" }, {
|
|
168
|
-
cacheFile: null,
|
|
169
|
-
mint: async () => ({ endpoint: "x", bucket: "x", accessKeyId: `k${++minted}`, secretAccessKey: "s", expiresAt: Date.now() + HOUR }),
|
|
170
|
-
});
|
|
171
|
-
expect((await access.credentials.get()).accessKeyId).toBe("k1");
|
|
172
|
-
});
|
|
173
|
-
it("still explains a string that is not a token", () => {
|
|
174
|
-
expect(ddcTokenCannotOpenStore("not a token!", "as-x").message).toMatch(/cannot open dataset storage: datasets live in the S3 gateway bucket as-x/);
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
describe("minting at the credential cap", () => {
|
|
178
|
-
it("says what to do instead of surfacing the gateway's 400", async () => {
|
|
179
|
-
const { UriSigner } = (await import("@cere-ddc-sdk/ddc-client"));
|
|
180
|
-
const wallet = new UriSigner("//Alice", { type: "ed25519" });
|
|
181
|
-
await wallet.isReady();
|
|
182
|
-
const fetchImpl = (async (url) => {
|
|
183
|
-
if (String(url).endsWith("/auth/info")) {
|
|
184
|
-
return new Response(JSON.stringify({ gateway_public_key: "11".repeat(32) }), { status: 200 });
|
|
185
|
-
}
|
|
186
|
-
return new Response("credential limit reached", { status: 400 });
|
|
187
|
-
});
|
|
188
|
-
await expect(mintGatewayCredentials({ endpoint: "https://gw", asPubKey: "0x00", signer: wallet, fetchImpl }))
|
|
189
|
-
.rejects.toThrow(/already holds as many live S3 credentials as the gateway allows.*--access-key\/--secret/s);
|
|
190
|
-
});
|
|
191
|
-
});
|
|
192
|
-
//# sourceMappingURL=eval-auth.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eval-auth.test.js","sourceRoot":"","sources":["../../src/lib/eval-auth.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OA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,CAAC,YAAY,CAAC,EAAE,CAAC;gBACvC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,kBAAkB,EAAE,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;YAChG,CAAC;YACD,OAAO,IAAI,QAAQ,CAAC,0BAA0B,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC;QACnE,CAAC,CAAiB,CAAC;QACnB,MAAM,MAAM,CAAC,sBAAsB,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;aAC1G,OAAO,CAAC,OAAO,CAAC,0FAA0F,CAAC,CAAC;IACjH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/lib/eval-store.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* S3-gateway-backed `EvalStore`.
|
|
3
|
-
*
|
|
4
|
-
* Datasets live on the S3 gateway, NOT on the DDC content gateway that
|
|
5
|
-
* `cef push` writes to. ROC's own `agentServiceAccess/wellKnown.ts` states why
|
|
6
|
-
* these cannot be the same path: "the content gateway cannot resolve S3 keys:
|
|
7
|
-
* the S3 gateway addresses objects through its own Postgres key->CID index,
|
|
8
|
-
* which the CDN knows nothing about." They are two systems with two key spaces,
|
|
9
|
-
* which is also why `cef eval push` is its own command rather than a flag on
|
|
10
|
-
* `cef push`.
|
|
11
|
-
*/
|
|
12
|
-
import { S3Client } from "@aws-sdk/client-s3";
|
|
13
|
-
import type { EvalStore } from "@cef-ai/eval";
|
|
14
|
-
import type { CredentialSource } from "./eval-auth.js";
|
|
15
|
-
export interface S3StoreOptions {
|
|
16
|
-
bucket: string;
|
|
17
|
-
client: S3Client;
|
|
18
|
-
/** Key prefix within the bucket. Defaults to none. */
|
|
19
|
-
root?: string;
|
|
20
|
-
/**
|
|
21
|
-
* The gateway refused `failed`'s credential (403): a client with a fresh
|
|
22
|
-
* one, or undefined when there is none. Each request is retried once.
|
|
23
|
-
*/
|
|
24
|
-
renew?: (failed: S3Client) => Promise<S3Client | undefined>;
|
|
25
|
-
}
|
|
26
|
-
/** A refused credential: expired, revoked, or never valid. */
|
|
27
|
-
export declare function isAuthFailure(err: unknown): boolean;
|
|
28
|
-
export declare function s3Store(opts: S3StoreOptions): EvalStore;
|
|
29
|
-
/**
|
|
30
|
-
* Build an S3 client for a gateway endpoint. With a `CredentialSource` the
|
|
31
|
-
* client asks it for a credential, carrying its expiry, so the SDK asks again
|
|
32
|
-
* inside its refresh window (5 min before expiry) and the source mints anew.
|
|
33
|
-
*/
|
|
34
|
-
export declare function gatewayClient(cfg: {
|
|
35
|
-
endpoint: string;
|
|
36
|
-
region?: string;
|
|
37
|
-
} & ({
|
|
38
|
-
accessKeyId: string;
|
|
39
|
-
secretAccessKey: string;
|
|
40
|
-
sessionToken?: string;
|
|
41
|
-
credentials?: never;
|
|
42
|
-
} | {
|
|
43
|
-
credentials: CredentialSource;
|
|
44
|
-
})): S3Client;
|
|
45
|
-
/**
|
|
46
|
-
* The store `cef eval` uses: a gateway client over a credential source, and
|
|
47
|
-
* on a 403 one fresh client per refused credential — concurrent requests that
|
|
48
|
-
* fail together share it instead of minting one each.
|
|
49
|
-
*/
|
|
50
|
-
export declare function gatewayStore(opts: {
|
|
51
|
-
endpoint: string;
|
|
52
|
-
bucket: string;
|
|
53
|
-
region?: string;
|
|
54
|
-
credentials: CredentialSource;
|
|
55
|
-
root?: string;
|
|
56
|
-
makeClient?: (cfg: {
|
|
57
|
-
endpoint: string;
|
|
58
|
-
region?: string;
|
|
59
|
-
credentials: CredentialSource;
|
|
60
|
-
}) => S3Client;
|
|
61
|
-
}): EvalStore;
|
|
62
|
-
//# sourceMappingURL=eval-store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
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AAU,CAAC,EAAE,CAAC,GAAG,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,gBAAgB,CAAA;KAAE,KAAK,QAAQ,CAAC;CACtG,GAAG,SAAS,CAwBZ"}
|
package/dist/lib/eval-store.js
DELETED
|
@@ -1,334 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* S3-gateway-backed `EvalStore`.
|
|
3
|
-
*
|
|
4
|
-
* Datasets live on the S3 gateway, NOT on the DDC content gateway that
|
|
5
|
-
* `cef push` writes to. ROC's own `agentServiceAccess/wellKnown.ts` states why
|
|
6
|
-
* these cannot be the same path: "the content gateway cannot resolve S3 keys:
|
|
7
|
-
* the S3 gateway addresses objects through its own Postgres key->CID index,
|
|
8
|
-
* which the CDN knows nothing about." They are two systems with two key spaces,
|
|
9
|
-
* which is also why `cef eval push` is its own command rather than a flag on
|
|
10
|
-
* `cef push`.
|
|
11
|
-
*/
|
|
12
|
-
import { GetObjectCommand, ListObjectsV2Command, PutObjectCommand, S3Client, } from "@aws-sdk/client-s3";
|
|
13
|
-
/** A refused credential: expired, revoked, or never valid. */
|
|
14
|
-
export function isAuthFailure(err) {
|
|
15
|
-
const e = err;
|
|
16
|
-
return e?.$metadata?.httpStatusCode === 403
|
|
17
|
-
|| e?.name === "InvalidAccessKeyId" || e?.name === "ExpiredToken" || e?.name === "AccessDenied";
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* `listObjects` on the gateway caps a page at 1000 keys and does NOT signal
|
|
21
|
-
* truncation to a naive caller — a known ceiling recorded in the design. So
|
|
22
|
-
* this paginates explicitly with the continuation token rather than trusting a
|
|
23
|
-
* single response, and every caller gets the whole prefix or an error.
|
|
24
|
-
*
|
|
25
|
-
* Silent truncation is the dangerous shape: a dataset that quietly
|
|
26
|
-
* stops at 1000 cases cuts a version missing the rest, and the experiment
|
|
27
|
-
* built from it looks complete.
|
|
28
|
-
*/
|
|
29
|
-
/** The endpoint host, for a warning that has to say WHICH gateway misbehaved. */
|
|
30
|
-
async function endpointLabel(client) {
|
|
31
|
-
try {
|
|
32
|
-
const endpoint = client.config
|
|
33
|
-
.endpoint;
|
|
34
|
-
return (await endpoint?.())?.hostname ?? "the S3 endpoint";
|
|
35
|
-
}
|
|
36
|
-
catch {
|
|
37
|
-
return "the S3 endpoint";
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
export function s3Store(opts) {
|
|
41
|
-
const { bucket } = opts;
|
|
42
|
-
let client = opts.client;
|
|
43
|
-
/*
|
|
44
|
-
* ONE RETRY ON A REFUSED CREDENTIAL. The client re-asks its credential
|
|
45
|
-
* provider before expiry on its own; this covers the rest (revoked, a clock
|
|
46
|
-
* that disagrees with the gateway's) without turning a real permission
|
|
47
|
-
* error into a loop.
|
|
48
|
-
*/
|
|
49
|
-
const send = async (command) => {
|
|
50
|
-
const used = client;
|
|
51
|
-
try {
|
|
52
|
-
return (await used.send(command));
|
|
53
|
-
}
|
|
54
|
-
catch (err) {
|
|
55
|
-
if (!opts.renew || !isAuthFailure(err))
|
|
56
|
-
throw err;
|
|
57
|
-
const fresh = await opts.renew(used);
|
|
58
|
-
if (!fresh)
|
|
59
|
-
throw err;
|
|
60
|
-
client = fresh;
|
|
61
|
-
return (await fresh.send(command));
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
const root = opts.root ? opts.root.replace(/\/*$/, "/") : "";
|
|
65
|
-
const full = (key) => `${root}${key}`;
|
|
66
|
-
const get = async (key) => {
|
|
67
|
-
try {
|
|
68
|
-
const res = await send(new GetObjectCommand({ Bucket: bucket, Key: full(key) }));
|
|
69
|
-
return (await res.Body?.transformToString()) ?? null;
|
|
70
|
-
}
|
|
71
|
-
catch (err) {
|
|
72
|
-
const name = err.name;
|
|
73
|
-
// A genuinely absent object is `null`; anything else (auth, network,
|
|
74
|
-
// a bad bucket) must propagate — swallowing it would make `putCase`'s
|
|
75
|
-
// written-once check silently pass and overwrite a real case.
|
|
76
|
-
if (name === "NoSuchKey" || name === "NotFound")
|
|
77
|
-
return null;
|
|
78
|
-
throw err;
|
|
79
|
-
}
|
|
80
|
-
};
|
|
81
|
-
return {
|
|
82
|
-
async list(prefix) {
|
|
83
|
-
const keys = [];
|
|
84
|
-
let token;
|
|
85
|
-
do {
|
|
86
|
-
const page = await send(new ListObjectsV2Command({
|
|
87
|
-
Bucket: bucket,
|
|
88
|
-
Prefix: full(prefix),
|
|
89
|
-
ContinuationToken: token,
|
|
90
|
-
}));
|
|
91
|
-
for (const obj of page.Contents ?? []) {
|
|
92
|
-
if (obj.Key)
|
|
93
|
-
keys.push(root ? obj.Key.slice(root.length) : obj.Key);
|
|
94
|
-
}
|
|
95
|
-
// Truncated with nowhere to continue from is the exact silent
|
|
96
|
-
// truncation this function exists to prevent: returning the short list
|
|
97
|
-
// reads as a complete one, and the version cut from it is missing cases
|
|
98
|
-
// nobody will notice are gone.
|
|
99
|
-
if (page.IsTruncated && !page.NextContinuationToken) {
|
|
100
|
-
throw new Error(`[eval] listing "${full(prefix)}" in bucket "${bucket}" came back ` +
|
|
101
|
-
`TRUNCATED after ${keys.length} key(s) with no ` +
|
|
102
|
-
`NextContinuationToken, so the rest of the prefix cannot be ` +
|
|
103
|
-
`fetched. Refusing to return a short list — a set that quietly ` +
|
|
104
|
-
`stops cuts a version missing cases, and the experiment built ` +
|
|
105
|
-
`from it looks complete.`);
|
|
106
|
-
}
|
|
107
|
-
token = page.IsTruncated ? page.NextContinuationToken : undefined;
|
|
108
|
-
} while (token);
|
|
109
|
-
return keys.sort();
|
|
110
|
-
},
|
|
111
|
-
/**
|
|
112
|
-
* Child prefixes through `Delimiter: "/"`, paged the same way and with the
|
|
113
|
-
* same refusal of a truncated page that has nowhere to continue — what
|
|
114
|
-
* lets `listDatasets`/`findExperiment` skip every run record in the bucket.
|
|
115
|
-
*/
|
|
116
|
-
async listPrefixes(prefix) {
|
|
117
|
-
const out = new Set();
|
|
118
|
-
let token;
|
|
119
|
-
do {
|
|
120
|
-
const page = await send(new ListObjectsV2Command({
|
|
121
|
-
Bucket: bucket,
|
|
122
|
-
Prefix: full(prefix),
|
|
123
|
-
Delimiter: "/",
|
|
124
|
-
ContinuationToken: token,
|
|
125
|
-
}));
|
|
126
|
-
for (const p of page.CommonPrefixes ?? []) {
|
|
127
|
-
if (p.Prefix)
|
|
128
|
-
out.add(root ? p.Prefix.slice(root.length) : p.Prefix);
|
|
129
|
-
}
|
|
130
|
-
if (page.IsTruncated && !page.NextContinuationToken) {
|
|
131
|
-
throw new Error(`[eval] listing the prefixes of "${full(prefix)}" in bucket "${bucket}" came back TRUNCATED ` +
|
|
132
|
-
`with no NextContinuationToken — refusing to return a short list.`);
|
|
133
|
-
}
|
|
134
|
-
token = page.IsTruncated ? page.NextContinuationToken : undefined;
|
|
135
|
-
} while (token);
|
|
136
|
-
return [...out].sort();
|
|
137
|
-
},
|
|
138
|
-
get,
|
|
139
|
-
async put(key, body) {
|
|
140
|
-
await send(new PutObjectCommand({
|
|
141
|
-
Bucket: bucket,
|
|
142
|
-
Key: full(key),
|
|
143
|
-
Body: body,
|
|
144
|
-
ContentType: "application/json",
|
|
145
|
-
}));
|
|
146
|
-
},
|
|
147
|
-
/**
|
|
148
|
-
* Write-if-absent. A real compare-and-set on every store this runs against,
|
|
149
|
-
* including Cere's DDC S3 gateway — verified, not assumed.
|
|
150
|
-
*
|
|
151
|
-
* Two layers, in order:
|
|
152
|
-
*
|
|
153
|
-
* 1. READ FIRST, and return `false` without attempting any write. Catches
|
|
154
|
-
* every collision older than one round trip, and — because it never
|
|
155
|
-
* writes on that path — it is also what keeps a store that ignored the
|
|
156
|
-
* header from corrupting rather than merely losing a cut.
|
|
157
|
-
*
|
|
158
|
-
* 2. `If-None-Match: "*"` on the PUT, with `412` read as "taken". This is
|
|
159
|
-
* the part that actually closes the race, step 1 or no step 1.
|
|
160
|
-
*
|
|
161
|
-
* Step 2 was believed inert on the DDC gateway: it is a hand-written Go
|
|
162
|
-
* service whose documented PutObject path is "stream to DDC, then UPSERT
|
|
163
|
-
* the index row" with no precondition step, its published error model lists
|
|
164
|
-
* no `412`, and nothing in this repo or ROC had ever sent the header. Two
|
|
165
|
-
* company ADR paragraphs contradicted each other on it.
|
|
166
|
-
*
|
|
167
|
-
* Probed against dev rather than left as a caveat: the first conditional
|
|
168
|
-
* PUT succeeded, the SECOND returned `PreconditionFailed` / 412, and the
|
|
169
|
-
* stored bytes were still the first writer's. The gateway honours it, and
|
|
170
|
-
* the ADR paragraph claiming conditional writes exist is the correct one.
|
|
171
|
-
*
|
|
172
|
-
* The unconditional fallback below stays for a store that rejects the
|
|
173
|
-
* header outright with 501 — one unknown header must not be able to take
|
|
174
|
-
* `eval push --cut` down entirely — and step 1 still guards that path. NOT
|
|
175
|
-
* 400: that covers a malformed key, a bad body, a signing problem and much
|
|
176
|
-
* else, and downgrading on it would let two concurrent cutters both
|
|
177
|
-
* believe they won while step 2 was never really tried.
|
|
178
|
-
*/
|
|
179
|
-
async putIfAbsent(key, body) {
|
|
180
|
-
if ((await get(key)) !== null)
|
|
181
|
-
return false;
|
|
182
|
-
const command = (conditional) => new PutObjectCommand({
|
|
183
|
-
Bucket: bucket,
|
|
184
|
-
Key: full(key),
|
|
185
|
-
Body: body,
|
|
186
|
-
ContentType: "application/json",
|
|
187
|
-
...(conditional ? { IfNoneMatch: "*" } : {}),
|
|
188
|
-
});
|
|
189
|
-
try {
|
|
190
|
-
await send(command(true));
|
|
191
|
-
return true;
|
|
192
|
-
}
|
|
193
|
-
catch (err) {
|
|
194
|
-
const code = err.$metadata
|
|
195
|
-
?.httpStatusCode;
|
|
196
|
-
// 412: the key was taken. 409 (`ConditionalRequestConflict`) means a
|
|
197
|
-
// concurrent write collided and AWS says to retry — reporting it as
|
|
198
|
-
// "taken" sends the caller back to re-list and try the next number,
|
|
199
|
-
// which is the same recovery and is self-correcting if the key turns
|
|
200
|
-
// out to be free after all.
|
|
201
|
-
if (err.name === "PreconditionFailed")
|
|
202
|
-
return false;
|
|
203
|
-
if (code === 412 || code === 409)
|
|
204
|
-
return false;
|
|
205
|
-
// A server that does not IMPLEMENT the header must not take the whole
|
|
206
|
-
// feature down with it: `cef eval push --cut` has to keep working
|
|
207
|
-
// against a gateway that answers 501. 501 ONLY — a 400 is "your request
|
|
208
|
-
// was wrong", which covers a malformed key, a bad body, a signing
|
|
209
|
-
// problem and much else, and downgrading on it means two cutters both
|
|
210
|
-
// believe they won while step 2 was never really tried. And the
|
|
211
|
-
// downgrade is announced: a gateway that regresses out of conditional
|
|
212
|
-
// writes must be visible, not a comment nobody reads.
|
|
213
|
-
if (code === 501) {
|
|
214
|
-
console.warn(`[eval] ${await endpointLabel(client)} answered 501 to a conditional ` +
|
|
215
|
-
`PUT (If-None-Match: *) on "${full(key)}" — falling back to an ` +
|
|
216
|
-
`UNCONDITIONAL write. The read check above still stands, but two ` +
|
|
217
|
-
`concurrent writers can now both believe they won a version or a ` +
|
|
218
|
-
`revision. This gateway no longer supports write-once.`);
|
|
219
|
-
await send(command(false));
|
|
220
|
-
return true;
|
|
221
|
-
}
|
|
222
|
-
throw err;
|
|
223
|
-
}
|
|
224
|
-
},
|
|
225
|
-
/**
|
|
226
|
-
* The claim `storeConformance` refuses to run without, and the one the
|
|
227
|
-
* doc comment above spends forty lines earning: the SERVER adjudicates,
|
|
228
|
-
* through `If-None-Match: "*"` with 412/409 read as "taken".
|
|
229
|
-
*
|
|
230
|
-
* Pinned, not asserted-by-comment: `eval-store.test.ts` drives this
|
|
231
|
-
* `putIfAbsent` and reads the header off the `PutObjectCommand` the store
|
|
232
|
-
* actually sent. Change the mechanism and that test goes red next to this
|
|
233
|
-
* word.
|
|
234
|
-
*
|
|
235
|
-
* One honest caveat, and it is wider than "one write": the 501 branch
|
|
236
|
-
* above is in a per-call `catch`, so against a gateway that answers 501 it
|
|
237
|
-
* fires on EVERY `putIfAbsent` for as long as that lasts. The whole
|
|
238
|
-
* process is writing unconditionally, with only step 1's read between two
|
|
239
|
-
* cutters and a silently replaced manifest. The per-call `console.warn` is
|
|
240
|
-
* the right mitigation precisely because of that — it names the endpoint
|
|
241
|
-
* every time rather than once — but nobody should read this as a single
|
|
242
|
-
* degraded write.
|
|
243
|
-
*
|
|
244
|
-
* The declaration stays `conditional-write` regardless, because it
|
|
245
|
-
* describes what this store SENDS. A store whose declared mechanism
|
|
246
|
-
* flipped mid-run would be a claim nobody could check against the code,
|
|
247
|
-
* which is the one thing the word has to be.
|
|
248
|
-
*/
|
|
249
|
-
atomicity: "conditional-write",
|
|
250
|
-
};
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* Build an S3 client for a gateway endpoint. With a `CredentialSource` the
|
|
254
|
-
* client asks it for a credential, carrying its expiry, so the SDK asks again
|
|
255
|
-
* inside its refresh window (5 min before expiry) and the source mints anew.
|
|
256
|
-
*/
|
|
257
|
-
export function gatewayClient(cfg) {
|
|
258
|
-
const credentials = "credentials" in cfg && cfg.credentials
|
|
259
|
-
? async () => {
|
|
260
|
-
const c = await cfg.credentials.get();
|
|
261
|
-
return {
|
|
262
|
-
accessKeyId: c.accessKeyId,
|
|
263
|
-
secretAccessKey: c.secretAccessKey,
|
|
264
|
-
...(c.expiresAt !== undefined ? { expiration: new Date(c.expiresAt) } : {}),
|
|
265
|
-
};
|
|
266
|
-
}
|
|
267
|
-
: {
|
|
268
|
-
accessKeyId: cfg.accessKeyId,
|
|
269
|
-
secretAccessKey: cfg.secretAccessKey,
|
|
270
|
-
...(cfg.sessionToken ? { sessionToken: cfg.sessionToken } : {}),
|
|
271
|
-
};
|
|
272
|
-
const config = {
|
|
273
|
-
endpoint: cfg.endpoint,
|
|
274
|
-
region: cfg.region ?? "us-east-1",
|
|
275
|
-
// The gateway addresses buckets by path, not by virtual host.
|
|
276
|
-
forcePathStyle: true,
|
|
277
|
-
credentials,
|
|
278
|
-
};
|
|
279
|
-
const client = new S3Client(config);
|
|
280
|
-
// The gateway routes on `/<bucket>/<key>` and reads the empty last segment of
|
|
281
|
-
// a bucket-level path (`/<bucket>/`, which is what the AWS SDK sends under
|
|
282
|
-
// `forcePathStyle`) as a key, answering `400 InvalidArgument: key is
|
|
283
|
-
// required`. Keyed commands are left alone: an object key may legitimately
|
|
284
|
-
// end in `/`. Keying off the command input rather than the path shape also
|
|
285
|
-
// survives a `--endpoint` that carries a path prefix, where `/s3/<bucket>/`
|
|
286
|
-
// is indistinguishable from a bucket-and-key path by pattern alone.
|
|
287
|
-
//
|
|
288
|
-
// ROC needs this too and has `removeTrailingBucketSlashForDdcGateway` in
|
|
289
|
-
// `browserBucketStorage.ts`; that one matches on the path shape, so it is the
|
|
290
|
-
// same behaviour for the bare-host endpoints both use.
|
|
291
|
-
client.middlewareStack.add((next) => (args) => {
|
|
292
|
-
const request = args.request;
|
|
293
|
-
const keyed = typeof args.input === "object" && args.input !== null && "Key" in args.input;
|
|
294
|
-
if (request?.path && request.path.length > 1 && request.path.endsWith("/") && !keyed) {
|
|
295
|
-
request.path = request.path.replace(/\/+$/, "");
|
|
296
|
-
}
|
|
297
|
-
return next(args);
|
|
298
|
-
}, { name: "removeTrailingBucketSlashForDdcGateway", step: "build" });
|
|
299
|
-
return client;
|
|
300
|
-
}
|
|
301
|
-
/**
|
|
302
|
-
* The store `cef eval` uses: a gateway client over a credential source, and
|
|
303
|
-
* on a 403 one fresh client per refused credential — concurrent requests that
|
|
304
|
-
* fail together share it instead of minting one each.
|
|
305
|
-
*/
|
|
306
|
-
export function gatewayStore(opts) {
|
|
307
|
-
const make = () => (opts.makeClient ?? gatewayClient)({
|
|
308
|
-
endpoint: opts.endpoint, ...(opts.region ? { region: opts.region } : {}), credentials: opts.credentials,
|
|
309
|
-
});
|
|
310
|
-
let current = make();
|
|
311
|
-
let renewing;
|
|
312
|
-
return s3Store({
|
|
313
|
-
bucket: opts.bucket,
|
|
314
|
-
client: current,
|
|
315
|
-
...(opts.root ? { root: opts.root } : {}),
|
|
316
|
-
renew: async (failed) => {
|
|
317
|
-
if (failed !== current)
|
|
318
|
-
return current;
|
|
319
|
-
renewing ??= (async () => {
|
|
320
|
-
try {
|
|
321
|
-
if (!(await opts.credentials.invalidate()))
|
|
322
|
-
return undefined;
|
|
323
|
-
current = make();
|
|
324
|
-
return current;
|
|
325
|
-
}
|
|
326
|
-
finally {
|
|
327
|
-
renewing = undefined;
|
|
328
|
-
}
|
|
329
|
-
})();
|
|
330
|
-
return renewing;
|
|
331
|
-
},
|
|
332
|
-
});
|
|
333
|
-
}
|
|
334
|
-
//# sourceMappingURL=eval-store.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eval-store.js","sourceRoot":"","sources":["../../src/lib/eval-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,gBAAgB,EAEhB,oBAAoB,EAEpB,gBAAgB,EAChB,QAAQ,GAET,MAAM,oBAAoB,CAAC;AAiB5B,8DAA8D;AAC9D,MAAM,UAAU,aAAa,CAAC,GAAY;IACxC,MAAM,CAAC,GAAG,GAAiE,CAAC;IAC5E,OAAO,CAAC,EAAE,SAAS,EAAE,cAAc,KAAK,GAAG;WACtC,CAAC,EAAE,IAAI,KAAK,oBAAoB,IAAI,CAAC,EAAE,IAAI,KAAK,cAAc,IAAI,CAAC,EAAE,IAAI,KAAK,cAAc,CAAC;AACpG,CAAC;AAED;;;;;;;;;GASG;AACH,iFAAiF;AACjF,KAAK,UAAU,aAAa,CAAC,MAAgB;IAC3C,IAAI,CAAC;QACH,MAAM,QAAQ,GAAI,MAAM,CAAC,MAA8D;aACpF,QAAQ,CAAC;QACZ,OAAO,CAAC,MAAM,QAAQ,EAAE,EAAE,CAAC,EAAE,QAAQ,IAAI,iBAAiB,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,iBAAiB,CAAC;IAC3B,CAAC;AACH,CAAC;AAED,MAAM,UAAU,OAAO,CAAC,IAAoB;IAC1C,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CA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