@substrat-run/control-plane-api 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.
- package/dist/api.d.ts +31 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js +526 -104
- package/dist/api.js.map +1 -1
- package/dist/auth.d.ts +35 -3
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +11 -0
- package/dist/auth.js.map +1 -1
- package/dist/cf-observability.d.ts.map +1 -1
- package/dist/cf-observability.js +26 -2
- package/dist/cf-observability.js.map +1 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/observability.d.ts +6 -0
- package/dist/observability.d.ts.map +1 -1
- package/dist/platform-drain.d.ts +6 -3
- package/dist/platform-drain.d.ts.map +1 -1
- package/dist/platform-drain.js +22 -4
- package/dist/platform-drain.js.map +1 -1
- package/dist/push-token.d.ts.map +1 -1
- package/dist/push-token.js +9 -23
- package/dist/push-token.js.map +1 -1
- package/dist/scope-deployment.d.ts +34 -0
- package/dist/scope-deployment.d.ts.map +1 -0
- package/dist/scope-deployment.js +19 -0
- package/dist/scope-deployment.js.map +1 -0
- package/dist/storage-meter.d.ts +32 -0
- package/dist/storage-meter.d.ts.map +1 -0
- package/dist/storage-meter.js +69 -0
- package/dist/storage-meter.js.map +1 -0
- package/dist/tenant-token.d.ts +41 -0
- package/dist/tenant-token.d.ts.map +1 -0
- package/dist/tenant-token.js +108 -0
- package/dist/tenant-token.js.map +1 -0
- package/dist/token-codec.d.ts +30 -0
- package/dist/token-codec.d.ts.map +1 -0
- package/dist/token-codec.js +63 -0
- package/dist/token-codec.js.map +1 -0
- package/dist/vertical-client.d.ts +34 -3
- package/dist/vertical-client.d.ts.map +1 -1
- package/dist/vertical-client.js +66 -3
- package/dist/vertical-client.js.map +1 -1
- package/package.json +5 -5
package/dist/api.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Hono } from 'hono';
|
|
|
2
2
|
import { z } from '@substrat-run/contracts';
|
|
3
3
|
import type { Connection, ConnectionActivity, ConnectionActivitySource, ConnectionCredential, ConnectionProbe, PlatformActorId } from '@substrat-run/contracts';
|
|
4
4
|
import type { ScopeHost } from '@substrat-run/kernel';
|
|
5
|
-
import type { PlatformActorAuth, BuilderAuth, Principal } from './auth.js';
|
|
5
|
+
import type { PlatformActorAuth, BuilderAuth, Principal, TenantServiceAuth } from './auth.js';
|
|
6
6
|
import { type VerticalClient } from './vertical-client.js';
|
|
7
7
|
import type { DeployVerticalFn, FetchVerticalAssetFn, FetchVerticalModulesFn } from './deploy.js';
|
|
8
8
|
import type { PatchScriptBindingsFn } from './wfp.js';
|
|
@@ -158,6 +158,14 @@ export interface ControlPlaneApiOptions {
|
|
|
158
158
|
* the vertical-management routes and to the verticals their tenant owns.
|
|
159
159
|
*/
|
|
160
160
|
authenticateBuilder?: BuilderAuth;
|
|
161
|
+
/**
|
|
162
|
+
* Resolves a TENANT-SCOPED SERVICE principal — the dashboard's own credential
|
|
163
|
+
* (tenant-token.ts, #977). Tried FIRST, before staff: a credential that carries its
|
|
164
|
+
* tenant must never be read as fleet-wide staff by a reader configured later, and
|
|
165
|
+
* ordering is the only thing that can guarantee that. Absent ⇒ no tenant-scoped
|
|
166
|
+
* path, and the surface behaves exactly as it did before #977.
|
|
167
|
+
*/
|
|
168
|
+
authenticateTenantService?: TenantServiceAuth;
|
|
161
169
|
/**
|
|
162
170
|
* Signs tenant-scoped push tokens (push-token.ts) — the CI credential the dashboard
|
|
163
171
|
* mints into a customer repo. Absent ⇒ the mint route 501s. A dedicated secret,
|
|
@@ -165,6 +173,15 @@ export interface ControlPlaneApiOptions {
|
|
|
165
173
|
* token; set once, out of routine rotation (rotating it revokes every issued token).
|
|
166
174
|
*/
|
|
167
175
|
pushTokenSecret?: string;
|
|
176
|
+
/**
|
|
177
|
+
* Signs tenant tokens (tenant-token.ts, #977) — the dashboard's per-tenant
|
|
178
|
+
* credential. Absent ⇒ `POST /tenant-tokens` 501s. A DEDICATED secret: sharing
|
|
179
|
+
* `pushTokenSecret` would make a compromised CI token and a compromised dashboard
|
|
180
|
+
* credential one incident, and `PLATFORM_SECRET` is injected into every pushed
|
|
181
|
+
* vertical. Rotating it revokes every issued tenant token at once; the dashboard
|
|
182
|
+
* re-mints on its next request, so that is the revocation lever, not an outage.
|
|
183
|
+
*/
|
|
184
|
+
tenantTokenSecret?: string;
|
|
168
185
|
/**
|
|
169
186
|
* Keys the pseudonymizer behind a masked export (#1034, `pseudonymize.ts`). The salt
|
|
170
187
|
* never reaches the dump and no mapping is stored, so it is not a decryption key —
|
|
@@ -314,6 +331,19 @@ export declare const denialLogQuery: z.ZodObject<{
|
|
|
314
331
|
}>>;
|
|
315
332
|
}, z.core.$strip>;
|
|
316
333
|
export declare const DEFAULT_MODEL_MARGIN_PERCENT = 20;
|
|
334
|
+
type TenantPin = 'path' | 'query' | 'catalog' | 'body' | 'owner';
|
|
335
|
+
/**
|
|
336
|
+
* How a tenant-scoped credential's pin is checked on this route, or `undefined` when
|
|
337
|
+
* the route is off its allowlist entirely (default-deny).
|
|
338
|
+
*
|
|
339
|
+
* Exported so the DASHBOARD's own suite can assert the other direction: that every
|
|
340
|
+
* route its authority seam can issue is one this credential reaches. Nothing else can
|
|
341
|
+
* check that — the allowlist lives here and the call sites live there — and the gap
|
|
342
|
+
* between the two is a 403 in production and a green test on both sides. The first
|
|
343
|
+
* pass of this list was written by reading `authority.ts`, and reading it missed
|
|
344
|
+
* `GET /scopes`, which is the route the Data tab and Move/Retire lean on hardest.
|
|
345
|
+
*/
|
|
346
|
+
export declare function tenantCredentialPin(method: string, path: string): TenantPin | undefined;
|
|
317
347
|
/**
|
|
318
348
|
* The audited HTTP surface over `HostAdmin` (control-plane.md §4.5).
|
|
319
349
|
*
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts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