@serve.zone/coremail 1.0.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.
- package/.smartconfig.json +50 -0
- package/changelog.md +10 -0
- package/cli.js +4 -0
- package/dist_ts/00_commitinfo_data.d.ts +8 -0
- package/dist_ts/00_commitinfo_data.js +9 -0
- package/dist_ts/classes.auth.d.ts +45 -0
- package/dist_ts/classes.auth.js +204 -0
- package/dist_ts/classes.config.d.ts +2 -0
- package/dist_ts/classes.config.js +72 -0
- package/dist_ts/classes.coremail.d.ts +41 -0
- package/dist_ts/classes.coremail.js +155 -0
- package/dist_ts/classes.desiredstate.d.ts +40 -0
- package/dist_ts/classes.desiredstate.js +382 -0
- package/dist_ts/classes.gateway.d.ts +62 -0
- package/dist_ts/classes.gateway.js +669 -0
- package/dist_ts/classes.inbound.d.ts +49 -0
- package/dist_ts/classes.inbound.js +702 -0
- package/dist_ts/classes.maintenance.d.ts +16 -0
- package/dist_ts/classes.maintenance.js +339 -0
- package/dist_ts/classes.models.d.ts +161 -0
- package/dist_ts/classes.models.js +595 -0
- package/dist_ts/classes.server.d.ts +40 -0
- package/dist_ts/classes.server.js +309 -0
- package/dist_ts/classes.storage.d.ts +32 -0
- package/dist_ts/classes.storage.js +317 -0
- package/dist_ts/classes.submissions.d.ts +33 -0
- package/dist_ts/classes.submissions.js +385 -0
- package/dist_ts/classes.transfer.d.ts +41 -0
- package/dist_ts/classes.transfer.js +289 -0
- package/dist_ts/coremail.cursor.d.ts +20 -0
- package/dist_ts/coremail.cursor.js +191 -0
- package/dist_ts/coremail.log.d.ts +3 -0
- package/dist_ts/coremail.log.js +11 -0
- package/dist_ts/coremail.mime.d.ts +8 -0
- package/dist_ts/coremail.mime.js +63 -0
- package/dist_ts/coremail.persistence.d.ts +148 -0
- package/dist_ts/coremail.persistence.js +695 -0
- package/dist_ts/coremail.quota.d.ts +29 -0
- package/dist_ts/coremail.quota.js +149 -0
- package/dist_ts/coremail.selectors.d.ts +3 -0
- package/dist_ts/coremail.selectors.js +21 -0
- package/dist_ts/coremail.validation.d.ts +9 -0
- package/dist_ts/coremail.validation.js +325 -0
- package/dist_ts/index.d.ts +4 -0
- package/dist_ts/index.js +39 -0
- package/dist_ts/interfaces.d.ts +92 -0
- package/dist_ts/interfaces.js +2 -0
- package/dist_ts/plugins.d.ts +11 -0
- package/dist_ts/plugins.js +12 -0
- package/license.md +19 -0
- package/package.json +48 -0
- package/readme.md +199 -0
- package/ts/00_commitinfo_data.ts +8 -0
- package/ts/classes.auth.ts +321 -0
- package/ts/classes.config.ts +104 -0
- package/ts/classes.coremail.ts +249 -0
- package/ts/classes.desiredstate.ts +508 -0
- package/ts/classes.gateway.ts +811 -0
- package/ts/classes.inbound.ts +898 -0
- package/ts/classes.maintenance.ts +335 -0
- package/ts/classes.models.ts +530 -0
- package/ts/classes.server.ts +444 -0
- package/ts/classes.storage.ts +448 -0
- package/ts/classes.submissions.ts +554 -0
- package/ts/classes.transfer.ts +379 -0
- package/ts/coremail.cursor.ts +328 -0
- package/ts/coremail.log.ts +21 -0
- package/ts/coremail.mime.ts +94 -0
- package/ts/coremail.persistence.ts +1156 -0
- package/ts/coremail.quota.ts +214 -0
- package/ts/coremail.selectors.ts +35 -0
- package/ts/coremail.validation.ts +446 -0
- package/ts/index.ts +38 -0
- package/ts/interfaces.ts +109 -0
- package/ts/plugins.ts +11 -0
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import type * as plugins from './plugins.js';
|
|
2
|
+
export type TCoreMailSessionKind = 'control' | 'workload';
|
|
3
|
+
export interface ICoreMailReplicaRuntime {
|
|
4
|
+
taskId: string;
|
|
5
|
+
serviceId: string;
|
|
6
|
+
rolloutId: string;
|
|
7
|
+
rolloutGeneration: number;
|
|
8
|
+
imageDigest: plugins.serveZoneInterfaces.data.TCoreMailSha256;
|
|
9
|
+
}
|
|
10
|
+
export interface ICoreMailConfig {
|
|
11
|
+
port: number;
|
|
12
|
+
hostnames: string[];
|
|
13
|
+
mongoDescriptor: {
|
|
14
|
+
mongoDbUrl: string;
|
|
15
|
+
mongoDbName: string;
|
|
16
|
+
maxPoolSize: number;
|
|
17
|
+
maxIdleTimeMS: number;
|
|
18
|
+
serverSelectionTimeoutMS: number;
|
|
19
|
+
socketTimeoutMS: number;
|
|
20
|
+
};
|
|
21
|
+
storageDescriptor: Record<string, unknown>;
|
|
22
|
+
bucketName: string;
|
|
23
|
+
controlBootstrap: plugins.serveZoneInterfaces.data.ICoreMailControlBootstrap;
|
|
24
|
+
resolveRuntimeSecret: (secretKeyArg: string) => string;
|
|
25
|
+
replica: ICoreMailReplicaRuntime;
|
|
26
|
+
}
|
|
27
|
+
export interface ICoreMailControlSession {
|
|
28
|
+
kind: 'control';
|
|
29
|
+
peerId: string;
|
|
30
|
+
credentialId: string;
|
|
31
|
+
credentialVersion: number;
|
|
32
|
+
authenticatedAt: number;
|
|
33
|
+
}
|
|
34
|
+
export interface ICoreMailWorkloadSession {
|
|
35
|
+
kind: 'workload';
|
|
36
|
+
peerId: string;
|
|
37
|
+
tenantId: string;
|
|
38
|
+
serviceId: string;
|
|
39
|
+
bindingId: string;
|
|
40
|
+
bindingRevision: number;
|
|
41
|
+
configEpoch: number;
|
|
42
|
+
credentialId: string;
|
|
43
|
+
credentialVersion: number;
|
|
44
|
+
bindingState: 'active' | 'draining';
|
|
45
|
+
capabilities: plugins.serveZoneInterfaces.data.TCoreMailCapability[];
|
|
46
|
+
allowedOperations: plugins.serveZoneInterfaces.data.TCoreMailWorkloadOperation[];
|
|
47
|
+
coreMailTransferOrigin: string;
|
|
48
|
+
authenticatedAt: number;
|
|
49
|
+
}
|
|
50
|
+
export type TCoreMailSession = ICoreMailControlSession | ICoreMailWorkloadSession;
|
|
51
|
+
export type TTransferAuthorityKind = 'control' | 'gateway' | 'workload';
|
|
52
|
+
export type TTransferGrantPurpose = 'desired-state-upload' | 'outbound-part-upload' | 'outbound-mime-download' | 'inbound-mime-upload' | 'inbound-mime-download';
|
|
53
|
+
export interface ITransferAuthority {
|
|
54
|
+
kind: TTransferAuthorityKind;
|
|
55
|
+
tenantId: string;
|
|
56
|
+
serviceId: string;
|
|
57
|
+
bindingId: string;
|
|
58
|
+
}
|
|
59
|
+
export interface ISubmissionPartRecord {
|
|
60
|
+
partId: string;
|
|
61
|
+
kind: plugins.serveZoneInterfaces.data.TCoreMailPartKind;
|
|
62
|
+
contentType: string;
|
|
63
|
+
filename?: string;
|
|
64
|
+
contentId?: string;
|
|
65
|
+
sha256: plugins.serveZoneInterfaces.data.TCoreMailSha256;
|
|
66
|
+
lengthBytes: number;
|
|
67
|
+
objectKey: string;
|
|
68
|
+
state: 'missing' | 'uploading' | 'complete' | 'failed';
|
|
69
|
+
grantId?: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ICoreMailReadiness {
|
|
72
|
+
live: boolean;
|
|
73
|
+
database: boolean;
|
|
74
|
+
objectStorage: boolean;
|
|
75
|
+
exactUpload: boolean;
|
|
76
|
+
exactPurge: boolean;
|
|
77
|
+
controlBootstrap: boolean;
|
|
78
|
+
gateway: boolean;
|
|
79
|
+
}
|
|
80
|
+
export interface ICoreMailAuthLimiterSnapshot {
|
|
81
|
+
inFlight: number;
|
|
82
|
+
tokens: number;
|
|
83
|
+
}
|
|
84
|
+
export interface ICoreMailPeer {
|
|
85
|
+
id: string;
|
|
86
|
+
data: Map<string, unknown>;
|
|
87
|
+
close(code?: number, reason?: string): void;
|
|
88
|
+
terminate(): void;
|
|
89
|
+
context: {
|
|
90
|
+
state: Record<string, unknown>;
|
|
91
|
+
};
|
|
92
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * as typedrequest from '@api.global/typedrequest';
|
|
2
|
+
export * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
|
3
|
+
export * as typedserver from '@api.global/typedserver';
|
|
4
|
+
export * as typedsocket from '@api.global/typedsocket';
|
|
5
|
+
export * as projectinfo from '@push.rocks/projectinfo';
|
|
6
|
+
export * as smartbucket from '@push.rocks/smartbucket';
|
|
7
|
+
export * as smartdata from '@push.rocks/smartdata';
|
|
8
|
+
export * as smartlog from '@push.rocks/smartlog';
|
|
9
|
+
export * as serveZoneInterfaces from '@serve.zone/interfaces';
|
|
10
|
+
export * as argon2 from 'argon2';
|
|
11
|
+
export * as nodeCrypto from 'node:crypto';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export * as typedrequest from '@api.global/typedrequest';
|
|
2
|
+
export * as typedrequestInterfaces from '@api.global/typedrequest-interfaces';
|
|
3
|
+
export * as typedserver from '@api.global/typedserver';
|
|
4
|
+
export * as typedsocket from '@api.global/typedsocket';
|
|
5
|
+
export * as projectinfo from '@push.rocks/projectinfo';
|
|
6
|
+
export * as smartbucket from '@push.rocks/smartbucket';
|
|
7
|
+
export * as smartdata from '@push.rocks/smartdata';
|
|
8
|
+
export * as smartlog from '@push.rocks/smartlog';
|
|
9
|
+
export * as serveZoneInterfaces from '@serve.zone/interfaces';
|
|
10
|
+
export * as argon2 from 'argon2';
|
|
11
|
+
export * as nodeCrypto from 'node:crypto';
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicGx1Z2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3BsdWdpbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLFlBQVksTUFBTSwwQkFBMEIsQ0FBQztBQUN6RCxPQUFPLEtBQUssc0JBQXNCLE1BQU0scUNBQXFDLENBQUM7QUFDOUUsT0FBTyxLQUFLLFdBQVcsTUFBTSx5QkFBeUIsQ0FBQztBQUN2RCxPQUFPLEtBQUssV0FBVyxNQUFNLHlCQUF5QixDQUFDO0FBQ3ZELE9BQU8sS0FBSyxXQUFXLE1BQU0seUJBQXlCLENBQUM7QUFDdkQsT0FBTyxLQUFLLFdBQVcsTUFBTSx5QkFBeUIsQ0FBQztBQUN2RCxPQUFPLEtBQUssU0FBUyxNQUFNLHVCQUF1QixDQUFDO0FBQ25ELE9BQU8sS0FBSyxRQUFRLE1BQU0sc0JBQXNCLENBQUM7QUFDakQsT0FBTyxLQUFLLG1CQUFtQixNQUFNLHdCQUF3QixDQUFDO0FBQzlELE9BQU8sS0FBSyxNQUFNLE1BQU0sUUFBUSxDQUFDO0FBQ2pDLE9BQU8sS0FBSyxVQUFVLE1BQU0sYUFBYSxDQUFDIn0=
|
package/license.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
Copyright (c) 2014 Task Venture Capital GmbH (hello@task.vc)
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
5
|
+
in the Software without restriction, including without limitation the rights
|
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
8
|
+
furnished to do so, subject to the following conditions:
|
|
9
|
+
|
|
10
|
+
The above copyright notice and this permission notice shall be included in all
|
|
11
|
+
copies or substantial portions of the Software.
|
|
12
|
+
|
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
19
|
+
SOFTWARE.
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@serve.zone/coremail",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Authenticated mail persistence and delivery orchestration for serve.zone workloads.",
|
|
5
|
+
"main": "dist_ts/index.js",
|
|
6
|
+
"typings": "dist_ts/index.d.ts",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"author": "Task Venture Capital GmbH",
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@git.zone/tsbuild": "^4.4.2",
|
|
12
|
+
"@git.zone/tsdocker": "^3.1.1",
|
|
13
|
+
"@git.zone/tsrun": "^2.0.6",
|
|
14
|
+
"@git.zone/tstest": "^3.6.7",
|
|
15
|
+
"@git.zone/tswatch": "^3.3.5",
|
|
16
|
+
"@push.rocks/smartmongo": "^7.0.0",
|
|
17
|
+
"@types/node": "^26.1.1"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@api.global/typedrequest": "^3.7.0",
|
|
21
|
+
"@api.global/typedrequest-interfaces": "^4.0.0",
|
|
22
|
+
"@api.global/typedserver": "^8.10.0",
|
|
23
|
+
"@api.global/typedsocket": "^5.1.0",
|
|
24
|
+
"@push.rocks/projectinfo": "^5.1.0",
|
|
25
|
+
"@push.rocks/smartbucket": "^4.11.0",
|
|
26
|
+
"@push.rocks/smartdata": "^10.4.0",
|
|
27
|
+
"@push.rocks/smartlog": "^3.2.2",
|
|
28
|
+
"@serve.zone/interfaces": "^22.0.0",
|
|
29
|
+
"argon2": "^0.45.1"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"ts/**/*",
|
|
33
|
+
"dist_ts/**/*",
|
|
34
|
+
"cli.js",
|
|
35
|
+
".smartconfig.json",
|
|
36
|
+
"readme.md",
|
|
37
|
+
"changelog.md",
|
|
38
|
+
"license.md"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"test": "tstest test/ --verbose --logfile --timeout 60",
|
|
42
|
+
"start": "node ./cli.js",
|
|
43
|
+
"startTs": "node ./cli.ts.js",
|
|
44
|
+
"build": "tsbuild tsfolders",
|
|
45
|
+
"build:docker": "tsdocker build --verbose",
|
|
46
|
+
"release:docker": "tsdocker push --verbose"
|
|
47
|
+
}
|
|
48
|
+
}
|
package/readme.md
ADDED
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
# @serve.zone/coremail
|
|
2
|
+
|
|
3
|
+
CoreMail is the authenticated mail persistence and delivery-orchestration
|
|
4
|
+
service for serve.zone workloads. Workloads use `@serve.zone/platformclient`;
|
|
5
|
+
CoreMail talks directly to the platform mail gateway implemented by dcrouter.
|
|
6
|
+
Coreflow provisions and reconciles bindings but does not proxy message traffic.
|
|
7
|
+
|
|
8
|
+
## Installation
|
|
9
|
+
|
|
10
|
+
```bash
|
|
11
|
+
pnpm add @serve.zone/coremail
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
The package exports the service lifecycle and its strict configuration reader:
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import { CoreMail, readCoreMailConfig } from '@serve.zone/coremail';
|
|
18
|
+
|
|
19
|
+
const coreMail = new CoreMail(readCoreMailConfig());
|
|
20
|
+
await coreMail.start();
|
|
21
|
+
|
|
22
|
+
process.once('SIGTERM', () => {
|
|
23
|
+
void coreMail.stop();
|
|
24
|
+
});
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Issue Reporting and Security
|
|
28
|
+
|
|
29
|
+
For reporting bugs, issues, or security vulnerabilities, please visit
|
|
30
|
+
[community.foss.global/](https://community.foss.global/). This is the central
|
|
31
|
+
community hub for all issue reporting. Developers who sign and comply with our
|
|
32
|
+
contribution agreement and go through identification can also get a
|
|
33
|
+
[code.foss.global/](https://code.foss.global/) account to submit Pull Requests
|
|
34
|
+
directly.
|
|
35
|
+
|
|
36
|
+
## Architecture
|
|
37
|
+
|
|
38
|
+
```text
|
|
39
|
+
workload
|
|
40
|
+
└─ @serve.zone/platformclient
|
|
41
|
+
└─ authenticated TypedSocket + grant-authorized HTTPS transfers
|
|
42
|
+
└─ CoreMail
|
|
43
|
+
├─ SmartData: bindings, grants, submissions, delivery state
|
|
44
|
+
├─ SmartBucket: message parts and immutable MIME objects
|
|
45
|
+
└─ authenticated TypedSocket ── dcrouter mail gateway
|
|
46
|
+
|
|
47
|
+
dcrouter ── grant-authorized HTTPS transfers ── CoreMail transfer origin
|
|
48
|
+
|
|
49
|
+
Cloudly desired state ── Coreflow reconciliation ── CoreMail
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
CoreMail enforces these boundaries:
|
|
53
|
+
|
|
54
|
+
- Workload, tenant, binding, credential version, binding revision, and desired
|
|
55
|
+
state epoch are server-owned session authority.
|
|
56
|
+
- Active and draining bindings derive their exact permitted operation set from
|
|
57
|
+
the shared contract; disabled bindings cannot authenticate.
|
|
58
|
+
- Every reconnect requires a new Argon2id-authenticated handshake.
|
|
59
|
+
- TypedSocket tags are routing metadata, never authentication.
|
|
60
|
+
- Message bytes never travel as JSON, base64 RPC payloads, or VirtualStreams.
|
|
61
|
+
One-time grants authorize bounded HTTP `PUT` or `GET` transfers.
|
|
62
|
+
- Only grant-token SHA-256 digests are persisted. Plaintext bearer and
|
|
63
|
+
credential material is never stored or logged.
|
|
64
|
+
- SmartData owns all structured persistence, indexes, cursor pagination,
|
|
65
|
+
fixed-window quotas, pending-inbound gauges, compare-and-set transitions,
|
|
66
|
+
and worker leases.
|
|
67
|
+
- SmartBucket owns all message parts and immutable serialized MIME objects,
|
|
68
|
+
with exact length and SHA-256 reconciliation.
|
|
69
|
+
- The service has no filesystem persistence path and no raw MongoDB access.
|
|
70
|
+
|
|
71
|
+
## Runtime surfaces
|
|
72
|
+
|
|
73
|
+
One strict hostname surface is exposed:
|
|
74
|
+
|
|
75
|
+
- `GET /live` reports process liveness.
|
|
76
|
+
- `GET /ready` reports database, exact object-storage, desired-state, and
|
|
77
|
+
authenticated gateway readiness.
|
|
78
|
+
- `GET|PUT /transfers/:grantId` consumes one-time transfer capabilities.
|
|
79
|
+
- `GET /socket` upgrades to the authenticated TypedSocket RPC transport.
|
|
80
|
+
|
|
81
|
+
HTTP TypedRequest and built-in routes are disabled. WebSocket messages are
|
|
82
|
+
limited to 64 KiB, unauthenticated connections have five seconds to complete
|
|
83
|
+
their first authentication request, and HTTP connection/header/request
|
|
84
|
+
deadlines are enforced by SmartServe.
|
|
85
|
+
|
|
86
|
+
## Configuration
|
|
87
|
+
|
|
88
|
+
Coreflow and the deployment secret foundation provide runtime configuration.
|
|
89
|
+
Malformed startup configuration terminates startup. Missing desired-state secret
|
|
90
|
+
references keep the affected gateway or cursor operation unavailable.
|
|
91
|
+
|
|
92
|
+
| Variable | Purpose |
|
|
93
|
+
| --- | --- |
|
|
94
|
+
| `COREMAIL_PORT` | Listener port; defaults to `3000` |
|
|
95
|
+
| `COREMAIL_HOSTNAMES` | Comma-separated canonical strict-surface hostnames; defaults to `coremail.serve.zone` |
|
|
96
|
+
| `COREMAIL_SERVICE_ID` | CoreMail service identity |
|
|
97
|
+
| `COREMAIL_TASK_ID` | Current immutable workload task identity |
|
|
98
|
+
| `COREMAIL_ROLLOUT_ID` | Current rollout identity |
|
|
99
|
+
| `COREMAIL_ROLLOUT_GENERATION` | Current rollout generation |
|
|
100
|
+
| `COREMAIL_IMAGE_DIGEST` | Current immutable `sha256:` image digest |
|
|
101
|
+
| `COREMAIL_MONGODB_URL` | MongoDB descriptor URL consumed only by SmartData |
|
|
102
|
+
| `COREMAIL_MONGODB_NAME` | SmartData database name |
|
|
103
|
+
| `COREMAIL_MONGODB_MAX_POOL_SIZE` | Bounded SmartData connection pool; defaults to `50` |
|
|
104
|
+
| `COREMAIL_STORAGE_DESCRIPTOR` | SmartBucket descriptor JSON |
|
|
105
|
+
| `COREMAIL_BUCKET_NAME` | SmartBucket bucket name |
|
|
106
|
+
| `COREMAIL_CONTROL_BOOTSTRAP` | Verifier-only Coreflow bootstrap contract JSON |
|
|
107
|
+
| `${gateway.credentialSecretKey}` | Runtime-only dcrouter peer credential referenced by desired state |
|
|
108
|
+
| `${cursorKeys[].secretKey}` | Runtime-only HMAC keys referenced by current/retiring desired-state cursor keys |
|
|
109
|
+
|
|
110
|
+
`COREMAIL_CONTROL_BOOTSTRAP` contains verifier material only. The matching
|
|
111
|
+
plaintext control credential is delivered only to Coreflow. Desired state
|
|
112
|
+
contains key references for gateway and rotating cursor credentials, never
|
|
113
|
+
their plaintext values. `gateway.endpointUrl` is the dcrouter TypedSocket
|
|
114
|
+
endpoint. `gateway.coreMailTransferOrigin` is CoreMail's canonical HTTPS origin;
|
|
115
|
+
dcrouter must return that exact origin during authentication before it can use
|
|
116
|
+
CoreMail-issued path-only transfer grants.
|
|
117
|
+
|
|
118
|
+
## Persistence and delivery behavior
|
|
119
|
+
|
|
120
|
+
Outbound submission preparation is idempotent per authenticated binding.
|
|
121
|
+
The first durable insert consumes one atomic fixed-UTC minute and day quota
|
|
122
|
+
unit; exact replays consume none.
|
|
123
|
+
Every part has a unique immutable object key and exact declared integrity.
|
|
124
|
+
Finalization reads verified parts, produces deterministic MIME with no `Bcc`
|
|
125
|
+
header, publishes that MIME exactly once, and queues a lease-fenced worker.
|
|
126
|
+
The downstream transport identity is the CoreMail submission ID and remains
|
|
127
|
+
stable across ambiguous responses and retries.
|
|
128
|
+
|
|
129
|
+
Inbound SMTP recipient resolution returns short-lived opaque handles. The
|
|
130
|
+
gateway uploads one immutable MIME object, after which CoreMail resumes a
|
|
131
|
+
SmartData saga that consumes handles and creates one delivery per binding.
|
|
132
|
+
Pending, fetching, and fetched deliveries consume the binding's pending-inbound
|
|
133
|
+
quota until the first successful acknowledgement.
|
|
134
|
+
Workloads list deliveries through a bounded cursor, fetch MIME through a
|
|
135
|
+
one-time grant, and may acknowledge only after the exact fetch completes.
|
|
136
|
+
Cursor signatures rotate through current and bounded retiring desired-state
|
|
137
|
+
keys without exposing runtime secret material.
|
|
138
|
+
|
|
139
|
+
Desired-state activation uses immutable snapshots and a strictly increasing
|
|
140
|
+
`configEpoch` compare-and-set pointer. Replayed or stale configurations cannot
|
|
141
|
+
replace newer authority.
|
|
142
|
+
|
|
143
|
+
Terminal outbound submissions and acknowledged inbound deliveries retain their
|
|
144
|
+
records and owned objects for 30 days. Abandoned outbound preparations and
|
|
145
|
+
handoff/idempotency receipts also expire after 30 days. Expired transfer grants
|
|
146
|
+
and recipient handles retain their records for another 24 hours. Pending,
|
|
147
|
+
fetching, and fetched inbound deliveries are never age-purged; their MIME stays
|
|
148
|
+
stored until acknowledgement and the acknowledged-delivery retention period
|
|
149
|
+
have elapsed.
|
|
150
|
+
|
|
151
|
+
## Development
|
|
152
|
+
|
|
153
|
+
```bash
|
|
154
|
+
pnpm install
|
|
155
|
+
pnpm run build
|
|
156
|
+
pnpm test
|
|
157
|
+
tsbuild check 'test/**/*'
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
The production image is built natively for `linux/amd64` and `linux/arm64`:
|
|
161
|
+
|
|
162
|
+
```bash
|
|
163
|
+
pnpm run build:docker
|
|
164
|
+
pnpm run release:docker
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## License and Legal Information
|
|
168
|
+
|
|
169
|
+
This repository contains open-source code licensed under the MIT License. A
|
|
170
|
+
copy of the license can be found in the [license.md](./license.md) file.
|
|
171
|
+
|
|
172
|
+
**Please note:** The MIT License does not grant permission to use the trade
|
|
173
|
+
names, trademarks, service marks, or product names of the project, except as
|
|
174
|
+
required for reasonable and customary use in describing the origin of the
|
|
175
|
+
work and reproducing the content of the NOTICE file.
|
|
176
|
+
|
|
177
|
+
### Trademarks
|
|
178
|
+
|
|
179
|
+
This project is owned and maintained by Task Venture Capital GmbH. The names
|
|
180
|
+
and logos associated with Task Venture Capital GmbH and any related products
|
|
181
|
+
or services are trademarks of Task Venture Capital GmbH or third parties, and
|
|
182
|
+
are not included within the scope of the MIT license granted herein.
|
|
183
|
+
|
|
184
|
+
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark
|
|
185
|
+
Guidelines or the guidelines of the respective third-party owners, and any
|
|
186
|
+
usage must be approved in writing. Third-party trademarks used herein are the
|
|
187
|
+
property of their respective owners and used only in a descriptive manner,
|
|
188
|
+
e.g. for an implementation of an API or similar.
|
|
189
|
+
|
|
190
|
+
### Company Information
|
|
191
|
+
|
|
192
|
+
Task Venture Capital GmbH<br>
|
|
193
|
+
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
194
|
+
|
|
195
|
+
For any legal inquiries or further information, please contact us via email at
|
|
196
|
+
hello@task.vc.
|
|
197
|
+
|
|
198
|
+
By using this repository, you acknowledge that you have read and understood
|
|
199
|
+
these terms. If you do not agree with them, you must not use the repository.
|