cursedbelt-server 4.69.0 โ 4.70.0
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.
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* ๐ด The door trusts nothing it is sent: every string is capped, the app's own query-key redaction
|
|
17
|
-
* ({@link REDACTED_QUERY_KEY},
|
|
17
|
+
* ({@link REDACTED_QUERY_KEY}, cursedbelt-core's, the copy `cursedbelt`'s reporter imports too) runs again
|
|
18
18
|
* here, and the account is the session's, never the body's. It may be mounted outside the session
|
|
19
19
|
* gate (a page that cannot sign in is exactly the page with a problem), so two bounds hold whoever
|
|
20
20
|
* calls it: at most {@link ClientIssuesOptions.maxRowsPerHour} rows an hour per app, and rows older
|
|
@@ -24,14 +24,13 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { Context } from "hono";
|
|
26
26
|
import { Hono } from "hono";
|
|
27
|
+
import { REDACTED_QUERY_KEY, redactQueryValues } from "cursedbelt-core/redact";
|
|
27
28
|
import type { D1LikeDatabase } from "../d1/types.js";
|
|
28
29
|
export declare const CLIENT_ISSUES_PATH = "/api/client-issues";
|
|
29
30
|
/** The table and its index, as one-line DDL for the app's schema. */
|
|
30
31
|
export declare const CLIENT_ISSUES_DDL: readonly string[];
|
|
31
|
-
/**
|
|
32
|
-
export
|
|
33
|
-
/** Every `key=value` whose key is a {@link REDACTED_QUERY_KEY}, its value replaced by `โฆ`. */
|
|
34
|
-
export declare function redactQueryValues(text: string): string;
|
|
32
|
+
/** The redaction is cursedbelt-core's ONE copy (forge task 4887) โ the browser's reporter imports the same. */
|
|
33
|
+
export { REDACTED_QUERY_KEY, redactQueryValues };
|
|
35
34
|
/**
|
|
36
35
|
* The words of a title with what varies between occurrences taken out โ numbers, ids, hosts,
|
|
37
36
|
* quoted names โ so "Video 42 is stuck" and "Video 97 is stuck" are one group for autopilot.
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { Hono } from "hono";
|
|
2
|
+
import { REDACTED_QUERY_KEY, redactQueryValues } from "cursedbelt-core/redact";
|
|
2
3
|
export const CLIENT_ISSUES_PATH = "/api/client-issues";
|
|
3
4
|
/** The table and its index, as one-line DDL for the app's schema. */
|
|
4
5
|
export const CLIENT_ISSUES_DDL = [
|
|
5
6
|
"CREATE TABLE IF NOT EXISTS client_issues ( id INTEGER PRIMARY KEY AUTOINCREMENT, at INTEGER NOT NULL, change TEXT NOT NULL, issue_id TEXT NOT NULL, area TEXT NOT NULL, stem TEXT NOT NULL, tone TEXT NOT NULL, outlook TEXT NOT NULL, title TEXT NOT NULL, occurrences INTEGER NOT NULL DEFAULT 1, started_at INTEGER NOT NULL, ended_at INTEGER, resolution TEXT NOT NULL DEFAULT '', page TEXT NOT NULL DEFAULT '', build TEXT NOT NULL DEFAULT '', user_agent TEXT NOT NULL DEFAULT '', user_key TEXT NOT NULL DEFAULT '', facts TEXT NOT NULL DEFAULT '[]', report TEXT NOT NULL DEFAULT '' )",
|
|
6
7
|
"CREATE INDEX IF NOT EXISTS idx_client_issues_at ON client_issues (at)",
|
|
7
8
|
];
|
|
8
|
-
/**
|
|
9
|
-
export
|
|
10
|
-
/** Every `key=value` whose key is a {@link REDACTED_QUERY_KEY}, its value replaced by `โฆ`. */
|
|
11
|
-
export function redactQueryValues(text) {
|
|
12
|
-
return text.replace(/([?&;]([^=&#\s]+)=)([^&#;\s]*)/g, (whole, head, key) => REDACTED_QUERY_KEY.test(key) ? `${head}โฆ` : whole);
|
|
13
|
-
}
|
|
9
|
+
/** The redaction is cursedbelt-core's ONE copy (forge task 4887) โ the browser's reporter imports the same. */
|
|
10
|
+
export { REDACTED_QUERY_KEY, redactQueryValues };
|
|
14
11
|
/**
|
|
15
12
|
* The words of a title with what varies between occurrences taken out โ numbers, ids, hosts,
|
|
16
13
|
* quoted names โ so "Video 42 is stuck" and "Video 97 is stuck" are one group for autopilot.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cursedbelt-server",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.70.0",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "The app-facing Bun/Hono server tier of the cursedbelt split โ storage, sharing, activity, guard, sync. React-free; cursedbelt-core below it.",
|
|
@@ -400,7 +400,7 @@
|
|
|
400
400
|
},
|
|
401
401
|
"dependencies": {
|
|
402
402
|
"argon2id": "1.0.1",
|
|
403
|
-
"cursedbelt-core": "^2.
|
|
403
|
+
"cursedbelt-core": "^2.18.0",
|
|
404
404
|
"cursedops": ">=0.8.1 <1.0.0",
|
|
405
405
|
"cwip": "^4.6.0",
|
|
406
406
|
"jose": "^6.2.3"
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
"@node-rs/argon2": "^2.0.2",
|
|
442
442
|
"@types/bun": "^1.3.14",
|
|
443
443
|
"@types/node": "^24",
|
|
444
|
-
"cursedbelt": "^5.
|
|
444
|
+
"cursedbelt": "^5.141.0",
|
|
445
445
|
"hono": "4.12.28",
|
|
446
446
|
"kysely": "^0.28.17",
|
|
447
447
|
"kysely-bun-sqlite": "^0.4.0",
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import { Database } from 'bun:sqlite';
|
|
6
6
|
import { describe, expect, test } from 'bun:test';
|
|
7
|
-
import {
|
|
8
|
-
import { createRequire } from 'node:module';
|
|
7
|
+
import { REDACTED_QUERY_KEY as coreKey, redactQueryValues as coreRedact } from 'cursedbelt-core/redact';
|
|
9
8
|
import { Hono } from 'hono';
|
|
10
9
|
import { createLocalD1 } from '../d1/local.js';
|
|
11
10
|
import {
|
|
@@ -137,18 +136,9 @@ describe('issueStem groups what varies between occurrences', () => {
|
|
|
137
136
|
});
|
|
138
137
|
});
|
|
139
138
|
|
|
140
|
-
describe('๐ด the redaction is
|
|
141
|
-
test('
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
const version = (JSON.parse(readFileSync(manifest, 'utf8')) as { version: string }).version;
|
|
145
|
-
const belt = (await import('cursedbelt/react/notifications')) as { REDACTED_QUERY_KEY?: RegExp };
|
|
146
|
-
const [major = 0, minor = 0] = version.split('.').map(Number);
|
|
147
|
-
// 5.140.0 is the first cursedbelt with the export; the publish bumps this devDependency past it.
|
|
148
|
-
if (major > 5 || (major === 5 && minor >= 140)) expect(belt.REDACTED_QUERY_KEY).toBeDefined();
|
|
149
|
-
if (belt.REDACTED_QUERY_KEY) {
|
|
150
|
-
expect(REDACTED_QUERY_KEY.source).toBe(belt.REDACTED_QUERY_KEY.source);
|
|
151
|
-
expect(REDACTED_QUERY_KEY.flags).toBe(belt.REDACTED_QUERY_KEY.flags);
|
|
152
|
-
}
|
|
139
|
+
describe('๐ด the redaction is cursedbelt-coreโs one copy, not a second that drifts', () => {
|
|
140
|
+
test('the door redacts with the very object cursedbelt-core exports', () => {
|
|
141
|
+
expect(REDACTED_QUERY_KEY).toBe(coreKey);
|
|
142
|
+
expect(redactQueryValues).toBe(coreRedact);
|
|
153
143
|
});
|
|
154
144
|
});
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
16
16
|
* ๐ด The door trusts nothing it is sent: every string is capped, the app's own query-key redaction
|
|
17
|
-
* ({@link REDACTED_QUERY_KEY},
|
|
17
|
+
* ({@link REDACTED_QUERY_KEY}, cursedbelt-core's, the copy `cursedbelt`'s reporter imports too) runs again
|
|
18
18
|
* here, and the account is the session's, never the body's. It may be mounted outside the session
|
|
19
19
|
* gate (a page that cannot sign in is exactly the page with a problem), so two bounds hold whoever
|
|
20
20
|
* calls it: at most {@link ClientIssuesOptions.maxRowsPerHour} rows an hour per app, and rows older
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
*/
|
|
25
25
|
import type { Context } from "hono";
|
|
26
26
|
import { Hono } from "hono";
|
|
27
|
+
import { REDACTED_QUERY_KEY, redactQueryValues } from "cursedbelt-core/redact";
|
|
27
28
|
import type { D1LikeDatabase } from "../d1/types.js";
|
|
28
29
|
|
|
29
30
|
export const CLIENT_ISSUES_PATH = "/api/client-issues";
|
|
@@ -34,15 +35,8 @@ export const CLIENT_ISSUES_DDL: readonly string[] = [
|
|
|
34
35
|
"CREATE INDEX IF NOT EXISTS idx_client_issues_at ON client_issues (at)",
|
|
35
36
|
];
|
|
36
37
|
|
|
37
|
-
/**
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
/** Every `key=value` whose key is a {@link REDACTED_QUERY_KEY}, its value replaced by `โฆ`. */
|
|
41
|
-
export function redactQueryValues(text: string): string {
|
|
42
|
-
return text.replace(/([?&;]([^=&#\s]+)=)([^&#;\s]*)/g, (whole, head: string, key: string) =>
|
|
43
|
-
REDACTED_QUERY_KEY.test(key) ? `${head}โฆ` : whole,
|
|
44
|
-
);
|
|
45
|
-
}
|
|
38
|
+
/** The redaction is cursedbelt-core's ONE copy (forge task 4887) โ the browser's reporter imports the same. */
|
|
39
|
+
export { REDACTED_QUERY_KEY, redactQueryValues };
|
|
46
40
|
|
|
47
41
|
/**
|
|
48
42
|
* The words of a title with what varies between occurrences taken out โ numbers, ids, hosts,
|