Skip to content

Commit

Permalink
Implement Queues
Browse files Browse the repository at this point in the history
  • Loading branch information
mrbbot committed May 12, 2023
1 parent edcdba0 commit 5268fc0
Show file tree
Hide file tree
Showing 44 changed files with 2,011 additions and 166 deletions.
146 changes: 90 additions & 56 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"node": ">=16.13"
},
"volta": {
"node": "16.13.0"
"node": "18.16.0"
}
}
8 changes: 5 additions & 3 deletions packages/tre/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,21 +39,23 @@
"source-map-support": "0.5.21",
"stoppable": "^1.1.0",
"undici": "^5.13.0",
"workerd": "^1.20230404.0",
"workerd": "^1.20230419.0",
"ws": "^8.11.0",
"youch": "^3.2.2",
"zod": "^3.20.6"
},
"devDependencies": {
"@cloudflare/workers-types": "^4.20221111.1",
"@cloudflare/workers-types": "^4.20230419.0",
"@types/better-sqlite3": "^7.6.2",
"@types/debug": "^4.1.7",
"@types/estree": "^1.0.0",
"@types/glob-to-regexp": "^0.4.1",
"@types/http-cache-semantics": "^4.0.1",
"@types/source-map-support": "^0.5.6",
"@types/stoppable": "^1.1.1",
"@types/ws": "^8.5.3"
"@types/ws": "^8.5.3",
"devalue": "^4.3.0",
"semiver": "^1.1.0"
},
"engines": {
"node": ">=16.13"
Expand Down
34 changes: 27 additions & 7 deletions packages/tre/src/cf.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import assert from "assert";
import { mkdir, readFile, stat, writeFile } from "fs/promises";
import path from "path";
import type { IncomingRequestCfProperties } from "@cloudflare/workers-types/experimental";
import { dim } from "kleur/colors";
import { fetch } from "undici";
import { Plugins } from "./plugins";
Expand All @@ -9,7 +10,8 @@ import { Log, OptionalZodTypeOf } from "./shared";
const defaultCfPath = path.resolve("node_modules", ".mf", "cf.json");
const defaultCfFetchEndpoint = "https://workers.cloudflare.com/cf.json";

const fallbackCf = {
export const fallbackCf: IncomingRequestCfProperties = {
asOrganization: "",
asn: 395747,
colo: "DFW",
city: "Austin",
Expand All @@ -28,16 +30,34 @@ const fallbackCf = {
tlsCipher: "AEAD-AES128-GCM-SHA256",
tlsVersion: "TLSv1.3",
tlsClientAuth: {
certIssuerDNLegacy: "",
certIssuerDN: "",
certPresented: "0",
certSubjectDNLegacy: "",
certVerified: "NONE",
certRevoked: "0",
certIssuerDN: "",
certSubjectDN: "",
certNotBefore: "",
certNotAfter: "",
certIssuerDNRFC2253: "",
certSubjectDNRFC2253: "",
certIssuerDNLegacy: "",
certSubjectDNLegacy: "",
certSerial: "",
certIssuerSerial: "",
certSKI: "",
certIssuerSKI: "",
certFingerprintSHA1: "",
certVerified: "NONE",
certFingerprintSHA256: "",
certNotBefore: "",
certNotAfter: "",
},
edgeRequestKeepAliveStatus: 0,
hostMetadata: undefined,
clientTrustScore: 99,
botManagement: {
corporateProxy: false,
verifiedBot: false,
ja3Hash: "25b4882c2bcb50cd6b469ff28c596742",
staticResource: false,
detectionIds: [],
score: 99,
},
};
// Milliseconds in 1 day
Expand Down
Loading

0 comments on commit 5268fc0

Please sign in to comment.