@flowselections/floriday-authenticatie-module 1.0.65 → 1.0.68
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.
|
@@ -15,6 +15,12 @@ export type ShellRoutesReport = {
|
|
|
15
15
|
advice: string | null;
|
|
16
16
|
error?: string;
|
|
17
17
|
};
|
|
18
|
+
/**
|
|
19
|
+
* Bediend = geen HTML en (geen 404, of 404 met onze JSON-weigering {ok:false}).
|
|
20
|
+
* webhook-in antwoordt bewust 404 {ok:false} zonder geldig token; dezelfde
|
|
21
|
+
* regel als probeWebhookCallbackBase in gateway/webhook-subscribe.ts.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isServedRouteResponse(status: number, contentType: string, body: string): boolean;
|
|
18
24
|
/** Controleert alle gateway-routes op `base` (standaard: shell-host uit Central Auth). */
|
|
19
25
|
export declare function checkShellRoutes(opts?: {
|
|
20
26
|
base?: string | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shell-routes.d.ts","sourceRoot":"","sources":["../../src/lib/shell-routes.ts"],"names":[],"mappings":"AAYA,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,wwBAsBvB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;
|
|
1
|
+
{"version":3,"file":"shell-routes.d.ts","sourceRoot":"","sources":["../../src/lib/shell-routes.ts"],"names":[],"mappings":"AAYA,kFAAkF;AAClF,eAAO,MAAM,oBAAoB,wwBAsBvB,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,OAAO,CAAC;IACZ,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAKF;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAShG;AAqBD,0FAA0F;AAC1F,wBAAsB,gBAAgB,CAAC,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA4CvH;AAED,8FAA8F;AAC9F,wBAAsB,oBAAoB,CAAC,QAAQ,EAAE,GAAG,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlH"}
|
|
@@ -35,6 +35,24 @@ export const SHELL_GATEWAY_ROUTES = [
|
|
|
35
35
|
];
|
|
36
36
|
const TTL_MS = 5 * 60 * 1000;
|
|
37
37
|
const cache = new Map();
|
|
38
|
+
/**
|
|
39
|
+
* Bediend = geen HTML en (geen 404, of 404 met onze JSON-weigering {ok:false}).
|
|
40
|
+
* webhook-in antwoordt bewust 404 {ok:false} zonder geldig token; dezelfde
|
|
41
|
+
* regel als probeWebhookCallbackBase in gateway/webhook-subscribe.ts.
|
|
42
|
+
*/
|
|
43
|
+
export function isServedRouteResponse(status, contentType, body) {
|
|
44
|
+
if (contentType.includes("text/html"))
|
|
45
|
+
return false;
|
|
46
|
+
if (status !== 404)
|
|
47
|
+
return true;
|
|
48
|
+
try {
|
|
49
|
+
const j = JSON.parse(body);
|
|
50
|
+
return !!j && typeof j === "object" && j.ok === false;
|
|
51
|
+
}
|
|
52
|
+
catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
38
56
|
async function probe(base, path) {
|
|
39
57
|
try {
|
|
40
58
|
const res = await fetch(`${base}${path}`, {
|
|
@@ -44,9 +62,8 @@ async function probe(base, path) {
|
|
|
44
62
|
signal: AbortSignal.timeout(8000),
|
|
45
63
|
});
|
|
46
64
|
const ct = res.headers.get("content-type") ?? "";
|
|
47
|
-
await res.text().catch(() => "");
|
|
48
|
-
|
|
49
|
-
if (res.status === 404 || isHtml) {
|
|
65
|
+
const body = await res.text().catch(() => "");
|
|
66
|
+
if (!isServedRouteResponse(res.status, ct, body)) {
|
|
50
67
|
return { path, present: false, status: res.status, reason: "Shell kent deze route niet (404/website-pagina)" };
|
|
51
68
|
}
|
|
52
69
|
return { path, present: true, status: res.status, reason: null };
|