@flowselections/floriday-authenticatie-module 1.0.27 → 1.0.28
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floriday-gateway-hmac.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-gateway-hmac.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAczD,MAAM,MAAM,yBAAyB,GAAG,MACpC,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAClC,MAAM,GACN,IAAI,GACJ,SAAS,CAAC;AAId,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,yBAAyB,GAAG,IAAI,GACzC,IAAI,
|
|
1
|
+
{"version":3,"file":"floriday-gateway-hmac.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-gateway-hmac.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,wBAAwB,yBAAyB,CAAC;AAC/D,eAAO,MAAM,qBAAqB,sBAAsB,CAAC;AAczD,MAAM,MAAM,yBAAyB,GAAG,MACpC,OAAO,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAClC,MAAM,GACN,IAAI,GACJ,SAAS,CAAC;AAId,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,yBAAyB,GAAG,IAAI,GACzC,IAAI,CAKN;AAkDD,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,KAAK,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AA0BD;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,aAAa,GAAG,eAAe,CAAC,CAwC1C;AAQD,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,IAAI,CAAC;IACT,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,UAAU,CAAC;CACvB;AAaD,wBAAsB,0BAA0B,CAC9C,OAAO,EAAE,OAAO,GACf,OAAO,CAAC,mBAAmB,GAAG,eAAe,CAAC,CAyChD"}
|
|
@@ -17,13 +17,57 @@ const MAX_CLOCK_SKEW_MS = 5 * 60 * 1000;
|
|
|
17
17
|
let _secretResolver = null;
|
|
18
18
|
export function configureGatewayHmacSecret(resolver) {
|
|
19
19
|
_secretResolver = resolver;
|
|
20
|
+
// Bij (her)configuratie de central-cache invalideren; anders zou een
|
|
21
|
+
// eerder gecachede central-waarde de nieuwe resolver overschaduwen.
|
|
22
|
+
_cachedCentralSecret = null;
|
|
23
|
+
}
|
|
24
|
+
// Central-cache — spiegelt de conventie in floricode-credentials.server.ts
|
|
25
|
+
// (ACTIVE_KEY_TTL_MS = 60_000 + single-flight via inflight-promise).
|
|
26
|
+
// Waarde wordt NOOIT gelogd. Falen wordt NIET negatief gecached.
|
|
27
|
+
const GATEWAY_SECRET_TTL_MS = 60000;
|
|
28
|
+
let _cachedCentralSecret = null;
|
|
29
|
+
let _inflightCentral = null;
|
|
30
|
+
async function fetchGatewaySecretFromCentral() {
|
|
31
|
+
try {
|
|
32
|
+
const { getSecretFromCentral } = await import("./central-auth.server");
|
|
33
|
+
const result = await getSecretFromCentral("floriday_gateway_secret");
|
|
34
|
+
if (result.ok)
|
|
35
|
+
return result.value;
|
|
36
|
+
return null;
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// Env ontbreekt of netwerkfout → soft-miss; caller mapt naar 500.
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
20
42
|
}
|
|
21
43
|
async function resolveGatewaySecret() {
|
|
44
|
+
// 1. Escape hatch — expliciet geconfigureerde resolver heeft voorrang.
|
|
22
45
|
if (_secretResolver) {
|
|
23
46
|
const v = await _secretResolver();
|
|
24
47
|
return v ?? null;
|
|
25
48
|
}
|
|
26
|
-
|
|
49
|
+
// 2. Standalone Lovable-deploy — ongewijzigd env-pad.
|
|
50
|
+
const fromEnv = process.env.FLORIDAY_GATEWAY_SECRET;
|
|
51
|
+
if (fromEnv)
|
|
52
|
+
return fromEnv;
|
|
53
|
+
// 3. Shell-pad — haal bij central op via getSecretFromCentral. Cache met
|
|
54
|
+
// TTL + single-flight; geen negatief cachen.
|
|
55
|
+
const now = Date.now();
|
|
56
|
+
if (_cachedCentralSecret && now - _cachedCentralSecret.at < GATEWAY_SECRET_TTL_MS) {
|
|
57
|
+
return _cachedCentralSecret.value;
|
|
58
|
+
}
|
|
59
|
+
_inflightCentral ?? (_inflightCentral = (async () => {
|
|
60
|
+
try {
|
|
61
|
+
const v = await fetchGatewaySecretFromCentral();
|
|
62
|
+
if (v)
|
|
63
|
+
_cachedCentralSecret = { value: v, at: Date.now() };
|
|
64
|
+
return v;
|
|
65
|
+
}
|
|
66
|
+
finally {
|
|
67
|
+
_inflightCentral = null;
|
|
68
|
+
}
|
|
69
|
+
})());
|
|
70
|
+
return _inflightCentral;
|
|
27
71
|
}
|
|
28
72
|
async function hmacSha256Hex(secret, payload) {
|
|
29
73
|
const enc = new TextEncoder();
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export { verifyGatewayCaller, verifyGatewayBinaryCaller, corsPreflight, withCors, GATEWAY_CORS_HEADERS, resolveGatewayEnvironment, } from "../floriday-gateway-auth";
|
|
2
|
-
export { GATEWAY_HEADER_CALLER } from "../floriday-gateway-hmac";
|
|
2
|
+
export { GATEWAY_HEADER_CALLER, configureGatewayHmacSecret, } from "../floriday-gateway-hmac";
|
|
3
|
+
export type { GatewayHmacSecretResolver } from "../floriday-gateway-hmac";
|
|
3
4
|
export type { FlorydayEnvironment } from "../floriday.functions";
|
|
4
5
|
export { resolveFulfillmentOrderIds } from "../floriday-fulfillment-lookup.server";
|
|
5
6
|
export { resolveLogisticLabel } from "../floriday-labels.functions";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/lib/gateway/shared.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,aAAa,EACb,QAAQ,EACR,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/lib/gateway/shared.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EACnB,yBAAyB,EACzB,aAAa,EACb,QAAQ,EACR,oBAAoB,EACpB,yBAAyB,GAC1B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,YAAY,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAGjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACnF,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Gateway shared re-exports.
|
|
2
2
|
// Uitsluitend relatieve paden; consumers importeren via `./shared`.
|
|
3
3
|
export { verifyGatewayCaller, verifyGatewayBinaryCaller, corsPreflight, withCors, GATEWAY_CORS_HEADERS, resolveGatewayEnvironment, } from "../floriday-gateway-auth";
|
|
4
|
-
export { GATEWAY_HEADER_CALLER } from "../floriday-gateway-hmac";
|
|
4
|
+
export { GATEWAY_HEADER_CALLER, configureGatewayHmacSecret, } from "../floriday-gateway-hmac";
|
|
5
5
|
// Multi-caller PDF-resolvers (pdf, pdf-bulk, pdf-bulk-merged).
|
|
6
6
|
export { resolveFulfillmentOrderIds } from "../floriday-fulfillment-lookup.server";
|
|
7
7
|
export { resolveLogisticLabel } from "../floriday-labels.functions";
|
package/package.json
CHANGED
|
@@ -1,81 +1,100 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@flowselections/floriday-authenticatie-module",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"sideEffects": false,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist-lib/index.js",
|
|
7
|
-
"types": "./dist-lib/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist-lib/index.d.ts",
|
|
11
|
-
"default": "./dist-lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./gateway": {
|
|
14
|
-
"types": "./dist-lib/lib/gateway/index.d.ts",
|
|
15
|
-
"default": "./dist-lib/lib/gateway/index.js"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"files": [
|
|
19
|
-
"dist-lib",
|
|
20
|
-
"public"
|
|
21
|
-
],
|
|
22
|
-
"publishConfig": {
|
|
23
|
-
"access": "public"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"dev": "vite dev",
|
|
27
|
-
"build": "vite build",
|
|
28
|
-
"build:lib": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node -e \"require('fs').writeFileSync('dist-lib/styles.css', '@source \\\"./\\\";\\n')\"",
|
|
29
|
-
"build:lib:watch": "tsc -p tsconfig.build.json --watch",
|
|
30
|
-
"build:dev": "vite build --mode development",
|
|
31
|
-
"preview": "vite preview",
|
|
32
|
-
"lint": "eslint ."
|
|
33
|
-
},
|
|
34
|
-
"peerDependencies": {
|
|
35
|
-
"react": "^18 || ^19",
|
|
36
|
-
"react-dom": "^18 || ^19",
|
|
37
|
-
"@flowselections/core": "*"
|
|
38
|
-
},
|
|
39
|
-
"dependencies": {
|
|
40
|
-
"@supabase/supabase-js": "^2.105.4",
|
|
41
|
-
"pdf-lib": "^1.17.1"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@flowselections/core": "1.0.16",
|
|
45
|
-
"@eslint/js": "^9.32.0",
|
|
46
|
-
"@lovable.dev/vite-tanstack-config": "2.7.7",
|
|
47
|
-
"@types/node": "^22.16.5",
|
|
48
|
-
"@types/react": "^19.2.0",
|
|
49
|
-
"@types/react-dom": "^19.2.0",
|
|
50
|
-
"@vitejs/plugin-react": "^5.0.4",
|
|
51
|
-
"eslint": "^9.32.0",
|
|
52
|
-
"eslint-plugin-react-hooks": "^5.2.0",
|
|
53
|
-
"eslint-plugin-react-refresh": "^0.4.20",
|
|
54
|
-
"globals": "^15.15.0",
|
|
55
|
-
"typescript": "^5.8.3",
|
|
56
|
-
"tsc-alias": "^1.8.0",
|
|
57
|
-
"typescript-eslint": "^8.56.1",
|
|
58
|
-
"vite": "^7.3.1",
|
|
59
|
-
"@cloudflare/vite-plugin": "^1.25.5",
|
|
60
|
-
"@rsbuild/core": "^1.0.0",
|
|
61
|
-
"@tailwindcss/vite": "^4.2.1",
|
|
62
|
-
"@tanstack/router-plugin": "^1.167.10",
|
|
63
|
-
"tailwindcss": "^4.2.1",
|
|
64
|
-
"tw-animate-css": "^1.3.4",
|
|
65
|
-
"vite-tsconfig-paths": "^6.0.2",
|
|
66
|
-
"react": "^19.2.0",
|
|
67
|
-
"react-dom": "^19.2.0",
|
|
68
|
-
"nitro": "3.0.260603-beta"
|
|
69
|
-
},
|
|
70
|
-
"private": false,
|
|
71
|
-
"flowselections": {
|
|
72
|
-
"moduleId": "Floriday Authenticatie",
|
|
73
|
-
"pages": [
|
|
74
|
-
{
|
|
75
|
-
"export": "FlorydayConnectionPage",
|
|
76
|
-
"route": "floriday-connection",
|
|
77
|
-
"title": "Connectie"
|
|
78
|
-
}
|
|
79
|
-
]
|
|
80
|
-
|
|
81
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@flowselections/floriday-authenticatie-module",
|
|
3
|
+
"version": "1.0.28",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist-lib/index.js",
|
|
7
|
+
"types": "./dist-lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist-lib/index.d.ts",
|
|
11
|
+
"default": "./dist-lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./gateway": {
|
|
14
|
+
"types": "./dist-lib/lib/gateway/index.d.ts",
|
|
15
|
+
"default": "./dist-lib/lib/gateway/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist-lib",
|
|
20
|
+
"public"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"dev": "vite dev",
|
|
27
|
+
"build": "vite build",
|
|
28
|
+
"build:lib": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node -e \"require('fs').writeFileSync('dist-lib/styles.css', '@source \\\"./\\\";\\n')\"",
|
|
29
|
+
"build:lib:watch": "tsc -p tsconfig.build.json --watch",
|
|
30
|
+
"build:dev": "vite build --mode development",
|
|
31
|
+
"preview": "vite preview",
|
|
32
|
+
"lint": "eslint ."
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18 || ^19",
|
|
36
|
+
"react-dom": "^18 || ^19",
|
|
37
|
+
"@flowselections/core": "*"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@supabase/supabase-js": "^2.105.4",
|
|
41
|
+
"pdf-lib": "^1.17.1"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"@flowselections/core": "1.0.16",
|
|
45
|
+
"@eslint/js": "^9.32.0",
|
|
46
|
+
"@lovable.dev/vite-tanstack-config": "2.7.7",
|
|
47
|
+
"@types/node": "^22.16.5",
|
|
48
|
+
"@types/react": "^19.2.0",
|
|
49
|
+
"@types/react-dom": "^19.2.0",
|
|
50
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
51
|
+
"eslint": "^9.32.0",
|
|
52
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
53
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
54
|
+
"globals": "^15.15.0",
|
|
55
|
+
"typescript": "^5.8.3",
|
|
56
|
+
"tsc-alias": "^1.8.0",
|
|
57
|
+
"typescript-eslint": "^8.56.1",
|
|
58
|
+
"vite": "^7.3.1",
|
|
59
|
+
"@cloudflare/vite-plugin": "^1.25.5",
|
|
60
|
+
"@rsbuild/core": "^1.0.0",
|
|
61
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
62
|
+
"@tanstack/router-plugin": "^1.167.10",
|
|
63
|
+
"tailwindcss": "^4.2.1",
|
|
64
|
+
"tw-animate-css": "^1.3.4",
|
|
65
|
+
"vite-tsconfig-paths": "^6.0.2",
|
|
66
|
+
"react": "^19.2.0",
|
|
67
|
+
"react-dom": "^19.2.0",
|
|
68
|
+
"nitro": "3.0.260603-beta"
|
|
69
|
+
},
|
|
70
|
+
"private": false,
|
|
71
|
+
"flowselections": {
|
|
72
|
+
"moduleId": "Floriday Authenticatie",
|
|
73
|
+
"pages": [
|
|
74
|
+
{
|
|
75
|
+
"export": "FlorydayConnectionPage",
|
|
76
|
+
"route": "floriday-connection",
|
|
77
|
+
"title": "Connectie"
|
|
78
|
+
}
|
|
79
|
+
],
|
|
80
|
+
"serverRoutes": [
|
|
81
|
+
{ "routePath": "/api/public/gateway/active-environment", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleActiveEnvironment", "methods": ["POST", "OPTIONS"] },
|
|
82
|
+
{ "routePath": "/api/public/gateway/auto-process", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleAutoProcess", "methods": ["POST", "OPTIONS"] },
|
|
83
|
+
{ "routePath": "/api/public/gateway/cached-list", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleCachedList", "methods": ["POST"] },
|
|
84
|
+
{ "routePath": "/api/public/gateway/code-list", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleCodeList", "methods": ["POST"] },
|
|
85
|
+
{ "routePath": "/api/public/gateway/cron/scan", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleCronScan", "methods": ["POST", "OPTIONS"] },
|
|
86
|
+
{ "routePath": "/api/public/gateway/diagnostics", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleDiagnostics", "methods": ["POST", "OPTIONS"] },
|
|
87
|
+
{ "routePath": "/api/public/gateway/floricode-records", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleFloricodeRecords", "methods": ["POST"] },
|
|
88
|
+
{ "routePath": "/api/public/gateway/fulfillment-order/send", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleFulfillmentOrderSend", "methods": ["POST", "OPTIONS"] },
|
|
89
|
+
{ "routePath": "/api/public/gateway/media", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleMedia", "methods": ["POST", "OPTIONS"] },
|
|
90
|
+
{ "routePath": "/api/public/gateway/media-upload", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleMediaUpload", "methods": ["POST", "OPTIONS"] },
|
|
91
|
+
{ "routePath": "/api/public/gateway/pdf", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handlePdf", "methods": ["POST", "OPTIONS"] },
|
|
92
|
+
{ "routePath": "/api/public/gateway/pdf/bulk", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handlePdfBulk", "methods": ["POST", "OPTIONS"] },
|
|
93
|
+
{ "routePath": "/api/public/gateway/pdf/bulk-merged", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handlePdfBulkMerged", "methods": ["POST", "OPTIONS"] },
|
|
94
|
+
{ "routePath": "/api/public/gateway/product-characteristics", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleProductCharacteristics", "methods": ["POST", "OPTIONS"] },
|
|
95
|
+
{ "routePath": "/api/public/gateway/schema", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleSchema", "methods": ["POST"] },
|
|
96
|
+
{ "routePath": "/api/public/gateway/supply-line", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleSupplyLine", "methods": ["POST", "OPTIONS"] },
|
|
97
|
+
{ "routePath": "/api/public/gateway/write", "import": "@flowselections/floriday-authenticatie-module/gateway", "handler": "handleWrite", "methods": ["POST"] }
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
}
|