@substrat-run/kernel 0.116.0 → 0.118.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.
Files changed (64) hide show
  1. package/dist/capability.d.ts +220 -0
  2. package/dist/capability.d.ts.map +1 -0
  3. package/dist/capability.js +537 -0
  4. package/dist/capability.js.map +1 -0
  5. package/dist/check-key.d.ts +30 -0
  6. package/dist/check-key.d.ts.map +1 -0
  7. package/dist/check-key.js +37 -0
  8. package/dist/check-key.js.map +1 -0
  9. package/dist/denial-query.d.ts +32 -1
  10. package/dist/denial-query.d.ts.map +1 -1
  11. package/dist/denial-query.js +66 -28
  12. package/dist/denial-query.js.map +1 -1
  13. package/dist/index.d.ts +20 -5
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +15 -4
  16. package/dist/index.js.map +1 -1
  17. package/dist/job-run.d.ts +28 -0
  18. package/dist/job-run.d.ts.map +1 -1
  19. package/dist/job-run.js +37 -0
  20. package/dist/job-run.js.map +1 -1
  21. package/dist/outbox-event.d.ts +131 -0
  22. package/dist/outbox-event.d.ts.map +1 -0
  23. package/dist/outbox-event.js +185 -0
  24. package/dist/outbox-event.js.map +1 -0
  25. package/dist/permission-checker.d.ts +8 -1
  26. package/dist/permission-checker.d.ts.map +1 -1
  27. package/dist/permission-checker.js +18 -0
  28. package/dist/permission-checker.js.map +1 -1
  29. package/dist/permission-eval.d.ts +8 -0
  30. package/dist/permission-eval.d.ts.map +1 -1
  31. package/dist/permission-eval.js +164 -91
  32. package/dist/permission-eval.js.map +1 -1
  33. package/dist/platform-request-query.d.ts +58 -1
  34. package/dist/platform-request-query.d.ts.map +1 -1
  35. package/dist/platform-request-query.js +61 -1
  36. package/dist/platform-request-query.js.map +1 -1
  37. package/dist/platform-sweep.d.ts +123 -8
  38. package/dist/platform-sweep.d.ts.map +1 -1
  39. package/dist/platform-sweep.js +158 -34
  40. package/dist/platform-sweep.js.map +1 -1
  41. package/dist/row-decode.d.ts +107 -0
  42. package/dist/row-decode.d.ts.map +1 -0
  43. package/dist/row-decode.js +93 -0
  44. package/dist/row-decode.js.map +1 -0
  45. package/dist/scope-host.d.ts +211 -9
  46. package/dist/scope-host.d.ts.map +1 -1
  47. package/dist/scope-host.js +33 -0
  48. package/dist/scope-host.js.map +1 -1
  49. package/dist/scope-tuple-seat.d.ts +72 -0
  50. package/dist/scope-tuple-seat.d.ts.map +1 -0
  51. package/dist/scope-tuple-seat.js +93 -0
  52. package/dist/scope-tuple-seat.js.map +1 -0
  53. package/dist/subject-redaction.d.ts +273 -0
  54. package/dist/subject-redaction.d.ts.map +1 -0
  55. package/dist/subject-redaction.js +362 -0
  56. package/dist/subject-redaction.js.map +1 -0
  57. package/dist/system-switch.d.ts +108 -0
  58. package/dist/system-switch.d.ts.map +1 -0
  59. package/dist/system-switch.js +145 -0
  60. package/dist/system-switch.js.map +1 -0
  61. package/dist/timeline.d.ts.map +1 -1
  62. package/dist/timeline.js +109 -57
  63. package/dist/timeline.js.map +1 -1
  64. package/package.json +2 -2
@@ -0,0 +1,220 @@
1
+ import { type BecomeCapabilityInput, type CapabilityExchange, type CapabilityFilter, type CapabilityId, type CapabilityMintInput, type CapabilityRecord, type CheckSubject, type Decision, type DomainEventInput, type EntityRef, type Instant, type MintedCapability, type PermissionKey, type PlatformActorId, type PrincipalId } from '@substrat-run/contracts';
2
+ import type { ScopedSql, SqlValue } from './scope-host.js';
3
+ /**
4
+ * The two spine tables, kernel-owned so no vertical carries a migration for them. Shared by
5
+ * both adapters' `KERNEL_DDL` (interpolated, like `IDEMPOTENCY_DDL`), so the shape
6
+ * self-host builds and the shape production builds cannot part company.
7
+ */
8
+ export declare const CAPABILITY_DDL = "\n CREATE TABLE IF NOT EXISTS _substrat_capabilities (\n id TEXT PRIMARY KEY,\n -- #1672: SHA-256 hex of the secret. The secret itself is stored NOWHERE \u2014 it leaves\n -- the kernel once, in the mint's return value, and a lookup is this indexed equality.\n token_hash TEXT NOT NULL UNIQUE,\n -- 'act': the holder acts AS the capability ({ capability } on the spine), bounded by\n -- entity + permissions (+ operations). 'become': exchanging it yields `principal`.\n mode TEXT NOT NULL,\n label TEXT,\n entity_type TEXT,\n entity_id TEXT,\n -- JSON array of permission keys (act). The capability's whole authority: no\n -- `capability:` tuple is ever written, so none can be forged through the tuple table.\n permissions TEXT,\n -- JSON array of operation names, or NULL = any operation the keys allow (act).\n operations TEXT,\n principal TEXT,\n -- JSON capabilityAuthor: a principal id (a module minted it, and its authority is\n -- re-checked on every use) or {\"platform\": \u2026} (HostAdmin minted it).\n minted_by TEXT NOT NULL,\n minted_at TEXT NOT NULL,\n expires_at TEXT,\n -- NULL = unlimited. A use is an EXCHANGE of the secret, never an invocation.\n max_uses INTEGER,\n uses INTEGER NOT NULL DEFAULT 0,\n last_used_at TEXT,\n -- Tombstone, never a delete: a capability that once admitted someone is evidence\n -- of why they were admitted (K-4, K-21).\n revoked_at TEXT,\n revoked_by TEXT\n );\n CREATE INDEX IF NOT EXISTS _substrat_capabilities_entity\n ON _substrat_capabilities (entity_type, entity_id);\n -- #1672: what an exchange hands out instead of the secret \u2014 a session token, of which\n -- again only the hash is kept. Each session acts as its capability until the earlier of\n -- its own expiry and the capability's; the capability is re-read on every invoke, so\n -- revoking it ends every session at once \u2014 a revoke touches only the capability row,\n -- and it is that per-invoke read, not a cascade here, that refuses the next call.\n -- Expired rows are pruned on exchange, at most CAPABILITY_SESSION_PRUNE_BATCH at a time,\n -- on the only path that adds one \u2014 so an exchange's write is bounded however many expired.\n CREATE TABLE IF NOT EXISTS _substrat_capability_sessions (\n token_hash TEXT PRIMARY KEY,\n capability_id TEXT NOT NULL,\n created_at TEXT NOT NULL,\n expires_at TEXT NOT NULL\n );\n CREATE INDEX IF NOT EXISTS _substrat_capability_sessions_expiry\n ON _substrat_capability_sessions (expires_at);\n";
9
+ /** One capability row as the spine stores it — snake_case, because that is what both adapters `SELECT`. */
10
+ export interface CapabilityRow {
11
+ id: string;
12
+ mode: string;
13
+ label: string | null;
14
+ entity_type: string | null;
15
+ entity_id: string | null;
16
+ permissions: string | null;
17
+ operations: string | null;
18
+ principal: string | null;
19
+ minted_by: string;
20
+ minted_at: string;
21
+ expires_at: string | null;
22
+ max_uses: number | null;
23
+ uses: number;
24
+ last_used_at: string | null;
25
+ revoked_at: string | null;
26
+ revoked_by: string | null;
27
+ }
28
+ /** Every column a read returns — everything but `token_hash`, which no reader has a use for. */
29
+ export declare const CAPABILITY_COLUMNS: string;
30
+ /** The row the permission checker reads for a capability subject (`ScopeTupleReader.capability`). */
31
+ export declare function capabilityByIdQuery(id: string): {
32
+ sql: string;
33
+ params: SqlValue[];
34
+ };
35
+ /**
36
+ * Is this capability USABLE — not revoked, not expired? The ONE predicate for it: the
37
+ * permission checker, the session door and the exchange all call this, so the three can
38
+ * never disagree about whether a revoked or expired capability still acts. Same shape as
39
+ * the evaluator's `live()` for tuples, and ISO instants compare lexically.
40
+ */
41
+ export declare const capabilityLive: (row: Pick<CapabilityRow, 'revoked_at' | 'expires_at'>, now: string) => boolean;
42
+ /**
43
+ * May this capability's secret be EXCHANGED now — usable, and under its use limit? The use
44
+ * limit bounds exchanges only: a session handed out by an earlier exchange keeps acting
45
+ * after the limit is reached, until the capability expires or is revoked.
46
+ */
47
+ export declare const capabilityExchangeable: (row: Pick<CapabilityRow, 'revoked_at' | 'expires_at' | 'max_uses' | 'uses'>, now: string) => boolean;
48
+ /**
49
+ * What an `act` capability grants, decoded for the checker — or `null` for anything that
50
+ * cannot act (a `become` capability, a row whose JSON does not decode). Null DENIES: a row
51
+ * the checker cannot read in full grants nothing, rather than whatever part of it parsed.
52
+ */
53
+ export interface CapabilityGrantView {
54
+ entity: EntityRef;
55
+ permissions: PermissionKey[];
56
+ /** Null when a platform actor minted it — which an `act` capability never is. */
57
+ mintedBy: PrincipalId | null;
58
+ }
59
+ export declare function capabilityGrantOf(row: CapabilityRow): CapabilityGrantView | null;
60
+ /** The record a caller reads back — never the secret, never its hash. */
61
+ export declare function capabilityRecordOf(row: CapabilityRow): CapabilityRecord;
62
+ /** A fresh capability secret: 256 bits, base64url, prefixed. Only its hash is ever stored. */
63
+ export declare function mintCapabilitySecret(): string;
64
+ /** A fresh session token — the same construction, its own prefix. */
65
+ export declare function mintCapabilitySessionToken(): string;
66
+ /**
67
+ * SHA-256 hex of a secret or session token (Web Crypto — the same call in workerd, node and
68
+ * browsers). Unkeyed on purpose: with 256 bits of entropy there is no dictionary to defend
69
+ * against, and a key would be one more secret to hold and rotate.
70
+ */
71
+ export declare function capabilityTokenHash(token: string): Promise<string>;
72
+ /**
73
+ * How many expired sessions one exchange prunes, at most. An unlimited link can hand out any
74
+ * number of sessions, so pruning every expired row at once would make one visitor's request
75
+ * an unbounded write — and a Durable Object's transaction a large one. A fixed batch keeps
76
+ * each exchange's cost constant, and the table still drains: every exchange takes another
77
+ * batch, and an expired session acts as nobody whether or not it has been pruned yet.
78
+ */
79
+ export declare const CAPABILITY_SESSION_PRUNE_BATCH = 100;
80
+ /**
81
+ * The text a value would persist as — ONE serialization of the COMPLETE record, keys
82
+ * included, byte values decoded as UTF-8. The guard scans this rather than walking chosen
83
+ * fields, so a secret used as an entity id, a request kind, an object key or a BLOB
84
+ * parameter is found exactly as one in a payload value is: there is no field list to
85
+ * forget a field from. The secret's alphabet (base64url behind `sbcap_`) contains nothing
86
+ * JSON escapes, so the serialization contains the secret exactly when the value does.
87
+ */
88
+ export declare function persistedText(value: unknown): string;
89
+ /** Does `value`, serialized as it would persist (`persistedText`), contain any of `secrets`? */
90
+ export declare function carriesSecret(value: unknown, secrets: readonly string[]): boolean;
91
+ /** What a recorded response carries in place of a minted secret. */
92
+ export declare const WITHHELD_SECRET = "[capability secret withheld]";
93
+ /**
94
+ * `value` with every minted secret replaced by `WITHHELD_SECRET` — what an idempotency
95
+ * recording stores. A replayed mint therefore returns the placeholder, never the secret:
96
+ * the caller that lost the first response mints again, which is the honest outcome, since
97
+ * the alternative is a plaintext secret in a spine table for a day.
98
+ *
99
+ * Done on the serialization, like the guard, so a secret in a key is withheld as surely as
100
+ * one in a value. The recording is JSON already, so round-tripping through it changes
101
+ * nothing the recording would have kept — and a value carrying no secret is returned as is.
102
+ */
103
+ export declare function redactSecrets<T>(value: T, secrets: readonly string[]): T;
104
+ /**
105
+ * The tripwire (see above): refuse a write whose COMPLETE record, as it would persist,
106
+ * carries a secret this invocation minted. Thrown from `ctx.emit` (the whole parsed event),
107
+ * `ctx.requestPlatform` (the whole parsed request) and `ctx.sql` (the statement and every
108
+ * parameter, bytes decoded) while the minting invocation runs.
109
+ */
110
+ export declare function assertNoSecret(where: string, record: unknown, secrets: readonly string[]): void;
111
+ /** `ctx.sql` with every statement — its text and all its parameters — held to `assertNoSecret`. */
112
+ export declare function guardSecrets(inner: ScopedSql, secrets: readonly string[]): ScopedSql;
113
+ /** What an operation handler sees as `ctx.capabilities`. Nothing here checks a permission for the caller — the operation's own `assertAllowed` comes first. */
114
+ export interface CapabilityVerbs {
115
+ /**
116
+ * Mint an `act` capability over one entity and return its secret — the only time the
117
+ * secret exists outside the caller's hands. Build the link from it (as a URL FRAGMENT,
118
+ * so it never reaches a server log or a `Referer`) and return it once.
119
+ *
120
+ * **Delegation, never elevation, and on every use.** Every key is re-checked here on the
121
+ * entity with the operation's own check, so a principal can only mint what they hold
122
+ * there; and the checker re-checks the minter on every later use, so a capability never
123
+ * grants more than its minter holds NOW. Revoke the minter's access and their links stop
124
+ * granting it.
125
+ *
126
+ * Only a principal may mint — a capability, connection or schedule cannot delegate.
127
+ * Transactional with the operation: a mint whose operation throws never happened.
128
+ */
129
+ mint(input: CapabilityMintInput): Promise<MintedCapability>;
130
+ /**
131
+ * Revoke an `act` capability. Takes effect on the very next check, for every session it
132
+ * handed out. Allowed to anyone who could have minted it — every key it carries, held on
133
+ * its entity — which is `ctx.revoke`'s rule. Idempotent on an already-revoked one.
134
+ */
135
+ revoke(id: CapabilityId): Promise<void>;
136
+ /** This scope's capabilities, newest first. Revoked ones only when asked for. */
137
+ list(filter?: CapabilityFilter): CapabilityRecord[];
138
+ }
139
+ export interface CapabilityVerbDeps {
140
+ /** RAW spine access inside the operation's own transaction — not the guarded `ctx.sql`. */
141
+ sql: ScopedSql;
142
+ /** Who is minting. */
143
+ subject: CheckSubject;
144
+ /** The operation's instant. */
145
+ now: Instant;
146
+ /** The operation's OWN check — the same one `ctx.check` and `ctx.grant` use. */
147
+ check: (permission: PermissionKey, entity?: EntityRef) => Promise<Decision>;
148
+ /** `ctx.emit` — stamps the minter as actor, K-34 authorization, the operation. */
149
+ emit: (event: DomainEventInput) => void;
150
+ /** Is this an operation registered on this host? An allowlist naming none is a typo. */
151
+ isOperation: (name: string) => boolean;
152
+ /** K-42's read-only refusal, for the effecting verbs. */
153
+ assertWrites: (verb: string) => void;
154
+ /** This invocation's minted secrets — appended to by `mint`, read by the secret guards. */
155
+ minted: string[];
156
+ }
157
+ export declare function createCapabilityVerbs(deps: CapabilityVerbDeps): CapabilityVerbs;
158
+ /** The pseudo-operation an exchange's spine event names, on `attachments.upload`'s pattern. */
159
+ export declare const CAPABILITY_EXCHANGE_OPERATION = "capabilities.exchange";
160
+ /**
161
+ * Trade a secret for what it grants — ONE counted use. Runs inside the scope's
162
+ * serialization domain and a transaction the adapter opened; `emit` writes the
163
+ * `capability.exercised` event with the capability as its actor.
164
+ *
165
+ * The use is taken with an `UPDATE … WHERE uses = ?` on the row just read, so it is atomic
166
+ * even without the scope's single-writer guarantee: two exchanges racing for a single-use
167
+ * capability cannot both see `uses = 0` and both win.
168
+ *
169
+ * `null` for an unknown, expired, revoked or used-up secret — one answer for all four, so
170
+ * a caller probing for secrets learns nothing it can act on. Refused exchanges are not
171
+ * recorded: their volume is whatever an attacker chooses, and with 256 bits of entropy
172
+ * there is nothing a record of guesses would ever show (#130 is the rate control).
173
+ */
174
+ export declare function exchangeCapability(deps: {
175
+ sql: ScopedSql;
176
+ now: Instant;
177
+ emit: (capability: CapabilityId, event: DomainEventInput) => void;
178
+ }, secret: unknown,
179
+ /**
180
+ * The only mode the caller can handle. A secret of the OTHER mode answers `null` without
181
+ * taking a use: a claim link pasted into a share-link exchange must not be spent by a
182
+ * route that would then throw away the principal it yielded.
183
+ */
184
+ mode?: 'act' | 'become'): Promise<CapabilityExchange | null>;
185
+ /**
186
+ * The session door's decision, re-made on EVERY invoke inside the operation's transaction
187
+ * (impersonation's per-invoke re-read, for the same reason): a stub is a capability of its
188
+ * own and nothing takes it away, so a revocation checked only when the stub was minted
189
+ * would stop everyone except the one caller holding it.
190
+ *
191
+ * Refuses an unknown or expired session and a revoked or expired capability as
192
+ * `unauthenticated` — the credential no longer works, and re-opening a live link is the
193
+ * remedy — and an operation outside the capability's allowlist as `forbidden`. None of
194
+ * these is a K-35 denial: no permission key was checked, and the denial log records
195
+ * enforced checks. The handler's own checks, once it runs, are.
196
+ */
197
+ export declare function resolveCapabilitySession(sql: ScopedSql, sessionHash: string, now: Instant, operation: string): CapabilityId;
198
+ /** Is `token` shaped like a session token at all? Checked before it is hashed or sent anywhere. */
199
+ export declare const plausibleSessionToken: (token: unknown) => token is string;
200
+ /**
201
+ * The platform's mint (`HostAdmin.mintCapability`) — a `become` capability, which is the
202
+ * only kind the platform mints and the only way one is minted in this first cut (see
203
+ * `becomeCapabilityInput`). No spine event: a platform actor's act is the admin log's to
204
+ * record, and the adapter records it there.
205
+ */
206
+ /**
207
+ * A platform mint's input, parsed and held to its one rule beyond the shape: an expiry in
208
+ * the future. Its own function so a host whose storage sits across an RPC boundary can run
209
+ * it on the near side, where a typed refusal still reaches the caller as one — the same
210
+ * check `mintBecomeCapability` makes, not a second copy of it.
211
+ */
212
+ export declare function checkBecomeInput(raw: BecomeCapabilityInput, now: Instant): BecomeCapabilityInput;
213
+ export declare function mintBecomeCapability(sql: ScopedSql, raw: BecomeCapabilityInput, actor: PlatformActorId, now: Instant): Promise<MintedCapability>;
214
+ /**
215
+ * The platform's revoke (`HostAdmin.revokeCapability`) — of any capability in the scope,
216
+ * the operator's lever for a leaked link. Returns the row as it stood before, for the admin
217
+ * log, or `undefined` when there is no such capability. Idempotent.
218
+ */
219
+ export declare function revokeCapabilityAsPlatform(sql: ScopedSql, rawId: string, actor: PlatformActorId, now: Instant): CapabilityRecord | undefined;
220
+ //# sourceMappingURL=capability.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AAAA,OAAO,EAgBL,KAAK,qBAAqB,EAE1B,KAAK,kBAAkB,EAEvB,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EAExB,KAAK,gBAAgB,EAErB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,SAAS,EACd,KAAK,OAAO,EACZ,KAAK,gBAAgB,EACrB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,WAAW,EACjB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AA2C3D;;;;GAIG;AACH,eAAO,MAAM,cAAc,6hFAiD1B,CAAC;AAEF,2GAA2G;AAC3G,MAAM,WAAW,aAAa;IAC5B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;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