@tomflow/proflow-dev-tunnel 0.1.2 → 0.1.3
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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @tomflow/proflow-dev-tunnel
|
|
2
2
|
|
|
3
|
+
## 0.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bind production dev-tunnel verification to an explicit evidence file for the frozen file-relay and 429/5xx proofs, while retaining live HTTPS/TLS/latency/size checks.
|
|
8
|
+
|
|
3
9
|
## 0.1.2
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import type { ModuleOperationResult } from "@tomflow/proflow-module-contract";
|
|
2
2
|
import type { DevTunnelRuntime, ErrorSemanticsProof, FileRelayProof } from "../src/resource-adapter.ts";
|
|
3
|
+
type DevTunnelVerificationEvidence = {
|
|
4
|
+
contract: "proflow.dev-tunnel-verification.v1";
|
|
5
|
+
moduleVersion: string;
|
|
6
|
+
publicBaseUrl: string;
|
|
7
|
+
observedAt: string;
|
|
8
|
+
fileRelay: FileRelayProof;
|
|
9
|
+
errorSemantics: ErrorSemanticsProof;
|
|
10
|
+
};
|
|
11
|
+
export declare function readDevTunnelVerificationEvidence(file: string | undefined, publicBaseUrl: string): Promise<DevTunnelVerificationEvidence | undefined>;
|
|
3
12
|
export declare function createBehaviorAdapter(input?: {
|
|
4
13
|
runtime: DevTunnelRuntime;
|
|
5
14
|
verifyErrorSemantics?: () => Promise<ErrorSemanticsProof>;
|
|
@@ -128,3 +137,4 @@ export declare function createProductionBinding(input: {
|
|
|
128
137
|
}): Promise<{
|
|
129
138
|
behaviorAdapter: Record<string, unknown>;
|
|
130
139
|
} | undefined>;
|
|
140
|
+
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { readFile } from "node:fs/promises";
|
|
1
2
|
import { verifyPublicIngress } from "../src/resource-adapter.js";
|
|
2
3
|
import { descriptor } from "./descriptor.js";
|
|
3
4
|
const success = (data) => ({
|
|
@@ -16,6 +17,32 @@ const actionRequired = (action, description) => ({
|
|
|
16
17
|
moduleVersion: descriptor.moduleVersion,
|
|
17
18
|
actionRequired: { action, description },
|
|
18
19
|
});
|
|
20
|
+
export async function readDevTunnelVerificationEvidence(file, publicBaseUrl) {
|
|
21
|
+
if (!file)
|
|
22
|
+
return undefined;
|
|
23
|
+
try {
|
|
24
|
+
const raw = JSON.parse(await readFile(file, "utf8"));
|
|
25
|
+
if (raw.contract !== "proflow.dev-tunnel-verification.v1" ||
|
|
26
|
+
raw.moduleVersion !== descriptor.moduleVersion ||
|
|
27
|
+
raw.publicBaseUrl !== publicBaseUrl ||
|
|
28
|
+
typeof raw.observedAt !== "string" ||
|
|
29
|
+
Number.isNaN(Date.parse(raw.observedAt)) ||
|
|
30
|
+
typeof raw.fileRelay !== "object" ||
|
|
31
|
+
raw.fileRelay === null ||
|
|
32
|
+
typeof raw.fileRelay.verified !== "boolean" ||
|
|
33
|
+
typeof raw.fileRelay.message !== "string" ||
|
|
34
|
+
typeof raw.errorSemantics !== "object" ||
|
|
35
|
+
raw.errorSemantics === null ||
|
|
36
|
+
typeof raw.errorSemantics.rateLimit429Verified !== "boolean" ||
|
|
37
|
+
typeof raw.errorSemantics.server5xxVerified !== "boolean" ||
|
|
38
|
+
typeof raw.errorSemantics.message !== "string")
|
|
39
|
+
return undefined;
|
|
40
|
+
return raw;
|
|
41
|
+
}
|
|
42
|
+
catch {
|
|
43
|
+
return undefined;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
19
46
|
export function createBehaviorAdapter(input) {
|
|
20
47
|
return {
|
|
21
48
|
describe: () => ({
|
|
@@ -257,12 +284,22 @@ export async function createProductionBinding(input) {
|
|
|
257
284
|
if (!publicBaseUrl)
|
|
258
285
|
return undefined;
|
|
259
286
|
const { createDevTunnelRuntime } = await import("../src/resource-adapter.js");
|
|
287
|
+
const readEvidence = () => readDevTunnelVerificationEvidence(input.config.verificationEvidenceFile, publicBaseUrl);
|
|
260
288
|
return {
|
|
261
289
|
behaviorAdapter: createBehaviorAdapter({
|
|
262
290
|
runtime: createDevTunnelRuntime({
|
|
263
291
|
publicBaseUrl,
|
|
264
292
|
...(input.config.tunnelId ? { tunnelId: input.config.tunnelId } : {}),
|
|
265
293
|
}),
|
|
294
|
+
verifyFileRelay: async () => (await readEvidence())?.fileRelay ?? {
|
|
295
|
+
verified: false,
|
|
296
|
+
message: "dev-tunnel verification evidence is missing, stale, or invalid",
|
|
297
|
+
},
|
|
298
|
+
verifyErrorSemantics: async () => (await readEvidence())?.errorSemantics ?? {
|
|
299
|
+
rateLimit429Verified: false,
|
|
300
|
+
server5xxVerified: false,
|
|
301
|
+
message: "dev-tunnel verification evidence is missing, stale, or invalid",
|
|
302
|
+
},
|
|
266
303
|
}),
|
|
267
304
|
};
|
|
268
305
|
}
|
|
@@ -3,7 +3,7 @@ export declare const descriptor: {
|
|
|
3
3
|
readonly contractVersion: "1.0.0";
|
|
4
4
|
readonly moduleRef: "dev-tunnel";
|
|
5
5
|
readonly packageName: "@tomflow/proflow-dev-tunnel";
|
|
6
|
-
readonly moduleVersion: "0.1.
|
|
6
|
+
readonly moduleVersion: "0.1.3";
|
|
7
7
|
readonly kind: "external-resource";
|
|
8
8
|
readonly templateVersion: "1.0.0";
|
|
9
9
|
readonly platformCompatibility: ">=1.0.0 <2.0.0";
|
|
@@ -31,6 +31,11 @@ export declare const descriptor: {
|
|
|
31
31
|
readonly type: "string";
|
|
32
32
|
readonly required: false;
|
|
33
33
|
readonly description: "Persistent Microsoft Dev Tunnel identifier used when this adapter owns lifecycle start/stop";
|
|
34
|
+
}, {
|
|
35
|
+
readonly key: "verificationEvidenceFile";
|
|
36
|
+
readonly type: "path";
|
|
37
|
+
readonly required: false;
|
|
38
|
+
readonly description: "JSON evidence for real file-relay and 429/5xx verification behind the configured public ingress";
|
|
34
39
|
}];
|
|
35
40
|
readonly lifecycle: {
|
|
36
41
|
readonly supported: readonly ["describe", "preflight", "status", "verify", "doctor", "start", "stop", "restart", "uninstall"];
|
|
@@ -3,7 +3,7 @@ export const descriptor = {
|
|
|
3
3
|
contractVersion: "1.0.0",
|
|
4
4
|
moduleRef: "dev-tunnel",
|
|
5
5
|
packageName: "@tomflow/proflow-dev-tunnel",
|
|
6
|
-
moduleVersion: "0.1.
|
|
6
|
+
moduleVersion: "0.1.3",
|
|
7
7
|
kind: "external-resource",
|
|
8
8
|
templateVersion: "1.0.0",
|
|
9
9
|
platformCompatibility: ">=1.0.0 <2.0.0",
|
|
@@ -34,6 +34,12 @@ export const descriptor = {
|
|
|
34
34
|
required: false,
|
|
35
35
|
description: "Persistent Microsoft Dev Tunnel identifier used when this adapter owns lifecycle start/stop",
|
|
36
36
|
},
|
|
37
|
+
{
|
|
38
|
+
key: "verificationEvidenceFile",
|
|
39
|
+
type: "path",
|
|
40
|
+
required: false,
|
|
41
|
+
description: "JSON evidence for real file-relay and 429/5xx verification behind the configured public ingress",
|
|
42
|
+
},
|
|
37
43
|
],
|
|
38
44
|
lifecycle: {
|
|
39
45
|
supported: [
|
package/package.json
CHANGED
package/proflow.module.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"contractVersion": "1.0.0",
|
|
4
4
|
"moduleRef": "dev-tunnel",
|
|
5
5
|
"packageName": "@tomflow/proflow-dev-tunnel",
|
|
6
|
-
"moduleVersion": "0.1.
|
|
6
|
+
"moduleVersion": "0.1.3",
|
|
7
7
|
"kind": "external-resource",
|
|
8
8
|
"templateVersion": "1.0.0",
|
|
9
9
|
"platformCompatibility": ">=1.0.0 <2.0.0",
|
|
@@ -36,6 +36,12 @@
|
|
|
36
36
|
"type": "string",
|
|
37
37
|
"required": false,
|
|
38
38
|
"description": "Persistent Microsoft Dev Tunnel identifier used when this adapter owns lifecycle start/stop"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"key": "verificationEvidenceFile",
|
|
42
|
+
"type": "path",
|
|
43
|
+
"required": false,
|
|
44
|
+
"description": "JSON evidence for real file-relay and 429/5xx verification behind the configured public ingress"
|
|
39
45
|
}
|
|
40
46
|
],
|
|
41
47
|
"lifecycle": {
|