@crvouga/mockingbird-service-textract 3.10.2 → 3.10.4
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/CHANGELOG.md +13 -0
- package/dist/{chunk-DDWYTA6T.js → chunk-3XVPEZJ3.js} +48 -36
- package/dist/chunk-3XVPEZJ3.js.map +7 -0
- package/dist/{chunk-5N3UT2IO.js → chunk-DLR7AU2O.js} +3 -3
- package/dist/cli.js +2 -2
- package/dist/index.js +1 -1
- package/dist/server.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-DDWYTA6T.js.map +0 -7
- /package/dist/{chunk-5N3UT2IO.js.map → chunk-DLR7AU2O.js.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog — @crvouga/mockingbird-service-textract
|
|
2
2
|
|
|
3
|
+
## 3.10.4 (2026-11-02)
|
|
4
|
+
|
|
5
|
+
### Fixes and improvements
|
|
6
|
+
|
|
7
|
+
- compare the admin key in constant time ([2a43141](https://github.com/crvouga/mockingbird/commit/2a43141f50dab41e698c3bbce0c69bf65b40e24e))
|
|
8
|
+
|
|
9
|
+
## 3.10.3 (2026-11-02)
|
|
10
|
+
|
|
11
|
+
### Fixes and improvements
|
|
12
|
+
|
|
13
|
+
- stop walkSchema recursing forever on a self-referential $ref ([69464a9](https://github.com/crvouga/mockingbird/commit/69464a9d9e7f468c5e1095125108d4d3d5515431))
|
|
14
|
+
- densify sparse bracket arrays by their written indices ([84a28cb](https://github.com/crvouga/mockingbird/commit/84a28cb182e3d7df91102897f0fc11fca714ba5f))
|
|
15
|
+
|
|
3
16
|
## 3.10.2 (2026-11-02)
|
|
4
17
|
|
|
5
18
|
### Fixes and improvements
|
|
@@ -2507,6 +2507,46 @@ var createNamespaceControls = (options) => {
|
|
|
2507
2507
|
};
|
|
2508
2508
|
};
|
|
2509
2509
|
|
|
2510
|
+
// ../core/dist/signing.js
|
|
2511
|
+
var encoder = new TextEncoder();
|
|
2512
|
+
var toBase64 = (bytes) => {
|
|
2513
|
+
let binary = "";
|
|
2514
|
+
for (const byte of bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)) {
|
|
2515
|
+
binary += String.fromCharCode(byte);
|
|
2516
|
+
}
|
|
2517
|
+
return btoa(binary);
|
|
2518
|
+
};
|
|
2519
|
+
var fromBase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
|
|
2520
|
+
var toHex = (bytes) => [...bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
2521
|
+
var keyBytes = (key) => typeof key === "string" ? encoder.encode(key) : key;
|
|
2522
|
+
var hmac = async (algorithm, key, message, encoding = "hex") => {
|
|
2523
|
+
const imported = await crypto.subtle.importKey("raw", keyBytes(key), { name: "HMAC", hash: algorithm }, false, ["sign"]);
|
|
2524
|
+
const signed = await crypto.subtle.sign("HMAC", imported, typeof message === "string" ? encoder.encode(message) : message);
|
|
2525
|
+
return encoding === "hex" ? toHex(signed) : toBase64(signed);
|
|
2526
|
+
};
|
|
2527
|
+
var svixSecretBytes = (secret) => {
|
|
2528
|
+
const raw = secret.replace(/^f?whsec_/, "");
|
|
2529
|
+
try {
|
|
2530
|
+
return fromBase64(raw);
|
|
2531
|
+
} catch {
|
|
2532
|
+
throw new TypeError("webhook secret must be whsec_<base64> (as Svix issues it)");
|
|
2533
|
+
}
|
|
2534
|
+
};
|
|
2535
|
+
var signSvix = async (secret, messageId, timestampSeconds, body) => `v1,${await hmac("SHA-256", svixSecretBytes(secret), `${messageId}.${timestampSeconds}.${body}`, "base64")}`;
|
|
2536
|
+
var signTimestamped = async (secret, timestampSeconds, body) => `t=${timestampSeconds},v1=${await hmac("SHA-256", secret, `${timestampSeconds}.${body}`, "hex")}`;
|
|
2537
|
+
var signTwilio = async (authToken, url, params) => {
|
|
2538
|
+
const payload = url + Object.keys(params).sort().map((key) => `${key}${params[key]}`).join("");
|
|
2539
|
+
return hmac("SHA-1", authToken, payload, "base64");
|
|
2540
|
+
};
|
|
2541
|
+
var timingSafeEqual = (a, b) => {
|
|
2542
|
+
if (a.length !== b.length)
|
|
2543
|
+
return false;
|
|
2544
|
+
let diff = 0;
|
|
2545
|
+
for (let i = 0; i < a.length; i++)
|
|
2546
|
+
diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
|
|
2547
|
+
return diff === 0;
|
|
2548
|
+
};
|
|
2549
|
+
|
|
2510
2550
|
// ../core/dist/surface.js
|
|
2511
2551
|
var defineMock = (runtime) => runtime;
|
|
2512
2552
|
var ADMIN_ROUTE_REFERENCE = {
|
|
@@ -2625,6 +2665,10 @@ var assertAdminPrefixAvailable = (prefix, paths) => {
|
|
|
2625
2665
|
}
|
|
2626
2666
|
};
|
|
2627
2667
|
var ADMIN_KEY_HEADER = CONTROL_HEADERS.adminKey;
|
|
2668
|
+
var hasAdminKey = (headers, adminKey) => {
|
|
2669
|
+
const sent = headers.get(ADMIN_KEY_HEADER);
|
|
2670
|
+
return sent !== null && timingSafeEqual(sent, adminKey);
|
|
2671
|
+
};
|
|
2628
2672
|
var NAMESPACE_HEADER = CONTROL_HEADERS.namespace;
|
|
2629
2673
|
var ADMIN_DOCS_URL = "https://mockingbird.chrisvouga.dev/docs/admin-controls";
|
|
2630
2674
|
var ADMIN_CONTROL_PAGES = [
|
|
@@ -3098,7 +3142,7 @@ var createControlPlane = (context) => {
|
|
|
3098
3142
|
}
|
|
3099
3143
|
const path = url.pathname.slice(adminPrefix.length) || "/";
|
|
3100
3144
|
const shell = request.method === "GET" && (path === "/ui" || path === "/ui/");
|
|
3101
|
-
if (!shell && context.adminKey !== void 0 && request.headers
|
|
3145
|
+
if (!shell && context.adminKey !== void 0 && !hasAdminKey(request.headers, context.adminKey)) {
|
|
3102
3146
|
return adminError(401, `missing or wrong ${ADMIN_KEY_HEADER}`);
|
|
3103
3147
|
}
|
|
3104
3148
|
for (const route of routes) {
|
|
@@ -3861,39 +3905,7 @@ var stateAdminRoutes = (routes) => {
|
|
|
3861
3905
|
};
|
|
3862
3906
|
|
|
3863
3907
|
// ../core/dist/version.js
|
|
3864
|
-
var PACKAGE_VERSION = true ? "3.10.
|
|
3865
|
-
|
|
3866
|
-
// ../core/dist/signing.js
|
|
3867
|
-
var encoder = new TextEncoder();
|
|
3868
|
-
var toBase64 = (bytes) => {
|
|
3869
|
-
let binary = "";
|
|
3870
|
-
for (const byte of bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)) {
|
|
3871
|
-
binary += String.fromCharCode(byte);
|
|
3872
|
-
}
|
|
3873
|
-
return btoa(binary);
|
|
3874
|
-
};
|
|
3875
|
-
var fromBase64 = (value) => Uint8Array.from(atob(value), (char) => char.charCodeAt(0));
|
|
3876
|
-
var toHex = (bytes) => [...bytes instanceof Uint8Array ? bytes : new Uint8Array(bytes)].map((byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
3877
|
-
var keyBytes = (key) => typeof key === "string" ? encoder.encode(key) : key;
|
|
3878
|
-
var hmac = async (algorithm, key, message, encoding = "hex") => {
|
|
3879
|
-
const imported = await crypto.subtle.importKey("raw", keyBytes(key), { name: "HMAC", hash: algorithm }, false, ["sign"]);
|
|
3880
|
-
const signed = await crypto.subtle.sign("HMAC", imported, typeof message === "string" ? encoder.encode(message) : message);
|
|
3881
|
-
return encoding === "hex" ? toHex(signed) : toBase64(signed);
|
|
3882
|
-
};
|
|
3883
|
-
var svixSecretBytes = (secret) => {
|
|
3884
|
-
const raw = secret.replace(/^f?whsec_/, "");
|
|
3885
|
-
try {
|
|
3886
|
-
return fromBase64(raw);
|
|
3887
|
-
} catch {
|
|
3888
|
-
throw new TypeError("webhook secret must be whsec_<base64> (as Svix issues it)");
|
|
3889
|
-
}
|
|
3890
|
-
};
|
|
3891
|
-
var signSvix = async (secret, messageId, timestampSeconds, body) => `v1,${await hmac("SHA-256", svixSecretBytes(secret), `${messageId}.${timestampSeconds}.${body}`, "base64")}`;
|
|
3892
|
-
var signTimestamped = async (secret, timestampSeconds, body) => `t=${timestampSeconds},v1=${await hmac("SHA-256", secret, `${timestampSeconds}.${body}`, "hex")}`;
|
|
3893
|
-
var signTwilio = async (authToken, url, params) => {
|
|
3894
|
-
const payload = url + Object.keys(params).sort().map((key) => `${key}${params[key]}`).join("");
|
|
3895
|
-
return hmac("SHA-1", authToken, payload, "base64");
|
|
3896
|
-
};
|
|
3908
|
+
var PACKAGE_VERSION = true ? "3.10.4" : UNRELEASED_VERSION;
|
|
3897
3909
|
|
|
3898
3910
|
// ../core/dist/webhooks.js
|
|
3899
3911
|
var signers = {
|
|
@@ -5288,7 +5300,7 @@ var createRuntime = (options) => {
|
|
|
5288
5300
|
throw error;
|
|
5289
5301
|
}
|
|
5290
5302
|
const rewinds = at !== void 0 && selectedBranch === "main" && MUTATING_METHODS.has(request.method);
|
|
5291
|
-
if ((requested || rewinds) && options.adminKey !== void 0 && request.headers
|
|
5303
|
+
if ((requested || rewinds) && options.adminKey !== void 0 && !hasAdminKey(request.headers, options.adminKey))
|
|
5292
5304
|
return refuse(401, `control headers need ${ADMIN_KEY_HEADER}`);
|
|
5293
5305
|
controls.ensure(namespace);
|
|
5294
5306
|
if (requested?.restore !== void 0 && !snapshotStore.get(namespace, requested.restore))
|
|
@@ -5956,4 +5968,4 @@ export {
|
|
|
5956
5968
|
accessKeyCredential,
|
|
5957
5969
|
TextractAPI
|
|
5958
5970
|
};
|
|
5959
|
-
//# sourceMappingURL=chunk-
|
|
5971
|
+
//# sourceMappingURL=chunk-3XVPEZJ3.js.map
|