domma-cms 1.6.35 → 1.6.37
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/package.json +1 -1
- package/plugins/_lib/admin/mail/compose-window.js +4 -0
- package/plugins/_lib/admin/mail/mail.css +1 -1
- package/plugins/_lib/admin/mail/reader-view.js +15 -6
- package/plugins/_lib/call/ice.js +5 -2
- package/plugins/_lib/call/rooms.js +9 -3
- package/plugins/_lib/call/routes.js +7 -4
- package/plugins/_lib/mail/compose.js +7 -2
- package/plugins/_lib/mail/defaults.js +12 -0
- package/plugins/_lib/mail/hostGuard.js +86 -0
- package/plugins/_lib/mail/message-action.js +56 -0
- package/plugins/_lib/mail/readRoutes.js +20 -1
- package/plugins/_lib/mail/scheduler.js +2 -0
- package/plugins/_lib/mail/send.js +12 -3
- package/plugins/_lib/mail/store.js +16 -6
- package/plugins/_lib/outreach/index.js +1 -1
- package/plugins/_lib/outreach/ledger.js +10 -3
- package/plugins/_lib/outreach/sending.js +9 -3
- package/plugins/_lib/outreach/suppression.js +14 -3
- package/plugins/_lib/outreach/unsubscribe.js +13 -0
- package/plugins/_lib/public/call/call.js +3 -1
- package/plugins/blog/CLAUDE.md +11 -1
- package/plugins/blog/docs/guide.md +1 -1
- package/plugins/blog/lib/page.js +32 -0
- package/plugins/blog/plugin.js +58 -16
- package/plugins/blog/plugin.json +2 -2
- package/plugins/blog/plugin.public.js +5 -4
- package/plugins/blog/tests/public.test.js +30 -1
- package/plugins/booking/CLAUDE.md +4 -1
- package/plugins/booking/docs/guide.md +1 -1
- package/plugins/booking/plugin.js +16 -21
- package/plugins/booking/plugin.json +2 -2
- package/plugins/booking/tests/api.test.js +26 -1
- package/plugins/feedback/CLAUDE.md +7 -2
- package/plugins/feedback/admin/views/feedback.js +1 -1
- package/plugins/feedback/lib/receiver.js +1 -1
- package/plugins/feedback/plugin.json +3 -3
- package/plugins/free-tier.lock.json +42 -41
- package/plugins/mail-reader/CLAUDE.md +6 -0
- package/plugins/mail-reader/docs/guide.md +1 -0
- package/plugins/mail-reader/plugin.json +2 -2
- package/plugins/shopping-cart/CLAUDE.md +17 -1
- package/plugins/shopping-cart/docs/guide.md +1 -1
- package/plugins/shopping-cart/lib/accounts.js +8 -3
- package/plugins/shopping-cart/lib/payments.js +7 -4
- package/plugins/shopping-cart/lib/shop.js +8 -3
- package/plugins/shopping-cart/plugin.js +77 -41
- package/plugins/shopping-cart/plugin.json +2 -2
- package/plugins/shopping-cart/public/account.js +2 -2
- package/plugins/shopping-cart/tests/accounts.test.js +10 -1
- package/plugins/shopping-cart/tests/api.test.js +23 -0
- package/plugins/shopping-cart/tests/pure.test.js +16 -1
- package/plugins/support/CLAUDE.md +6 -0
- package/plugins/support/admin/views/support.js +1 -1
- package/plugins/support/docs/guide.md +90 -0
- package/plugins/support/lib/receiver.js +1 -1
- package/plugins/support/plugin.json +3 -3
- package/server/routes/api/analytics.js +32 -0
- package/server/routes/api/collections.js +148 -15
- package/server/routes/outreach-public.js +54 -10
- package/server/server.js +5 -1
- package/server/services/authChecks.js +8 -0
- package/server/services/collectionAccess.js +191 -0
- package/server/services/collections.js +8 -2
- package/server/services/request-log.js +70 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Request log redaction - credentials never reach the pino request line.
|
|
3
|
+
*
|
|
4
|
+
* Several routes carry a live credential in the query string: the mail reader's
|
|
5
|
+
* `/body?token=` grant, the ecards `/ecards/view?token=` link, the call invite's
|
|
6
|
+
* `?key=`. Fastify's default `req` serializer logs `req.url` whole, so the log
|
|
7
|
+
* (and anything shipping it) held usable tokens for as long as it was kept.
|
|
8
|
+
*
|
|
9
|
+
* Only the VALUES of the sensitive parameters are replaced; the path, the other
|
|
10
|
+
* parameters and every other field Fastify logs stay exactly as before, so log
|
|
11
|
+
* greps keep working.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/** Parameter names redacted whatever their case. */
|
|
15
|
+
const SENSITIVE = new Set(['token', 't', 'key', 'hostkey', 'invitekey']);
|
|
16
|
+
|
|
17
|
+
/** Anything with secret or password in the name is redacted too. */
|
|
18
|
+
const SENSITIVE_PATTERN = /secret|password|passwd/i;
|
|
19
|
+
|
|
20
|
+
export const REDACTED = '[redacted]';
|
|
21
|
+
|
|
22
|
+
/** Is this query parameter a credential? */
|
|
23
|
+
export function isSensitiveParam(name) {
|
|
24
|
+
const n = String(name ?? '');
|
|
25
|
+
return SENSITIVE.has(n.toLowerCase()) || SENSITIVE_PATTERN.test(n);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* The URL with credential values replaced by `[redacted]`.
|
|
30
|
+
*
|
|
31
|
+
* Works on the raw query text rather than URLSearchParams so a URL that does
|
|
32
|
+
* not re-encode identically still logs as it was requested: only the value
|
|
33
|
+
* between `=` and the next `&` (or `#`) is replaced.
|
|
34
|
+
*
|
|
35
|
+
* @param {string} url
|
|
36
|
+
* @returns {string}
|
|
37
|
+
*/
|
|
38
|
+
export function redactUrl(url) {
|
|
39
|
+
if (typeof url !== 'string') return url;
|
|
40
|
+
const q = url.indexOf('?');
|
|
41
|
+
if (q === -1) return url;
|
|
42
|
+
const hash = url.indexOf('#', q);
|
|
43
|
+
const query = hash === -1 ? url.slice(q + 1) : url.slice(q + 1, hash);
|
|
44
|
+
if (!query) return url;
|
|
45
|
+
const cleaned = query.split('&').map((pair) => {
|
|
46
|
+
if (!pair) return pair;
|
|
47
|
+
const eq = pair.indexOf('=');
|
|
48
|
+
const name = eq === -1 ? pair : pair.slice(0, eq);
|
|
49
|
+
let decoded = name;
|
|
50
|
+
try { decoded = decodeURIComponent(name); } catch { /* keep as sent */ }
|
|
51
|
+
if (!isSensitiveParam(decoded)) return pair;
|
|
52
|
+
return `${name}=${REDACTED}`;
|
|
53
|
+
}).join('&');
|
|
54
|
+
return url.slice(0, q + 1) + cleaned + (hash === -1 ? '' : url.slice(hash));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Fastify's default `req` serializer (fastify/lib/logger-pino.js) with the
|
|
59
|
+
* url redacted. Field for field the same otherwise.
|
|
60
|
+
*/
|
|
61
|
+
export function requestSerializer(req) {
|
|
62
|
+
return {
|
|
63
|
+
method: req.method,
|
|
64
|
+
url: redactUrl(req.url),
|
|
65
|
+
version: req.headers && req.headers['accept-version'],
|
|
66
|
+
host: req.host,
|
|
67
|
+
remoteAddress: req.ip,
|
|
68
|
+
remotePort: req.socket ? req.socket.remotePort : undefined,
|
|
69
|
+
};
|
|
70
|
+
}
|