@uuaid/pillar 2.6.0 → 2.6.1
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/HOSTING-LIMITS.md +12 -0
- package/bin/carrier.mjs +51 -2
- package/package.json +1 -1
package/HOSTING-LIMITS.md
CHANGED
|
@@ -84,6 +84,18 @@ acceptance receipt signed from the stored row (src/net/carrier-receipt.mjs).
|
|
|
84
84
|
The carrier never mints this key: a missing or unreadable file refuses to
|
|
85
85
|
start. Without the option nothing changes.
|
|
86
86
|
|
|
87
|
+
**A carrier that is also a seed (from 2.6.1).** Add `--seed-keychain <file>`
|
|
88
|
+
(`CARRIER_SEED_KEYCHAIN`; passphrase in `CARRIER_SEED_KEYCHAIN_PASSPHRASE`,
|
|
89
|
+
default empty, removed from the environment once read) and `--public-url
|
|
90
|
+
<https://host>` (`CARRIER_PUBLIC_URL`), and the carrier also serves the signed
|
|
91
|
+
`GET /v1/seed-info` a seed registry enrolls, exactly as `pillar-seed` does,
|
|
92
|
+
while it keeps its receipt key and tier issuers. The two options go together.
|
|
93
|
+
The URL must pass the registry's own rule (https, no credentials, query or
|
|
94
|
+
private address). The seed key is never minted here (mint it with
|
|
95
|
+
`pillar-seed`), must differ from the receipt key, and must carry the uuaid its
|
|
96
|
+
key derives; any of these wrong refuses to start. Without them
|
|
97
|
+
`/v1/seed-info` stays 404 `not-a-seed`.
|
|
98
|
+
|
|
87
99
|
**Windows, memory, retention.** Every rate window is a sliding 60 s (:85),
|
|
88
100
|
held in process memory (:245), so a restart resets every budget; past 10,000
|
|
89
101
|
keys the oldest is dropped (:91). Envelopes are kept 14 days by default (:165;
|
package/bin/carrier.mjs
CHANGED
|
@@ -8,6 +8,8 @@
|
|
|
8
8
|
* carrier ... --trusted-proxy 10.0.0.5 # whose X-Forwarded-For counts (CARRIER_TRUSTED_PROXIES; default 127.0.0.1,::1)
|
|
9
9
|
* carrier ... --receipt-keychain /opt/pillar-carrier/receipt-keychain.json
|
|
10
10
|
* # sign uuaid.carrier-receipt.v1 receipts (default: off)
|
|
11
|
+
* carrier ... --seed-keychain /opt/pillar-carrier/seed/seed-keychain.json --public-url https://pillar.example.org
|
|
12
|
+
* # also serve a signed /v1/seed-info (default: off)
|
|
11
13
|
*
|
|
12
14
|
* Defaults to loopback (RedTeam F5) — expose only behind a TLS-terminating
|
|
13
15
|
* proxy (nginx/Caddy). Pass --host 0.0.0.0 deliberately only if the carrier
|
|
@@ -23,10 +25,23 @@
|
|
|
23
25
|
* here: a receipt key is a production key and comes from key custody. A
|
|
24
26
|
* missing or unreadable file refuses to start. Without the option the carrier
|
|
25
27
|
* signs nothing and every response is as before.
|
|
28
|
+
*
|
|
29
|
+
* Seed (2.6.1): with --seed-keychain (or CARRIER_SEED_KEYCHAIN) naming an
|
|
30
|
+
* existing seed keychain AND --public-url (or CARRIER_PUBLIC_URL) naming the
|
|
31
|
+
* https URL the proxy serves, the carrier also answers GET /v1/seed-info with
|
|
32
|
+
* the signed claim a seed registry enrolls, exactly as pillar-seed does, while
|
|
33
|
+
* it keeps its receipt key and tier issuers. The passphrase comes from
|
|
34
|
+
* CARRIER_SEED_KEYCHAIN_PASSPHRASE (default empty), which is removed from the
|
|
35
|
+
* environment once read. The seed key is NEVER minted here (pillar-seed mints
|
|
36
|
+
* seed keys), must be a different key from the receipt key, and its uuaid
|
|
37
|
+
* must be the one its public key derives. The two options go together; one
|
|
38
|
+
* without the other, a URL a registry would refuse, or a key that does not
|
|
39
|
+
* load refuses to start. Without them /v1/seed-info stays 404 as before.
|
|
26
40
|
*/
|
|
27
41
|
import "../src/node-check.mjs"; // must stay the first import: refuses Node < 22 before any dependency loads
|
|
28
42
|
import { CarrierServer, parseSecureDelete, parseCommunityWaits, MAX_TTL_DAYS } from "../src/net/carrier-server.mjs";
|
|
29
|
-
import { Keychain } from "../src/identity/keychain.mjs";
|
|
43
|
+
import { Keychain, keyDerivesUuaid } from "../src/identity/keychain.mjs";
|
|
44
|
+
import { checkSeedUrl } from "../src/net/seed-registry.mjs";
|
|
30
45
|
import { parseTrustedProxies } from "../src/net/client-ip.mjs";
|
|
31
46
|
|
|
32
47
|
function parseArgs(argv) {
|
|
@@ -114,9 +129,42 @@ if (receiptKeychainPath !== null && receiptKeychainPath !== "") {
|
|
|
114
129
|
}
|
|
115
130
|
}
|
|
116
131
|
|
|
132
|
+
// Optional seed identity (2.6.1): /v1/seed-info on a carrier that keeps its receipts.
|
|
133
|
+
const seedKeychainPath = args["seed-keychain"] ?? process.env.CARRIER_SEED_KEYCHAIN ?? null;
|
|
134
|
+
const publicUrlText = args["public-url"] ?? process.env.CARRIER_PUBLIC_URL ?? null;
|
|
135
|
+
const seedPassphrase = process.env.CARRIER_SEED_KEYCHAIN_PASSPHRASE;
|
|
136
|
+
delete process.env.CARRIER_SEED_KEYCHAIN_PASSPHRASE;
|
|
137
|
+
let seedKeychain = null;
|
|
138
|
+
let publicUrl = null;
|
|
139
|
+
const wantSeedKey = seedKeychainPath !== null && seedKeychainPath !== "";
|
|
140
|
+
const wantPublicUrl = publicUrlText !== null && publicUrlText !== "";
|
|
141
|
+
if (wantSeedKey !== wantPublicUrl) refuse("--seed-keychain and --public-url go together: /v1/seed-info is signed for the public URL");
|
|
142
|
+
if (wantSeedKey) {
|
|
143
|
+
if (typeof seedKeychainPath !== "string") refuse("--seed-keychain needs a path to a keychain file");
|
|
144
|
+
if (typeof publicUrlText !== "string") refuse("--public-url needs an https:// URL");
|
|
145
|
+
// The rule a registry applies at enrollment, so a seed never claims a URL it would be refused for.
|
|
146
|
+
const checked = checkSeedUrl(publicUrlText);
|
|
147
|
+
// The value is never echoed: a refused URL may carry credentials or a query token (AC2 fa0be869 P2).
|
|
148
|
+
if (!checked.ok) refuse(`--public-url is not a seed URL (${checked.reason}); the value is not shown`);
|
|
149
|
+
publicUrl = checked.url;
|
|
150
|
+
seedKeychain = new Keychain(seedKeychainPath);
|
|
151
|
+
if (!seedKeychain.exists()) refuse(`seed keychain ${seedKeychainPath} not found (a carrier never mints its seed key; pillar-seed does)`);
|
|
152
|
+
let pub;
|
|
153
|
+
try { pub = seedKeychain.publicView(); } catch (e) { refuse(`seed keychain ${seedKeychainPath} is damaged or is not a key file (${e.code ?? e.message})`); }
|
|
154
|
+
if (!keyDerivesUuaid(pub?.publicKeyHex, pub?.uuaid)) refuse(`seed keychain ${seedKeychainPath}: its uuaid does not belong to its key`);
|
|
155
|
+
try {
|
|
156
|
+
seedKeychain.load({ passphrase: seedPassphrase ?? "" });
|
|
157
|
+
} catch (e) {
|
|
158
|
+
refuse(`seed keychain ${seedKeychainPath} did not load: ${e.message}`);
|
|
159
|
+
}
|
|
160
|
+
if (receiptKeychain && receiptKeychain._identity.publicKeyHex === seedKeychain._identity.publicKeyHex) {
|
|
161
|
+
refuse("the seed key and the receipt key must be different keys");
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
|
|
117
165
|
let server;
|
|
118
166
|
try {
|
|
119
|
-
server = new CarrierServer({ dbPath, ttlDays, trustedTierIssuers: tierIssuers, secureDelete, receiptKeychain, communityInboxWaits, trustedProxies });
|
|
167
|
+
server = new CarrierServer({ dbPath, ttlDays, trustedTierIssuers: tierIssuers, secureDelete, receiptKeychain, keychain: seedKeychain, publicUrl, communityInboxWaits, trustedProxies });
|
|
120
168
|
} catch (e) {
|
|
121
169
|
refuse(e.message);
|
|
122
170
|
}
|
|
@@ -126,6 +174,7 @@ console.log(` db: ${dbPath}`);
|
|
|
126
174
|
console.log(` ttl: ${ttlDays} days`);
|
|
127
175
|
console.log(` tiers: ${tierIssuers.length ? `${tierIssuers.length} trusted issuer(s)` : "disabled (community budgets for all)"}`);
|
|
128
176
|
console.log(` secure-delete: ${secureDelete ? "on (expired envelopes are zeroed; WAL truncated after each expiry pass)" : "off (expired envelope bytes stay on disk until reused)"}`);
|
|
177
|
+
console.log(` seed: ${seedKeychain ? `${seedKeychain._identity.uuaid} at ${publicUrl} (signed /v1/seed-info)` : "off (no seed keychain; /v1/seed-info is 404)"}`);
|
|
129
178
|
console.log(` receipts: ${server.receiptCarrier ? `signed as ${server.receiptCarrier} (uuaid.carrier-receipt.v1)` : "off (no receipt keychain)"}`);
|
|
130
179
|
|
|
131
180
|
// Vacuum expired envelopes hourly.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uuaid/pillar",
|
|
3
|
-
"version": "2.6.
|
|
3
|
+
"version": "2.6.1",
|
|
4
4
|
"description": "Pillar (Protocol for Inter-agent Linked Ledger And Relay) — the secure delivery layer of UACP, the Universal Agent Communication Protocol. UACP = UUAID (identity) + Envelope (signed, encrypted container) + Pillar (relay, mailbox, routing, store-and-forward). Reference implementation of the UACP delivery layer; includes VDA-1 (IAASO-3901, in ballot) delivery attestation and a blind escrow for the Zilligon ZGN / EVM rails.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|