@rndmjoker/proton-mcp 0.4.4 → 0.4.7
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/README.md +36 -12
- package/dist/mail/compose.d.ts +50 -24
- package/dist/mail/compose.js +62 -31
- package/dist/mail/compose.js.map +1 -1
- package/dist/mail/ids.d.ts +5 -1
- package/dist/mail/ids.js.map +1 -1
- package/dist/mail/markup.d.ts +66 -4
- package/dist/mail/markup.js +239 -41
- package/dist/mail/markup.js.map +1 -1
- package/dist/mail/messages.d.ts +5 -1
- package/dist/mail/messages.js.map +1 -1
- package/dist/mail/search.d.ts +8 -2
- package/dist/mail/search.js.map +1 -1
- package/dist/server.js +6 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/confirm.d.ts +38 -5
- package/dist/tools/confirm.js +95 -49
- package/dist/tools/confirm.js.map +1 -1
- package/dist/tools/drafts.js +43 -9
- package/dist/tools/drafts.js.map +1 -1
- package/dist/tools/failures.d.ts +12 -0
- package/dist/tools/failures.js +24 -0
- package/dist/tools/failures.js.map +1 -1
- package/dist/tools/format.d.ts +4 -0
- package/dist/tools/format.js +76 -12
- package/dist/tools/format.js.map +1 -1
- package/dist/tools/guidance.js +61 -14
- package/dist/tools/guidance.js.map +1 -1
- package/dist/tools/interface.js +7 -3
- package/dist/tools/interface.js.map +1 -1
- package/dist/tools/pending-view.d.ts +46 -0
- package/dist/tools/pending-view.js +63 -0
- package/dist/tools/pending-view.js.map +1 -0
- package/dist/tools/preview.d.ts +70 -0
- package/dist/tools/preview.js +108 -0
- package/dist/tools/preview.js.map +1 -0
- package/dist/tools/send.js +53 -11
- package/dist/tools/send.js.map +1 -1
- package/dist/tools/updates.d.ts +53 -0
- package/dist/tools/updates.js +134 -0
- package/dist/tools/updates.js.map +1 -0
- package/dist/web/layout.js +34 -0
- package/dist/web/layout.js.map +1 -1
- package/dist/web/pending.d.ts +72 -0
- package/dist/web/pending.js +196 -0
- package/dist/web/pending.js.map +1 -0
- package/dist/web/sections.js +6 -1
- package/dist/web/sections.js.map +1 -1
- package/dist/web/security.js +10 -0
- package/dist/web/security.js.map +1 -1
- package/dist/web/server.d.ts +14 -1
- package/dist/web/server.js +39 -0
- package/dist/web/server.js.map +1 -1
- package/package.json +4 -1
package/dist/tools/send.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/tools/send.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAKxB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAoB,MAAM,iBAAiB,CAAA;AAC/D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,GACP,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,cAAc,EACd,eAAe,EACf,WAAW,EACX,eAAe,EACf,SAAS,GAEV,MAAM,oBAAoB,CAAA;AAC3B,OAAO,EACL,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,QAAQ,EACR,WAAW,EACX,MAAM,GAEP,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,MAAM,EAAE,GAAG,CAAC,IAAY,EAAkB,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC,CAAA;AAEpF;;;;GAIG;AACH,MAAM,UAAU,GACd,+FAA+F;IAC/F,gGAAgG;IAChG,mBAAmB,CAAA;AAErB;;;;;;;GAOG;AACH,SAAS,eAAe,CAAC,K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,IAAI,CAAC;YACH,OAAO,MAAM,SAAS,CAAC,IAAI,EAAE,GAAG,EAAE,YAAY,EAAE,YAAY,EAAE,GAAG,EAAE,CACjE,mBAAmB,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,CACnE,CAAA;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,eAAe,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAA;QACpD,CAAC;IACH,CAAC,CAAC,EACJ,YAAY,CACb,CACJ,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: check_for_updates
|
|
3
|
+
*
|
|
4
|
+
* Asks the npm registry which version is current and compares it with the one
|
|
5
|
+
* running.
|
|
6
|
+
*
|
|
7
|
+
* ## The reason this file has a long comment
|
|
8
|
+
*
|
|
9
|
+
* Everything else in this server talks to `127.0.0.1` and nothing else. That is
|
|
10
|
+
* not an accident of implementation, it is the property the readme leads with:
|
|
11
|
+
* your mail is decrypted on your machine and nothing leaves it. This tool is the
|
|
12
|
+
* single exception, and an exception to a claim like that has to be small,
|
|
13
|
+
* visible and voluntary or it should not exist.
|
|
14
|
+
*
|
|
15
|
+
* So:
|
|
16
|
+
*
|
|
17
|
+
* - **It runs only when called.** No check at startup, no timer, nothing in the
|
|
18
|
+
* background. A server that phones out on its own schedule is a different
|
|
19
|
+
* thing from one that answers a question.
|
|
20
|
+
* - **One address, and it is in the source.** `registry.npmjs.org`, over TLS,
|
|
21
|
+
* for one package name.
|
|
22
|
+
* - **It sends nothing about you.** A GET for a public package. The registry
|
|
23
|
+
* learns an IP asked about proton-mcp, which is what installing it already
|
|
24
|
+
* tells them.
|
|
25
|
+
* - **It installs nothing.** A server that replaces its own code is exactly what
|
|
26
|
+
* you do not want from something holding a mailbox. It says what to run.
|
|
27
|
+
* - **Failure is an answer.** Offline, a proxy, a registry that is down: the
|
|
28
|
+
* reply says it could not look, not that anything is broken.
|
|
29
|
+
*
|
|
30
|
+
* The tool description states the outgoing connection, so a model can tell the
|
|
31
|
+
* user before calling rather than after.
|
|
32
|
+
*/
|
|
33
|
+
import type { McpServer } from '@modelcontextprotocol/server';
|
|
34
|
+
/** The package this server is published as. */
|
|
35
|
+
export declare const PACKAGE = "@rndmjoker/proton-mcp";
|
|
36
|
+
/** Long enough for a slow connection, short enough not to hold a tool call. */
|
|
37
|
+
export declare const LOOKUP_TIMEOUT_MS = 5000;
|
|
38
|
+
/** Compares two version strings. Returns true when `latest` is newer. */
|
|
39
|
+
export declare function isNewer(latest: string, running: string): boolean;
|
|
40
|
+
export interface UpdateCheck {
|
|
41
|
+
latest?: string;
|
|
42
|
+
/** Set when the registry could not be asked. Not an error, an answer. */
|
|
43
|
+
unreachable?: string;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Asks the registry for the version on the `latest` tag.
|
|
47
|
+
*
|
|
48
|
+
* Deliberately not `npm view`: spawning a package manager from a mail server to
|
|
49
|
+
* answer a question is a lot of machinery, and it would inherit whatever
|
|
50
|
+
* registry and proxy configuration happens to be around. One request, one URL.
|
|
51
|
+
*/
|
|
52
|
+
export declare function latestVersion(fetchImpl?: typeof fetch, timeoutMs?: number): Promise<UpdateCheck>;
|
|
53
|
+
export declare function registerUpdateTool(server: McpServer, version: string): void;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool: check_for_updates
|
|
3
|
+
*
|
|
4
|
+
* Asks the npm registry which version is current and compares it with the one
|
|
5
|
+
* running.
|
|
6
|
+
*
|
|
7
|
+
* ## The reason this file has a long comment
|
|
8
|
+
*
|
|
9
|
+
* Everything else in this server talks to `127.0.0.1` and nothing else. That is
|
|
10
|
+
* not an accident of implementation, it is the property the readme leads with:
|
|
11
|
+
* your mail is decrypted on your machine and nothing leaves it. This tool is the
|
|
12
|
+
* single exception, and an exception to a claim like that has to be small,
|
|
13
|
+
* visible and voluntary or it should not exist.
|
|
14
|
+
*
|
|
15
|
+
* So:
|
|
16
|
+
*
|
|
17
|
+
* - **It runs only when called.** No check at startup, no timer, nothing in the
|
|
18
|
+
* background. A server that phones out on its own schedule is a different
|
|
19
|
+
* thing from one that answers a question.
|
|
20
|
+
* - **One address, and it is in the source.** `registry.npmjs.org`, over TLS,
|
|
21
|
+
* for one package name.
|
|
22
|
+
* - **It sends nothing about you.** A GET for a public package. The registry
|
|
23
|
+
* learns an IP asked about proton-mcp, which is what installing it already
|
|
24
|
+
* tells them.
|
|
25
|
+
* - **It installs nothing.** A server that replaces its own code is exactly what
|
|
26
|
+
* you do not want from something holding a mailbox. It says what to run.
|
|
27
|
+
* - **Failure is an answer.** Offline, a proxy, a registry that is down: the
|
|
28
|
+
* reply says it could not look, not that anything is broken.
|
|
29
|
+
*
|
|
30
|
+
* The tool description states the outgoing connection, so a model can tell the
|
|
31
|
+
* user before calling rather than after.
|
|
32
|
+
*/
|
|
33
|
+
import * as z from 'zod';
|
|
34
|
+
import { track } from '../in-flight.js';
|
|
35
|
+
/** The package this server is published as. */
|
|
36
|
+
export const PACKAGE = '@rndmjoker/proton-mcp';
|
|
37
|
+
/** Long enough for a slow connection, short enough not to hold a tool call. */
|
|
38
|
+
export const LOOKUP_TIMEOUT_MS = 5000;
|
|
39
|
+
/** Compares two version strings. Returns true when `latest` is newer. */
|
|
40
|
+
export function isNewer(latest, running) {
|
|
41
|
+
const parse = (v) => v
|
|
42
|
+
.split('-')[0]
|
|
43
|
+
.split('.')
|
|
44
|
+
.map((part) => Number.parseInt(part, 10) || 0);
|
|
45
|
+
const [a, b] = [parse(latest), parse(running)];
|
|
46
|
+
for (let i = 0; i < 3; i += 1) {
|
|
47
|
+
const left = a[i] ?? 0;
|
|
48
|
+
const right = b[i] ?? 0;
|
|
49
|
+
if (left !== right)
|
|
50
|
+
return left > right;
|
|
51
|
+
}
|
|
52
|
+
// Equal numbers, so a prerelease of that version is older than the release.
|
|
53
|
+
const preLatest = latest.includes('-');
|
|
54
|
+
const preRunning = running.includes('-');
|
|
55
|
+
if (preLatest !== preRunning)
|
|
56
|
+
return preRunning;
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Asks the registry for the version on the `latest` tag.
|
|
61
|
+
*
|
|
62
|
+
* Deliberately not `npm view`: spawning a package manager from a mail server to
|
|
63
|
+
* answer a question is a lot of machinery, and it would inherit whatever
|
|
64
|
+
* registry and proxy configuration happens to be around. One request, one URL.
|
|
65
|
+
*/
|
|
66
|
+
export async function latestVersion(fetchImpl = fetch, timeoutMs = LOOKUP_TIMEOUT_MS) {
|
|
67
|
+
const stop = AbortSignal.timeout(timeoutMs);
|
|
68
|
+
try {
|
|
69
|
+
// encodeURIComponent rather than replacing the slash by hand. The hand
|
|
70
|
+
// version worked for this one name, which has exactly one slash, and would
|
|
71
|
+
// have encoded only the first of any others: a correctness that depends on
|
|
72
|
+
// the value never changing. Flagged by CodeQL, and it was right to.
|
|
73
|
+
const response = await fetchImpl(`https://registry.npmjs.org/${encodeURIComponent(PACKAGE)}/latest`, { signal: stop, headers: { accept: 'application/json' } });
|
|
74
|
+
if (!response.ok) {
|
|
75
|
+
return { unreachable: `the registry answered ${response.status}` };
|
|
76
|
+
}
|
|
77
|
+
const body = (await response.json());
|
|
78
|
+
if (typeof body.version !== 'string') {
|
|
79
|
+
return { unreachable: 'the registry answered something without a version in it' };
|
|
80
|
+
}
|
|
81
|
+
return { latest: body.version };
|
|
82
|
+
}
|
|
83
|
+
catch (error) {
|
|
84
|
+
return { unreachable: error.message };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/** How to update, which depends on how it was started. */
|
|
88
|
+
const HOW = 'How to update depends on how it was installed, and the ways look identical from the outside:\n' +
|
|
89
|
+
' - through npx: clear the cache with "npm cache clean --force", since npx will otherwise ' +
|
|
90
|
+
'keep using what it already has\n' +
|
|
91
|
+
' - installed globally: "npm install -g @rndmjoker/proton-mcp@latest"\n' +
|
|
92
|
+
' - from a directory: "git pull --ff-only && npm ci && npm run build" in it\n\n' +
|
|
93
|
+
'The whole procedure, including how to tell which case applies, is at\n' +
|
|
94
|
+
'https://raw.githubusercontent.com/RndmJoker/proton-mcp/main/update.md\n\n' +
|
|
95
|
+
'**The client has to be restarted afterwards.** A running server keeps the old code, and ' +
|
|
96
|
+
'nothing about that is visible from the outside, which is the usual reason an update looks ' +
|
|
97
|
+
'like it did not work.';
|
|
98
|
+
export function registerUpdateTool(server, version) {
|
|
99
|
+
server.registerTool('check_for_updates', {
|
|
100
|
+
title: 'Check for a newer version',
|
|
101
|
+
description: 'Asks the npm registry whether a newer version of this server exists, and reports how to ' +
|
|
102
|
+
'install it. **This is the only thing in this server that connects to anything other than ' +
|
|
103
|
+
'the Proton Mail Bridge on this machine**, so call it when the user asks about updates ' +
|
|
104
|
+
'rather than by habit, and say that it means one request to registry.npmjs.org. It sends ' +
|
|
105
|
+
'nothing about the user or their mail, and it installs nothing: updating is left to the ' +
|
|
106
|
+
'person, deliberately.',
|
|
107
|
+
inputSchema: z.object({}),
|
|
108
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
109
|
+
}, async () => track(async () => {
|
|
110
|
+
const { latest, unreachable } = await latestVersion();
|
|
111
|
+
if (unreachable !== undefined) {
|
|
112
|
+
const answer = {
|
|
113
|
+
content: [
|
|
114
|
+
{
|
|
115
|
+
type: 'text',
|
|
116
|
+
text: `Running version ${version}. The registry could not be asked, so whether ` +
|
|
117
|
+
`there is a newer one is unknown: ${unreachable}.\n\n` +
|
|
118
|
+
'That is not a fault in this server and nothing needs fixing. Trying again ' +
|
|
119
|
+
'later is the whole remedy.',
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
};
|
|
123
|
+
return answer;
|
|
124
|
+
}
|
|
125
|
+
const text = isNewer(latest, version)
|
|
126
|
+
? `Version ${latest} is available. This server is running ${version}.\n\n${HOW}\n\n` +
|
|
127
|
+
'What changed is listed at https://github.com/RndmJoker/proton-mcp/releases, one ' +
|
|
128
|
+
'entry per version, and reading the ones in between is more use than the number.'
|
|
129
|
+
: `Running version ${version}, which is the current one. Nothing to do.`;
|
|
130
|
+
const answer = { content: [{ type: 'text', text }] };
|
|
131
|
+
return answer;
|
|
132
|
+
}, 'check_for_updates'));
|
|
133
|
+
}
|
|
134
|
+
//# sourceMappingURL=updates.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updates.js","sourceRoot":"","sources":["../../src/tools/updates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,CAAC,MAAM,KAAK,CAAA;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAEvC,+CAA+C;AAC/C,MAAM,CAAC,MAAM,OAAO,GAAG,uBAAuB,CAAA;AAE9C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAA;AAErC,yEAAyE;AACzE,MAAM,UAAU,OAAO,CAAC,MAAc,EAAE,OAAe;IACrD,MAAM,KAAK,GAAG,CAAC,CAAS,EAAY,EAAE,CACpC,CAAC;SACE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAE;SACd,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAElD,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;IAC9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACtB,MAAM,KAAK,GAAG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AA;QAE1E,MAAM,MAAM,GAAmB,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,EAAE,CAAA;QACpE,OAAO,MAAM,CAAA;IACf,CAAC,EAAE,mBAAmB,CAAC,CAC1B,CAAA;AACH,CAAC"}
|
package/dist/web/layout.js
CHANGED
|
@@ -441,7 +441,41 @@ const STYLES = `
|
|
|
441
441
|
.blocked { font-size: 13px; margin: 6px 0; color: var(--bad-text); }
|
|
442
442
|
.blocked::before { content: "Not available here: "; font-weight: 600; }
|
|
443
443
|
|
|
444
|
+
/*
|
|
445
|
+
* The message waiting to be sent.
|
|
446
|
+
*
|
|
447
|
+
* White regardless of the colour scheme, because that is the sheet a mail
|
|
448
|
+
* client puts it on. Showing it on a dark background would mean previewing a
|
|
449
|
+
* different message than the one that arrives.
|
|
450
|
+
*/
|
|
451
|
+
.preview {
|
|
452
|
+
display: block;
|
|
453
|
+
width: 100%;
|
|
454
|
+
height: 460px;
|
|
455
|
+
border: 1px solid var(--line);
|
|
456
|
+
border-radius: 8px;
|
|
457
|
+
background: #fff;
|
|
458
|
+
}
|
|
459
|
+
.preview-text {
|
|
460
|
+
margin: 0;
|
|
461
|
+
padding: 14px 16px;
|
|
462
|
+
max-height: 460px;
|
|
463
|
+
overflow: auto;
|
|
464
|
+
border: 1px solid var(--line);
|
|
465
|
+
border-radius: 8px;
|
|
466
|
+
background: var(--code);
|
|
467
|
+
font: 13px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
468
|
+
white-space: pre-wrap;
|
|
469
|
+
word-break: break-word;
|
|
470
|
+
}
|
|
471
|
+
|
|
444
472
|
table { border-collapse: collapse; width: 100%; font-size: 14px; }
|
|
473
|
+
/* Address tables carry three columns and long values; the 40 % label column
|
|
474
|
+
* of the definition tables would squeeze them. */
|
|
475
|
+
table.wide th { width: auto; }
|
|
476
|
+
table.wide td:first-child { word-break: break-all; }
|
|
477
|
+
ul { margin: 8px 0; padding-left: 20px; font-size: 14px; }
|
|
478
|
+
li { margin: 4px 0; }
|
|
445
479
|
th, td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
|
|
446
480
|
tr:last-child th, tr:last-child td { border-bottom: 0; }
|
|
447
481
|
th { color: var(--muted); font-weight: 500; width: 40%; }
|
package/dist/web/layout.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.js","sourceRoot":"","sources":["../../src/web/layout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,8EAA8E;AAC9E,MAAM,UAAU,UAAU,CAAC,KAAa;IACtC,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,CAAA;AAC3B,CAAC;AA8BD;;;;;;;GAOG;AACH,MAAM,KAAK,GAAG;IACZ,QAAQ,EACN,gEAAgE;IAClE,SAAS,EAAE,oCAAoC;IAC/C,MAAM,EAAE,wEAAwE;IAChF,WAAW,EACT,4DAA4D;IAC9D,QAAQ,EAAE,oCAAoC;CACtC,CAAA;AAEV,SAAS,IAAI,CAAC,IAAwB;IACpC,OAAO,CACL,gFAAgF;QAChF,qEAAqE,KAAK,CAAC,IAAI,CAAC,QAAQ,CACzF,CAAA;AACH,CAAC;AAED,wEAAwE;AACxE,SAAS,UAAU;IACjB,OAAO;QACL;YACE,OAAO,EAAE,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;SACzF;QACD;YACE,OAAO,EAAE,aAAa;YACtB,OAAO,EAAE;gBACP;oBACE,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I,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,KAAK,CAAA;IACzD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,CAAA;IACrC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,IAAI,CAAA;IACvC,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAA;IACxC,IAAI,OAAO,GAAG,EAAE;QAAE,OAAO,GAAG,OAAO,QAAQ,OAAO,GAAG,EAAE,IAAI,CAAA;IAC3D,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,GAAG,EAAE,CAAC,CAAA;IACtC,IAAI,KAAK,GAAG,EAAE;QAAE,OAAO,GAAG,KAAK,MAAM,OAAO,GAAG,EAAE,MAAM,CAAA;IACvD,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,EAAE,CAAC,MAAM,KAAK,GAAG,EAAE,IAAI,CAAA;AACtD,CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,WAAW,CAAC,OAA2B;IACrD,OAAO,OAAO,CAAC,CAAC,CAAC,sBAAsB,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;AACzE,CAAC;AAED,oCAAoC;AACpC,MAAM,UAAU,YAAY,CAAC,OAA2B;IACtD,OAAO,OAAO,CAAC,CAAC,CAAC,uBAAuB,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAA;AAC1E,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page that shows a message waiting to be sent.
|
|
3
|
+
*
|
|
4
|
+
* The one place in this interface that shows mail, and the exception is
|
|
5
|
+
* deliberate rather than a drift: this is the message the user is being asked
|
|
6
|
+
* to approve, it has not been sent yet, and they wrote it. Refusing to show it
|
|
7
|
+
* here would mean asking somebody to agree to something they are not allowed to
|
|
8
|
+
* read.
|
|
9
|
+
*
|
|
10
|
+
* **The answer is not given here.** There is no confirm button on this page and
|
|
11
|
+
* there must never be one. The access token for this interface reaches the
|
|
12
|
+
* assistant through `open_configuration`, so a button here could be pressed by
|
|
13
|
+
* the thing being supervised. The question is answered through the client,
|
|
14
|
+
* where it goes through a person.
|
|
15
|
+
*
|
|
16
|
+
* ## Rendering somebody else's markup
|
|
17
|
+
*
|
|
18
|
+
* A reply carries the quoted original byte for byte, which is arbitrary markup
|
|
19
|
+
* from a stranger. It is shown in a sandboxed frame with no permissions at all:
|
|
20
|
+
* no script, no forms, no same-origin access, so it cannot read the page around
|
|
21
|
+
* it, restyle it, or navigate it away. The page's own policy still applies
|
|
22
|
+
* inside, which is what keeps remote images from loading.
|
|
23
|
+
*
|
|
24
|
+
* That last part is worth stating on the page rather than leaving as a
|
|
25
|
+
* surprise, because a message full of images will look emptier here than it
|
|
26
|
+
* will in the recipient's mail client.
|
|
27
|
+
*/
|
|
28
|
+
import { type DisclaimerState } from './layout.js';
|
|
29
|
+
export interface PendingUrl {
|
|
30
|
+
url: string;
|
|
31
|
+
label: string;
|
|
32
|
+
kind: 'link' | 'image' | 'style';
|
|
33
|
+
}
|
|
34
|
+
export interface PendingData {
|
|
35
|
+
token: string;
|
|
36
|
+
disclaimer: DisclaimerState;
|
|
37
|
+
/** Which tool asked, so the page says what would actually happen. */
|
|
38
|
+
tool: string;
|
|
39
|
+
from: string;
|
|
40
|
+
to: string[];
|
|
41
|
+
cc: string[];
|
|
42
|
+
bcc: string[];
|
|
43
|
+
subject: string;
|
|
44
|
+
/** The message as the recipient would receive it, markup and all. */
|
|
45
|
+
html?: string;
|
|
46
|
+
/** The plain text body, for a message that carries no markup. */
|
|
47
|
+
text?: string;
|
|
48
|
+
/** Every address in the composed part, never shortened. */
|
|
49
|
+
urls: PendingUrl[];
|
|
50
|
+
/** Text a recipient can read that the body does not show. */
|
|
51
|
+
hiddenText: string[];
|
|
52
|
+
attachments: string[];
|
|
53
|
+
/** Present for a reply or a forward. Counted, not listed. */
|
|
54
|
+
quoted?: {
|
|
55
|
+
links: number;
|
|
56
|
+
images: number;
|
|
57
|
+
hiddenText: number;
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* Properties used beyond the ordinary set, when the wider markup level was
|
|
61
|
+
* chosen. Empty for almost every message.
|
|
62
|
+
*/
|
|
63
|
+
styleNotes: Array<{
|
|
64
|
+
property: string;
|
|
65
|
+
value: string;
|
|
66
|
+
element: string;
|
|
67
|
+
hides: boolean;
|
|
68
|
+
}>;
|
|
69
|
+
}
|
|
70
|
+
export declare function pendingPage(data: PendingData): string;
|
|
71
|
+
/** Shown when a preview is asked for that is no longer waiting. */
|
|
72
|
+
export declare function noPendingPage(token: string, disclaimer: DisclaimerState): string;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The page that shows a message waiting to be sent.
|
|
3
|
+
*
|
|
4
|
+
* The one place in this interface that shows mail, and the exception is
|
|
5
|
+
* deliberate rather than a drift: this is the message the user is being asked
|
|
6
|
+
* to approve, it has not been sent yet, and they wrote it. Refusing to show it
|
|
7
|
+
* here would mean asking somebody to agree to something they are not allowed to
|
|
8
|
+
* read.
|
|
9
|
+
*
|
|
10
|
+
* **The answer is not given here.** There is no confirm button on this page and
|
|
11
|
+
* there must never be one. The access token for this interface reaches the
|
|
12
|
+
* assistant through `open_configuration`, so a button here could be pressed by
|
|
13
|
+
* the thing being supervised. The question is answered through the client,
|
|
14
|
+
* where it goes through a person.
|
|
15
|
+
*
|
|
16
|
+
* ## Rendering somebody else's markup
|
|
17
|
+
*
|
|
18
|
+
* A reply carries the quoted original byte for byte, which is arbitrary markup
|
|
19
|
+
* from a stranger. It is shown in a sandboxed frame with no permissions at all:
|
|
20
|
+
* no script, no forms, no same-origin access, so it cannot read the page around
|
|
21
|
+
* it, restyle it, or navigate it away. The page's own policy still applies
|
|
22
|
+
* inside, which is what keeps remote images from loading.
|
|
23
|
+
*
|
|
24
|
+
* That last part is worth stating on the page rather than leaving as a
|
|
25
|
+
* surprise, because a message full of images will look emptier here than it
|
|
26
|
+
* will in the recipient's mail client.
|
|
27
|
+
*/
|
|
28
|
+
import { layout, escapeHtml } from './layout.js';
|
|
29
|
+
/** A row of recipients, or nothing when that field is empty. */
|
|
30
|
+
function recipientRow(label, addresses) {
|
|
31
|
+
if (addresses.length === 0)
|
|
32
|
+
return '';
|
|
33
|
+
return `<tr><th>${escapeHtml(label)}</th><td>${addresses
|
|
34
|
+
.map((a) => `<code>${escapeHtml(a)}</code>`)
|
|
35
|
+
.join('<br>')}</td></tr>`;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The message itself, in a frame that can do nothing.
|
|
39
|
+
*
|
|
40
|
+
* `sandbox` with no values at all is the maximally restrictive form: it denies
|
|
41
|
+
* scripts, forms, popups, navigation and same-origin access in one word. The
|
|
42
|
+
* content is passed through `srcdoc` rather than served from a path, so this
|
|
43
|
+
* server still serves no document it did not generate.
|
|
44
|
+
*/
|
|
45
|
+
function preview(data) {
|
|
46
|
+
if (data.html) {
|
|
47
|
+
return `<iframe class="preview" sandbox srcdoc="${escapeHtml(data.html)}"
|
|
48
|
+
title="The message as it will be received"></iframe>
|
|
49
|
+
<p class="hint">Shown as the recipient's mail client would lay it out. Images from the internet
|
|
50
|
+
are not loaded here, so a message that uses them looks emptier on this page than it will in a
|
|
51
|
+
mail client. Their addresses are listed below.</p>`;
|
|
52
|
+
}
|
|
53
|
+
return `<pre class="preview-text">${escapeHtml(data.text ?? '')}</pre>
|
|
54
|
+
<p class="hint">This message carries no markup, so this is exactly what arrives.</p>`;
|
|
55
|
+
}
|
|
56
|
+
function urlTable(urls) {
|
|
57
|
+
if (urls.length === 0) {
|
|
58
|
+
return '<div class="card"><p class="hint">This message contains no addresses at all.</p></div>';
|
|
59
|
+
}
|
|
60
|
+
const rows = urls
|
|
61
|
+
.map((u) => `<tr>
|
|
62
|
+
<td><code>${escapeHtml(u.url)}</code></td>
|
|
63
|
+
<td>${u.kind === 'style' ? 'CSS' : u.kind}</td>
|
|
64
|
+
<td>${u.label ? escapeHtml(u.label) : '<span class="hint">no text</span>'}</td>
|
|
65
|
+
</tr>`)
|
|
66
|
+
.join('\n');
|
|
67
|
+
return `<div class="card">
|
|
68
|
+
<table class="wide">
|
|
69
|
+
<tr><th>Address</th><th>Kind</th><th>Shown as</th></tr>
|
|
70
|
+
${rows}
|
|
71
|
+
</table>
|
|
72
|
+
<p class="hint"><strong>A link's text and its address are two different things.</strong> Read the
|
|
73
|
+
addresses, not the words they hide behind. That difference is the shape of every phishing message
|
|
74
|
+
ever written, and it is the reason this list is never shortened.</p>
|
|
75
|
+
</div>`;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* What the message does beyond ordinary formatting.
|
|
79
|
+
*
|
|
80
|
+
* The counterpart to the warning in the confirmation, and the reason that
|
|
81
|
+
* warning can be short: it says "go and look", and this is what there is to
|
|
82
|
+
* look at. Every property, its value, and the element it sat on, with the ones
|
|
83
|
+
* that really take something out of sight marked as such.
|
|
84
|
+
*
|
|
85
|
+
* Sorted so those come first. Somebody who reads three rows and stops should
|
|
86
|
+
* have read the three that matter.
|
|
87
|
+
*/
|
|
88
|
+
function styleTable(notes) {
|
|
89
|
+
if (notes.length === 0)
|
|
90
|
+
return '';
|
|
91
|
+
const sorted = [...notes].sort((a, b) => Number(b.hides) - Number(a.hides));
|
|
92
|
+
const rows = sorted
|
|
93
|
+
.map((n) => `<tr>
|
|
94
|
+
<td><code>${escapeHtml(n.property)}</code></td>
|
|
95
|
+
<td><code>${escapeHtml(n.value)}</code></td>
|
|
96
|
+
<td><code><${escapeHtml(n.element)}></code></td>
|
|
97
|
+
<td>${n.hides ? '<strong>hides content</strong>' : 'layout only'}</td>
|
|
98
|
+
</tr>`)
|
|
99
|
+
.join('\n');
|
|
100
|
+
const hiding = notes.filter((n) => n.hides).length;
|
|
101
|
+
return `<h2>Formatting beyond the ordinary set (${notes.length})</h2>
|
|
102
|
+
<div class="card">
|
|
103
|
+
${hiding > 0
|
|
104
|
+
? `<p><strong>${hiding} of these put something out of sight.</strong> The preview above shows
|
|
105
|
+
what a recipient sees; anything hidden is missing from it and from the text of this message
|
|
106
|
+
as well. Read the rows marked below and decide whether that is what was meant.</p>`
|
|
107
|
+
: `<p>None of these hides anything by itself. They are the properties that <em>can</em>, which
|
|
108
|
+
is why they are listed: a button needs <code>display: inline-block</code>, and the same
|
|
109
|
+
property with the value <code>none</code> would make text disappear.</p>`}
|
|
110
|
+
<table class="wide">
|
|
111
|
+
<tr><th>Property</th><th>Value</th><th>On</th><th>Effect</th></tr>
|
|
112
|
+
${rows}
|
|
113
|
+
</table>
|
|
114
|
+
<p class="hint">These were permitted because the message asked for markup level "extended". At
|
|
115
|
+
"standard" they would have been refused with a reason instead.</p>
|
|
116
|
+
</div>`;
|
|
117
|
+
}
|
|
118
|
+
export function pendingPage(data) {
|
|
119
|
+
const what = data.tool === 'send_reply'
|
|
120
|
+
? 'This reply'
|
|
121
|
+
: data.tool === 'send_forward'
|
|
122
|
+
? 'This forward'
|
|
123
|
+
: 'This message';
|
|
124
|
+
const hidden = data.hiddenText.length
|
|
125
|
+
? `<h2>Text the body does not show (${data.hiddenText.length})</h2>
|
|
126
|
+
<div class="card">
|
|
127
|
+
<ul>${data.hiddenText.map((t) => `<li><code>${escapeHtml(t)}</code></li>`).join('')}</ul>
|
|
128
|
+
<p class="hint">Alt texts and titles. Measured: mail clients block remote images by default, so an
|
|
129
|
+
image's alt text is frequently what the recipient actually reads, and it appears nowhere in the
|
|
130
|
+
body above.</p>
|
|
131
|
+
</div>`
|
|
132
|
+
: '';
|
|
133
|
+
const files = data.attachments.length
|
|
134
|
+
? `<h2>Carried with it (${data.attachments.length})</h2>
|
|
135
|
+
<div class="card"><ul>${data.attachments
|
|
136
|
+
.map((f) => `<li>${escapeHtml(f)}</li>`)
|
|
137
|
+
.join('')}</ul></div>`
|
|
138
|
+
: '';
|
|
139
|
+
const quoted = data.quoted
|
|
140
|
+
? `<h2>The quoted message</h2>
|
|
141
|
+
<div class="card">
|
|
142
|
+
<p>Below your part, the message being answered is quoted as it was written, with
|
|
143
|
+
${data.quoted.links} link(s), ${data.quoted.images} image(s) and ${data.quoted.hiddenText} alt
|
|
144
|
+
text(s) of its own.</p>
|
|
145
|
+
<p class="hint">Those are counted rather than listed: they arrived in your mailbox already, and
|
|
146
|
+
listing thirty of them would bury the ones this message adds, which are the ones you are answering
|
|
147
|
+
for. They are visible in the preview above.</p>
|
|
148
|
+
</div>`
|
|
149
|
+
: '';
|
|
150
|
+
return layout({
|
|
151
|
+
title: 'Waiting to be sent',
|
|
152
|
+
section: 'none',
|
|
153
|
+
token: data.token,
|
|
154
|
+
disclaimer: data.disclaimer,
|
|
155
|
+
body: `<h1>${escapeHtml(what)} is waiting for your answer</h1>
|
|
156
|
+
<p class="lead">Nothing has been sent. Read it here, then answer the question in your assistant.
|
|
157
|
+
<strong>There is no button on this page on purpose</strong>: the answer goes through your client,
|
|
158
|
+
where it goes through you.</p>
|
|
159
|
+
|
|
160
|
+
<div class="card"><table>
|
|
161
|
+
<tr><th>From</th><td><code>${escapeHtml(data.from)}</code></td></tr>
|
|
162
|
+
${recipientRow('To', data.to)}
|
|
163
|
+
${recipientRow('Cc', data.cc)}
|
|
164
|
+
${recipientRow('Bcc', data.bcc)}
|
|
165
|
+
<tr><th>Subject</th><td>${escapeHtml(data.subject || '(no subject)')}</td></tr>
|
|
166
|
+
</table></div>
|
|
167
|
+
|
|
168
|
+
<h2>The message</h2>
|
|
169
|
+
<div class="card">${preview(data)}</div>
|
|
170
|
+
|
|
171
|
+
<h2>Every address in it (${data.urls.length})</h2>
|
|
172
|
+
${urlTable(data.urls)}
|
|
173
|
+
|
|
174
|
+
${styleTable(data.styleNotes)}
|
|
175
|
+
${hidden}
|
|
176
|
+
${files}
|
|
177
|
+
${quoted}`,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
/** Shown when a preview is asked for that is no longer waiting. */
|
|
181
|
+
export function noPendingPage(token, disclaimer) {
|
|
182
|
+
return layout({
|
|
183
|
+
title: 'Nothing waiting',
|
|
184
|
+
section: 'none',
|
|
185
|
+
token,
|
|
186
|
+
disclaimer,
|
|
187
|
+
body: `<h1>Nothing is waiting to be sent</h1>
|
|
188
|
+
<p class="lead">Either the question was already answered, or it was asked long enough ago that the
|
|
189
|
+
message is no longer held.</p>
|
|
190
|
+
<p>Messages waiting for an answer are kept in memory only, never written to disk, and dropped as
|
|
191
|
+
soon as the answer arrives whichever way it went. That is why this page is empty rather than
|
|
192
|
+
showing you what used to be here.</p>
|
|
193
|
+
<p class="hint">If you were expecting a message, ask your assistant to try again.</p>`,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
//# sourceMappingURL=pending.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pending.js","sourceRoot":"","sources":["../../src/web/pending.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,MAAM,EAAE,UAAU,EAAwB,MAAM,aAAa,CAAA;AAoCtE,gEAAgE;AAChE,SAAS,YAAY,CAAC,KAAa,EAAE,SAAmB;IACtD,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IACrC,OAAO,WAAW,UAAU,CAAC,KAAK,CAAC,YAAY,SAAS;SACrD,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC;SAC3C,IAAI,CAAC,MAAM,CAAC,YAAY,CAAA;AAC7B,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,OAAO,CAAC,IAAiB;IAChC,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;QACd,OAAO,2CAA2C,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;;;;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AC;;;EAGJ,IAAI,CAAC,MAAM,CAAC,KAAK,aAAa,IAAI,CAAC,MAAM,CAAC,MAAM,iBAAiB,IAAI,CAAC,MAAM,CAAC,UAAU;;;;;OAKlF;QACH,CAAC,CAAC,EAAE,CAAA;IAEN,OAAO,MAAM,CAAC;QACZ,KAAK,EAAE,oBAAoB;QAC3B,OAAO,EAAE,MAAM;QACf,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,IAAI,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC;;;;;;6BAMJ,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;EAChD,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;EAC3B,YAAY,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC;EAC3B,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC;0BACL,UAAU,CAAC,IAAI,CAAC,OAAO,IAAI,cAAc,CAAC;;;;oBAIhD,OAAO,CAAC,IAAI,CAAC;;2BAEN,IAAI,CAAC,IAAI,CAAC,MAAM;EACzC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;EAEnB,UAAU,CAAC,IAAI,CAAC,UAAU,CAAC;EAC3B,MAAM;EACN,KAAK;EACL,MAAM,EAAE;KACP,CAAC,CAAA;AACJ,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,aAAa,CAAC,KAAa,EAAE,UAA2B;IACtE,OAAO,MAAM,CAAC;QACZ,KAAK,EAAE,iBAAiB;QACxB,OAAO,EAAE,MAAM;QACf,KAAK;QACL,UAAU;QACV,IAAI,EAAE;;;;;;sFAM4E;KACnF,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/web/sections.js
CHANGED
|
@@ -11,7 +11,12 @@
|
|
|
11
11
|
* The counterpart is pages.ts, which holds what comes before signing in.
|
|
12
12
|
*/
|
|
13
13
|
import { layout, escapeHtml, formatDuration, errorBanner, noticeBanner, } from './layout.js';
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* A wall-clock time in the locale and timezone of the machine running the
|
|
16
|
+
* server, because the page is rendered there and carries no script to adjust
|
|
17
|
+
* it. Same thing for anyone at that machine, which is the ordinary case; read
|
|
18
|
+
* from a phone in another timezone it is the server's clock, not the reader's.
|
|
19
|
+
*/
|
|
15
20
|
function formatTime(at) {
|
|
16
21
|
return new Date(at).toLocaleTimeString();
|
|
17
22
|
}
|
package/dist/web/sections.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../src/web/sections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,MAAM,EACN,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAA;AAgBpB
|
|
1
|
+
{"version":3,"file":"sections.js","sourceRoot":"","sources":["../../src/web/sections.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EACL,MAAM,EACN,UAAU,EACV,cAAc,EACd,WAAW,EACX,YAAY,GAGb,MAAM,aAAa,CAAA;AAgBpB;;;;;GAKG;AACH,SAAS,UAAU,CAAC,EAAU;IAC5B,OAAO,IAAI,IAAI,CAAC,EAAE,CAAC,CAAC,kBAAkB,EAAE,CAAA;AAC1C,CAAC;AAED,wEAAwE;AACxE,SAAS,GAAG,CAAC,GAAW,EAAE,KAAa,EAAE,GAAG,GAAG,KAAK;IAClD,OAAO,WAAW,UAAU,CAAC,GAAG,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,YAAY,CAAA;AAC1F,CAAC;AAED,SAAS,KAAK,CAAC,OAAgB,EAAE,KAAa,EAAE,IAAY,EAAE,IAAY;IACxE,OAAO,MAAM,CAAC;QACZ,KAAK;QACL,OAAO;QACP,KAAK,EAAE,IAAI,CAAC,KAAK;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C,mBAAmB,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;eACrE,CAAA;IACX,CAAC,CAAC;SACD,MAAM,CAAC,OAAO,CAAC;SACf,IAAI,CAAC,IAAI,CAAC,CAAA;IAEb,OAAO,KAAK,CACV,WAAW,EACX,oBAAoB,EACpB,IAAI,EACJ;;;EAGF,QAAQ,IAAI,yEAAyE,EAAE,CACtF,CAAA;AACH,CAAC"}
|
package/dist/web/security.js
CHANGED
|
@@ -166,6 +166,16 @@ export function securityHeaders() {
|
|
|
166
166
|
"form-action 'self'",
|
|
167
167
|
"frame-ancestors 'none'",
|
|
168
168
|
"base-uri 'none'",
|
|
169
|
+
// For the one page that shows a message waiting to be sent. The content
|
|
170
|
+
// is passed as srcdoc rather than fetched, so this permits an inline
|
|
171
|
+
// document and nothing from anywhere.
|
|
172
|
+
//
|
|
173
|
+
// What the frame inherits from this policy is the point of putting it
|
|
174
|
+
// here at all: img-src stays 'self' data: inside it, so a message full of
|
|
175
|
+
// remote images loads none of them. A tracking pixel in a message being
|
|
176
|
+
// previewed would tell its author that the message was looked at, and a
|
|
177
|
+
// preview must not be an event anybody outside gets to observe.
|
|
178
|
+
"frame-src 'self'",
|
|
169
179
|
].join('; '),
|
|
170
180
|
'X-Content-Type-Options': 'nosniff',
|
|
171
181
|
'X-Frame-Options': 'DENY',
|