@substrat-run/kernel 0.6.0 → 0.8.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/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/platform-call.d.ts +38 -0
- package/dist/platform-call.d.ts.map +1 -0
- package/dist/platform-call.js +51 -0
- package/dist/platform-call.js.map +1 -0
- package/dist/routed-node.d.ts +51 -0
- package/dist/routed-node.d.ts.map +1 -0
- package/dist/routed-node.js +49 -0
- package/dist/routed-node.js.map +1 -0
- package/dist/scope-host.d.ts +105 -13
- package/dist/scope-host.d.ts.map +1 -1
- package/package.json +6 -4
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export type { AuditLogFilter, ConsumerHandler, ExecutorHandler, GuardPredicate, HostAdmin, ModuleRegistration, OperationContext, OperationHandler, ProvisionScopeInput, RoleFilter, ScopedSql, ScopeFilter, ScopeHost, ScopeStub, SqlMigration, SqlValue, } from './scope-host.js';
|
|
1
|
+
export type { AccessLogFilter, AuditLogFilter, ConsumerHandler, ExecutorHandler, GuardPredicate, HostAdmin, ModuleRegistration, OperationContext, OperationHandler, ProvisionScopeInput, RoleFilter, ScopedSql, ScopeFilter, ScopeHost, ScopeStub, SqlMigration, SqlValue, } from './scope-host.js';
|
|
2
2
|
export { resolveScopeRecord } from './scope-record.js';
|
|
3
3
|
export type { ResolvedScopeRecord } from './scope-record.js';
|
|
4
4
|
export { assertAllowed, denyAllChecker, PermissionDenied, UNSAFE_allowAllChecker, } from './permission-checker.js';
|
|
5
5
|
export type { PermissionChecker } from './permission-checker.js';
|
|
6
6
|
export { ulid } from './ulid.js';
|
|
7
|
+
export { readRoutedNode, RouterAssertionError } from './routed-node.js';
|
|
8
|
+
export type { RoutedNode, HeaderReader } from './routed-node.js';
|
|
9
|
+
export { assertPlatformCall, PlatformCallError, PLATFORM_SECRET_HEADER, } from './platform-call.js';
|
|
7
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,QAAQ,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,UAAU,EACV,SAAS,EACT,WAAW,EACX,SAAS,EACT,SAAS,EACT,YAAY,EACZ,QAAQ,GACT,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AACjC,YAAY,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AACxE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACjE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { resolveScopeRecord } from './scope-record.js';
|
|
2
2
|
export { assertAllowed, denyAllChecker, PermissionDenied, UNSAFE_allowAllChecker, } from './permission-checker.js';
|
|
3
3
|
export { ulid } from './ulid.js';
|
|
4
|
+
export { readRoutedNode, RouterAssertionError } from './routed-node.js';
|
|
5
|
+
export { assertPlatformCall, PlatformCallError, PLATFORM_SECRET_HEADER, } from './platform-call.js';
|
|
4
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EACL,aAAa,EACb,cAAc,EACd,gBAAgB,EAChB,sBAAsB,GACvB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,cAAc,EAAE,oBAAoB,EAAE,MAAM,kBAAkB,CAAC;AAExE,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,GACvB,MAAM,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { HeaderReader } from './routed-node.js';
|
|
2
|
+
/**
|
|
3
|
+
* Authenticating a call FROM the platform TO a vertical (K-31).
|
|
4
|
+
*
|
|
5
|
+
* Provisioning is control-plane-driven: the platform decides an instance should
|
|
6
|
+
* exist and tells the vertical to create it, because only the vertical can create a
|
|
7
|
+
* usable scope DO. This is the vertical's side of that call.
|
|
8
|
+
*
|
|
9
|
+
* It lives in the kernel for the same reason `readRoutedNode` does — five verticals
|
|
10
|
+
* each re-deriving how to trust a header is five chances to get it wrong, and the
|
|
11
|
+
* one that gets it wrong is not obviously broken.
|
|
12
|
+
*
|
|
13
|
+
* Note the direction. `readRoutedNode` answers "which tenant is this request for",
|
|
14
|
+
* and a request with no assertion is legitimate (a standalone deploy). This answers
|
|
15
|
+
* "is the platform itself calling", and there is no legitimate unauthenticated case:
|
|
16
|
+
* an open provisioning endpoint lets a stranger mint tenants inside the vertical.
|
|
17
|
+
* So this one **fails closed with no configuration at all**.
|
|
18
|
+
*/
|
|
19
|
+
/** Thrown when a call does not prove it came from the platform. */
|
|
20
|
+
export declare class PlatformCallError extends Error {
|
|
21
|
+
}
|
|
22
|
+
/** Constant-time compare, so a wrong secret leaks nothing through timing. */
|
|
23
|
+
export declare function secretMatches(presented: string | null, expected: string): boolean;
|
|
24
|
+
/** The header the platform presents. */
|
|
25
|
+
export declare const PLATFORM_SECRET_HEADER = "x-substrat-platform";
|
|
26
|
+
/**
|
|
27
|
+
* Throw unless this request proves it came from the platform.
|
|
28
|
+
*
|
|
29
|
+
* **An unset secret is a failure, not a bypass.** That is the opposite of how the
|
|
30
|
+
* router secret behaves, and deliberately so: there, an unset secret means "no router
|
|
31
|
+
* is configured", which a standalone deploy legitimately wants. Here it would mean
|
|
32
|
+
* "anyone may provision", which nothing legitimately wants. A template copied without
|
|
33
|
+
* the secret configured must refuse to provision rather than provision for strangers.
|
|
34
|
+
*/
|
|
35
|
+
export declare function assertPlatformCall(headers: HeaderReader, options?: {
|
|
36
|
+
expectedSecret?: string;
|
|
37
|
+
}): void;
|
|
38
|
+
//# sourceMappingURL=platform-call.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-call.d.ts","sourceRoot":"","sources":["../src/platform-call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;;;;;GAgBG;AAEH,mEAAmE;AACnE,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,6EAA6E;AAC7E,wBAAgB,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAOjF;AAED,wCAAwC;AACxC,eAAO,MAAM,sBAAsB,wBAAwB,CAAC;AAE5D;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,IAAI,CAQN"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Authenticating a call FROM the platform TO a vertical (K-31).
|
|
3
|
+
*
|
|
4
|
+
* Provisioning is control-plane-driven: the platform decides an instance should
|
|
5
|
+
* exist and tells the vertical to create it, because only the vertical can create a
|
|
6
|
+
* usable scope DO. This is the vertical's side of that call.
|
|
7
|
+
*
|
|
8
|
+
* It lives in the kernel for the same reason `readRoutedNode` does — five verticals
|
|
9
|
+
* each re-deriving how to trust a header is five chances to get it wrong, and the
|
|
10
|
+
* one that gets it wrong is not obviously broken.
|
|
11
|
+
*
|
|
12
|
+
* Note the direction. `readRoutedNode` answers "which tenant is this request for",
|
|
13
|
+
* and a request with no assertion is legitimate (a standalone deploy). This answers
|
|
14
|
+
* "is the platform itself calling", and there is no legitimate unauthenticated case:
|
|
15
|
+
* an open provisioning endpoint lets a stranger mint tenants inside the vertical.
|
|
16
|
+
* So this one **fails closed with no configuration at all**.
|
|
17
|
+
*/
|
|
18
|
+
/** Thrown when a call does not prove it came from the platform. */
|
|
19
|
+
export class PlatformCallError extends Error {
|
|
20
|
+
}
|
|
21
|
+
/** Constant-time compare, so a wrong secret leaks nothing through timing. */
|
|
22
|
+
export function secretMatches(presented, expected) {
|
|
23
|
+
if (!presented || presented.length !== expected.length)
|
|
24
|
+
return false;
|
|
25
|
+
let diff = 0;
|
|
26
|
+
for (let i = 0; i < expected.length; i++) {
|
|
27
|
+
diff |= presented.charCodeAt(i) ^ expected.charCodeAt(i);
|
|
28
|
+
}
|
|
29
|
+
return diff === 0;
|
|
30
|
+
}
|
|
31
|
+
/** The header the platform presents. */
|
|
32
|
+
export const PLATFORM_SECRET_HEADER = 'x-substrat-platform';
|
|
33
|
+
/**
|
|
34
|
+
* Throw unless this request proves it came from the platform.
|
|
35
|
+
*
|
|
36
|
+
* **An unset secret is a failure, not a bypass.** That is the opposite of how the
|
|
37
|
+
* router secret behaves, and deliberately so: there, an unset secret means "no router
|
|
38
|
+
* is configured", which a standalone deploy legitimately wants. Here it would mean
|
|
39
|
+
* "anyone may provision", which nothing legitimately wants. A template copied without
|
|
40
|
+
* the secret configured must refuse to provision rather than provision for strangers.
|
|
41
|
+
*/
|
|
42
|
+
export function assertPlatformCall(headers, options = {}) {
|
|
43
|
+
const { expectedSecret } = options;
|
|
44
|
+
if (!expectedSecret) {
|
|
45
|
+
throw new PlatformCallError('platform calls are not configured on this deployment');
|
|
46
|
+
}
|
|
47
|
+
if (!secretMatches(headers.get(PLATFORM_SECRET_HEADER), expectedSecret)) {
|
|
48
|
+
throw new PlatformCallError('not a platform call');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=platform-call.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"platform-call.js","sourceRoot":"","sources":["../src/platform-call.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;GAgBG;AAEH,mEAAmE;AACnE,MAAM,OAAO,iBAAkB,SAAQ,KAAK;CAAG;AAE/C,6EAA6E;AAC7E,MAAM,UAAU,aAAa,CAAC,SAAwB,EAAE,QAAgB;IACtE,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,KAAK,QAAQ,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACrE,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACzC,IAAI,IAAI,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC3D,CAAC;IACD,OAAO,IAAI,KAAK,CAAC,CAAC;AACpB,CAAC;AAED,wCAAwC;AACxC,MAAM,CAAC,MAAM,sBAAsB,GAAG,qBAAqB,CAAC;AAE5D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB,CAChC,OAAqB,EACrB,UAAuC,EAAE;IAEzC,MAAM,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC;IACnC,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,IAAI,iBAAiB,CAAC,sDAAsD,CAAC,CAAC;IACtF,CAAC;IACD,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,EAAE,cAAc,CAAC,EAAE,CAAC;QACxE,MAAM,IAAI,iBAAiB,CAAC,qBAAqB,CAAC,CAAC;IACrD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { ScopeId, TenantId } from '@substrat-run/contracts';
|
|
2
|
+
/**
|
|
3
|
+
* Reading the node the router asserted (K-26).
|
|
4
|
+
*
|
|
5
|
+
* The router resolves `hostname → (tenant, scope, surface)` and forwards over a
|
|
6
|
+
* service binding with that resolution in headers. This is the vertical's side of
|
|
7
|
+
* that contract, in the kernel because every vertical needs it and none of them
|
|
8
|
+
* should be re-deriving how to trust it.
|
|
9
|
+
*
|
|
10
|
+
* Web-standard only and structurally typed: the base tsconfig is `ES2023` with no
|
|
11
|
+
* DOM lib, deliberately, so no package assumes a browser. Taking the one method we
|
|
12
|
+
* need rather than the whole `Headers` type keeps that true and costs nothing — a
|
|
13
|
+
* real `Headers` satisfies it, and so does a plain object in a test.
|
|
14
|
+
*/
|
|
15
|
+
/** The one method this needs from a `Headers`. A real `Headers` satisfies it. */
|
|
16
|
+
export interface HeaderReader {
|
|
17
|
+
get(name: string): string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface RoutedNode {
|
|
20
|
+
tenantId: TenantId;
|
|
21
|
+
scopeId: ScopeId;
|
|
22
|
+
/** Which app answers: `app`, `storefront`, `back-office`, … Vertical vocabulary. */
|
|
23
|
+
surface: string;
|
|
24
|
+
verticalSlug: string | null;
|
|
25
|
+
}
|
|
26
|
+
/** Thrown when headers are present but not trustworthy. Never means "no router". */
|
|
27
|
+
export declare class RouterAssertionError extends Error {
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* The `(tenant, scope)` this request is for, or `null` when no router fronted it.
|
|
31
|
+
*
|
|
32
|
+
* Three outcomes, kept distinct on purpose:
|
|
33
|
+
*
|
|
34
|
+
* - **null** — no assertion at all. The caller decides: a single-tenant standalone
|
|
35
|
+
* deploy substitutes its own node, anything else refuses.
|
|
36
|
+
* - **throws** — headers are present but wrong: a bad or missing secret, or ids
|
|
37
|
+
* that are not ULIDs. Present-but-wrong is a misconfiguration or an attack, and
|
|
38
|
+
* collapsing it into `null` would let either one fall through to whatever the
|
|
39
|
+
* caller does for "unrouted".
|
|
40
|
+
* - **a node** — trustworthy, and the tenant whose data this request may touch.
|
|
41
|
+
*
|
|
42
|
+
* `expectedSecret` is what makes the headers trustworthy in code. K-26's real
|
|
43
|
+
* boundary is that vertical workers have no public route, so the router is the only
|
|
44
|
+
* possible source — but that is a deployment fact, and `workers.dev` is on by
|
|
45
|
+
* default. When the secret is configured, a request that did not come from the
|
|
46
|
+
* router cannot assert a tenant no matter how the routes are configured.
|
|
47
|
+
*/
|
|
48
|
+
export declare function readRoutedNode(headers: HeaderReader, options?: {
|
|
49
|
+
expectedSecret?: string;
|
|
50
|
+
}): RoutedNode | null;
|
|
51
|
+
//# sourceMappingURL=routed-node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routed-node.d.ts","sourceRoot":"","sources":["../src/routed-node.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAEjE;;;;;;;;;;;;GAYG;AAEH,iFAAiF;AACjF,MAAM,WAAW,YAAY;IAC3B,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,OAAO,EAAE,OAAO,CAAC;IACjB,oFAAoF;IACpF,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAED,oFAAoF;AACpF,qBAAa,oBAAqB,SAAQ,KAAK;CAAG;AAIlD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAC5B,OAAO,EAAE,YAAY,EACrB,OAAO,GAAE;IAAE,cAAc,CAAC,EAAE,MAAM,CAAA;CAAO,GACxC,UAAU,GAAG,IAAI,CAyBnB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { scopeId as scopeIdSchema, tenantId as tenantIdSchema } from '@substrat-run/contracts';
|
|
2
|
+
import { secretMatches } from './platform-call.js';
|
|
3
|
+
/** Thrown when headers are present but not trustworthy. Never means "no router". */
|
|
4
|
+
export class RouterAssertionError extends Error {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The `(tenant, scope)` this request is for, or `null` when no router fronted it.
|
|
8
|
+
*
|
|
9
|
+
* Three outcomes, kept distinct on purpose:
|
|
10
|
+
*
|
|
11
|
+
* - **null** — no assertion at all. The caller decides: a single-tenant standalone
|
|
12
|
+
* deploy substitutes its own node, anything else refuses.
|
|
13
|
+
* - **throws** — headers are present but wrong: a bad or missing secret, or ids
|
|
14
|
+
* that are not ULIDs. Present-but-wrong is a misconfiguration or an attack, and
|
|
15
|
+
* collapsing it into `null` would let either one fall through to whatever the
|
|
16
|
+
* caller does for "unrouted".
|
|
17
|
+
* - **a node** — trustworthy, and the tenant whose data this request may touch.
|
|
18
|
+
*
|
|
19
|
+
* `expectedSecret` is what makes the headers trustworthy in code. K-26's real
|
|
20
|
+
* boundary is that vertical workers have no public route, so the router is the only
|
|
21
|
+
* possible source — but that is a deployment fact, and `workers.dev` is on by
|
|
22
|
+
* default. When the secret is configured, a request that did not come from the
|
|
23
|
+
* router cannot assert a tenant no matter how the routes are configured.
|
|
24
|
+
*/
|
|
25
|
+
export function readRoutedNode(headers, options = {}) {
|
|
26
|
+
const rawTenant = headers.get('x-substrat-tenant');
|
|
27
|
+
const rawScope = headers.get('x-substrat-scope');
|
|
28
|
+
if (!rawTenant && !rawScope)
|
|
29
|
+
return null;
|
|
30
|
+
const { expectedSecret } = options;
|
|
31
|
+
if (expectedSecret && !secretMatches(headers.get('x-substrat-router'), expectedSecret)) {
|
|
32
|
+
throw new RouterAssertionError('router assertion is not signed by a known router');
|
|
33
|
+
}
|
|
34
|
+
if (!rawTenant || !rawScope) {
|
|
35
|
+
throw new RouterAssertionError('router assertion is incomplete');
|
|
36
|
+
}
|
|
37
|
+
const tenant = tenantIdSchema.safeParse(rawTenant);
|
|
38
|
+
const scope = scopeIdSchema.safeParse(rawScope);
|
|
39
|
+
if (!tenant.success || !scope.success) {
|
|
40
|
+
throw new RouterAssertionError('router assertion carries a malformed id');
|
|
41
|
+
}
|
|
42
|
+
return {
|
|
43
|
+
tenantId: tenant.data,
|
|
44
|
+
scopeId: scope.data,
|
|
45
|
+
surface: headers.get('x-substrat-surface') ?? 'app',
|
|
46
|
+
verticalSlug: headers.get('x-substrat-vertical'),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M,IAAI,oBAAoB,CAAC,yCAAyC,CAAC,CAAC;IAC5E,CAAC;IAED,OAAO;QACL,QAAQ,EAAE,MAAM,CAAC,IAAI;QACrB,OAAO,EAAE,KAAK,CAAC,IAAI;QACnB,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,KAAK;QACnD,YAAY,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;KACjD,CAAC;AACJ,CAAC"}
|
package/dist/scope-host.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AdminAction, AdminLogEntry, CapabilityGrant, CreateTenantInput, Decision, DomainEvent, DomainEventInput, EntityRef, IdentityLink, IdentityPool, Jurisdiction, ModuleManifest, CreateOrgInput, Node, Org, OrgId, OrgMembership, PermissionKey, PlatformActorId, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, Scope, ScopeId, ScopeStatus, StorageShape, Tenant, TenantId, TenantRole, TenantStatus } from '@substrat-run/contracts';
|
|
1
|
+
import type { AdminAction, AccessLogEntry, BindHostnameInput, AdminLogEntry, CapabilityGrant, CreateTenantInput, Decision, DomainEvent, DomainEventInput, EntityRef, IdentityLink, IdentityPool, Jurisdiction, ModuleManifest, CreateOrgInput, Node, Org, OrgId, OrgMembership, PermissionKey, PlatformActorId, ChannelName, HostnameBinding, HostnameStatus, PromotionAcknowledgement, PublishVersionInput, RegisterVerticalInput, RouteTarget, PrincipalId, ResolvedIdentity, RoleAssignment, RoleDefinition, Scope, ScopeId, ScopeStatus, StorageShape, Tenant, TenantId, TenantRole, Vertical, VerticalChannel, VerticalVersion, TenantStatus } from '@substrat-run/contracts';
|
|
2
2
|
/**
|
|
3
3
|
* The scope-host contract — the adapter seam (§5.1 of the design doc).
|
|
4
4
|
*
|
|
@@ -153,7 +153,7 @@ export interface HostAdmin {
|
|
|
153
153
|
* registry, so this is a read. A grant is a tuple in the scope's own database
|
|
154
154
|
* and needs §5.4's admin-query RPC — the two are not the same size of problem.
|
|
155
155
|
*/
|
|
156
|
-
listRoles(filter?: RoleFilter): Promise<TenantRole[]>;
|
|
156
|
+
listRoles(actor: PlatformActorId, filter?: RoleFilter): Promise<TenantRole[]>;
|
|
157
157
|
assignRole(actor: PlatformActorId, assignment: RoleAssignment): Promise<void>;
|
|
158
158
|
grant(actor: PlatformActorId, grant: CapabilityGrant): Promise<void>;
|
|
159
159
|
/** Grant to an organization (portal customers); members reach it via membership tuples. */
|
|
@@ -179,7 +179,7 @@ export interface HostAdmin {
|
|
|
179
179
|
* Answering "who has access to this org" at all is new: membership was
|
|
180
180
|
* write-only before this (#34).
|
|
181
181
|
*/
|
|
182
|
-
listMembers(tenantId: TenantId, orgId: OrgId, options?: {
|
|
182
|
+
listMembers(actor: PlatformActorId, tenantId: TenantId, orgId: OrgId, options?: {
|
|
183
183
|
includeRevoked?: boolean;
|
|
184
184
|
}): Promise<OrgMembership[]>;
|
|
185
185
|
/**
|
|
@@ -193,8 +193,79 @@ export interface HostAdmin {
|
|
|
193
193
|
* grant reached a phantom nothing would ever resolve to.
|
|
194
194
|
*/
|
|
195
195
|
createOrg(actor: PlatformActorId, input: CreateOrgInput): Promise<void>;
|
|
196
|
-
listOrgs(tenantId: TenantId): Promise<Org[]>;
|
|
197
|
-
getOrg(tenantId: TenantId, orgId: OrgId): Promise<Org | undefined>;
|
|
196
|
+
listOrgs(actor: PlatformActorId, tenantId: TenantId): Promise<Org[]>;
|
|
197
|
+
getOrg(actor: PlatformActorId, tenantId: TenantId, orgId: OrgId): Promise<Org | undefined>;
|
|
198
|
+
/**
|
|
199
|
+
* Register a vertical. Idempotent on the slug; a conflicting re-registration
|
|
200
|
+
* (different source) throws rather than silently rebinding what a scope runs.
|
|
201
|
+
*/
|
|
202
|
+
registerVertical(actor: PlatformActorId, input: RegisterVerticalInput): Promise<void>;
|
|
203
|
+
listVerticals(actor: PlatformActorId): Promise<Vertical[]>;
|
|
204
|
+
/**
|
|
205
|
+
* Publish a version. It lands **pending** — a push is not a deploy.
|
|
206
|
+
*
|
|
207
|
+
* The digests are what promotion compares. `boundary-lint` and the migration and
|
|
208
|
+
* permission diffs are the admission gates, and binding a scope is a separate step
|
|
209
|
+
* (`bindScopeVersion`), so the two human checkpoints fire where the blast radius is
|
|
210
|
+
* rather than where the typing was.
|
|
211
|
+
*/
|
|
212
|
+
publishVersion(actor: PlatformActorId, input: PublishVersionInput): Promise<void>;
|
|
213
|
+
listVersions(actor: PlatformActorId, verticalSlug: string): Promise<VerticalVersion[]>;
|
|
214
|
+
/** Admit a pending version — the gates passed. Idempotent on an already-admitted one. */
|
|
215
|
+
admitVersion(actor: PlatformActorId, versionId: string): Promise<void>;
|
|
216
|
+
/** Reject a pending version, with the reason. Rejected is terminal: publish a new one. */
|
|
217
|
+
rejectVersion(actor: PlatformActorId, versionId: string, note: string): Promise<void>;
|
|
218
|
+
/**
|
|
219
|
+
* Promote a version to a channel (#31 step 2) — the moment a change reaches
|
|
220
|
+
* anyone, and therefore where §4's two human checkpoints belong.
|
|
221
|
+
*
|
|
222
|
+
* **Refuses when a digest differs and the change is not acknowledged.** The
|
|
223
|
+
* migration and permission diffs are a merge-time convention today: CI renders
|
|
224
|
+
* them and a human is expected to look, but nothing ties that looking to the
|
|
225
|
+
* moment of exposure. Here it is tied — and the acknowledgement is recorded, so
|
|
226
|
+
* "someone reviewed it" becomes evidence rather than a claim.
|
|
227
|
+
*
|
|
228
|
+
* Only admitted versions may be promoted, for the same reason they are the only
|
|
229
|
+
* ones bindable.
|
|
230
|
+
*/
|
|
231
|
+
promoteVersion(actor: PlatformActorId, verticalSlug: string, channel: ChannelName, versionId: string, acknowledge?: PromotionAcknowledgement): Promise<void>;
|
|
232
|
+
listChannels(actor: PlatformActorId, verticalSlug: string): Promise<VerticalChannel[]>;
|
|
233
|
+
/**
|
|
234
|
+
* Point a scope at a version.
|
|
235
|
+
*
|
|
236
|
+
* **Refuses anything not admitted.** That refusal is the registry's reason to
|
|
237
|
+
* exist: without it "push lands pending" is a convention, and a convention is what
|
|
238
|
+
* D-30's lockstep-upgrade argument says we cannot afford to rely on.
|
|
239
|
+
*/
|
|
240
|
+
bindScopeVersion(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId, versionId: string): Promise<void>;
|
|
241
|
+
/**
|
|
242
|
+
* Bind a hostname to a scope's surface. Lands `pending` — a custom domain is DNS
|
|
243
|
+
* validation and certificate issuance, not a string somebody sets, so the states
|
|
244
|
+
* it passes through are §4.2's business.
|
|
245
|
+
*
|
|
246
|
+
* Exactly one hostname per (scope, surface) may be canonical; binding a second
|
|
247
|
+
* canonical demotes the first, because "which one do certs and redirects use" has
|
|
248
|
+
* to have one answer.
|
|
249
|
+
*/
|
|
250
|
+
bindHostname(actor: PlatformActorId, input: BindHostnameInput): Promise<void>;
|
|
251
|
+
setHostnameStatus(actor: PlatformActorId, hostname: string, status: HostnameStatus, note?: string): Promise<void>;
|
|
252
|
+
listHostnames(actor: PlatformActorId, filter?: {
|
|
253
|
+
tenantId?: TenantId;
|
|
254
|
+
scopeId?: ScopeId;
|
|
255
|
+
}): Promise<HostnameBinding[]>;
|
|
256
|
+
/**
|
|
257
|
+
* Resolve a hostname for the router — the per-request read path.
|
|
258
|
+
*
|
|
259
|
+
* Takes NO actor and is not logged, for the same reason `resolveIdentity` does
|
|
260
|
+
* not: this runs on every request, by a machine, before any staff member is
|
|
261
|
+
* involved. K-24's access log records who *read the directory*, and a router
|
|
262
|
+
* dispatching traffic is not that.
|
|
263
|
+
*
|
|
264
|
+
* Returns only `active` bindings. It does **not** re-check tenant or scope
|
|
265
|
+
* suspension: `getScope` already fails closed there (§7), and a second
|
|
266
|
+
* enforcement point is a second thing that can disagree.
|
|
267
|
+
*/
|
|
268
|
+
resolveHostname(hostname: string): Promise<RouteTarget | undefined>;
|
|
198
269
|
/**
|
|
199
270
|
* Persist a tenant. Idempotent on the id — re-creating an existing tenant is a
|
|
200
271
|
* no-op, not an error (control-plane.md §4.1). `status` starts `active` and
|
|
@@ -209,10 +280,10 @@ export interface HostAdmin {
|
|
|
209
280
|
*/
|
|
210
281
|
setTenantStatus(actor: PlatformActorId, tenantId: TenantId, status: TenantStatus): Promise<void>;
|
|
211
282
|
/** The tenant registry — the directory's inventory (control-plane.md §4.5 console item 1). */
|
|
212
|
-
listTenants(): Promise<Tenant[]>;
|
|
213
|
-
getTenant(tenantId: TenantId): Promise<Tenant | undefined>;
|
|
283
|
+
listTenants(actor: PlatformActorId): Promise<Tenant[]>;
|
|
284
|
+
getTenant(actor: PlatformActorId, tenantId: TenantId): Promise<Tenant | undefined>;
|
|
214
285
|
/** The scope inventory. Ordered by scope_id (ULID = chronological). */
|
|
215
|
-
listScopes(filter?: ScopeFilter): Promise<Scope[]>;
|
|
286
|
+
listScopes(actor: PlatformActorId, filter?: ScopeFilter): Promise<Scope[]>;
|
|
216
287
|
/**
|
|
217
288
|
* One scope's directory record. Cross-checks the (tenantId, scopeId) pair and
|
|
218
289
|
* returns undefined on a mismatch rather than another tenant's scope (K-3) —
|
|
@@ -222,7 +293,7 @@ export interface HostAdmin {
|
|
|
222
293
|
* principal and grants no read of the record. This returns the record and
|
|
223
294
|
* grants no execution.
|
|
224
295
|
*/
|
|
225
|
-
getScopeRecord(tenantId: TenantId, scopeId: ScopeId): Promise<Scope | undefined>;
|
|
296
|
+
getScopeRecord(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId): Promise<Scope | undefined>;
|
|
226
297
|
/** active → suspended. Reversible containment (incident, dispute). */
|
|
227
298
|
suspendScope(actor: PlatformActorId, tenantId: TenantId, scopeId: ScopeId): Promise<void>;
|
|
228
299
|
/** suspended → active. */
|
|
@@ -240,7 +311,7 @@ export interface HostAdmin {
|
|
|
240
311
|
/** Turn it off. A tenant's scopes lose access to that module's operations. */
|
|
241
312
|
revokeEntitlement(actor: PlatformActorId, tenantId: TenantId, entitlementKey: string): Promise<void>;
|
|
242
313
|
/** The tenant's held SKU flags (control-plane.md §5 meter 2). */
|
|
243
|
-
listEntitlements(tenantId: TenantId): Promise<string[]>;
|
|
314
|
+
listEntitlements(actor: PlatformActorId, tenantId: TenantId): Promise<string[]>;
|
|
244
315
|
/**
|
|
245
316
|
* Bind an external identity to a principal + home node. Audited.
|
|
246
317
|
*
|
|
@@ -263,7 +334,7 @@ export interface HostAdmin {
|
|
|
263
334
|
* since changing a live pool's topology silently reinterprets every row it owns.
|
|
264
335
|
*/
|
|
265
336
|
registerIdentityPool(actor: PlatformActorId, pool: IdentityPool): Promise<void>;
|
|
266
|
-
getIdentityPool(provider: string): Promise<IdentityPool | undefined>;
|
|
337
|
+
getIdentityPool(actor: PlatformActorId, provider: string): Promise<IdentityPool | undefined>;
|
|
267
338
|
/**
|
|
268
339
|
* Which tenants this login exists in — the cross-tenant question, kept distinct
|
|
269
340
|
* from resolution because they have different safety conditions.
|
|
@@ -273,7 +344,7 @@ export interface HostAdmin {
|
|
|
273
344
|
* tenant list; this throws there rather than returning the single obvious answer,
|
|
274
345
|
* because asking at all is a category error the caller should see.
|
|
275
346
|
*/
|
|
276
|
-
listIdentityTenants(provider: string, externalId: string): Promise<TenantId[]>;
|
|
347
|
+
listIdentityTenants(actor: PlatformActorId, provider: string, externalId: string): Promise<TenantId[]>;
|
|
277
348
|
/**
|
|
278
349
|
* Resolve an external identity within a tenant — the auth adapter's read path.
|
|
279
350
|
*
|
|
@@ -290,7 +361,22 @@ export interface HostAdmin {
|
|
|
290
361
|
* `before`/`after`: a redefined role captures its old and new shape there, and
|
|
291
362
|
* that diff IS the checkpoint.
|
|
292
363
|
*/
|
|
293
|
-
auditLog(filter?: AuditLogFilter): Promise<AdminLogEntry[]>;
|
|
364
|
+
auditLog(actor: PlatformActorId, filter?: AuditLogFilter): Promise<AdminLogEntry[]>;
|
|
365
|
+
/**
|
|
366
|
+
* The staff access log (K-24) — who READ the directory, when, and how much came
|
|
367
|
+
* back. Reading it is itself recorded: who examined the record of who looked is
|
|
368
|
+
* the question an incident asks second.
|
|
369
|
+
*/
|
|
370
|
+
accessLog(actor: PlatformActorId, filter?: AccessLogFilter): Promise<AccessLogEntry[]>;
|
|
371
|
+
/**
|
|
372
|
+
* Prune access-log rows already shipped to Tier 2, oldest first, up to `limit`.
|
|
373
|
+
*
|
|
374
|
+
* **Only drained rows.** Pruning on age alone would destroy evidence while calling
|
|
375
|
+
* itself a retention policy — the failure K-21 rejected for tuples, one layer up.
|
|
376
|
+
* Nothing drains yet, so today this prunes nothing and the log grows: a stated
|
|
377
|
+
* limitation, not a policy, and the reason `drainedAt` ships before the sink.
|
|
378
|
+
*/
|
|
379
|
+
pruneAccessLog(actor: PlatformActorId, limit: number): Promise<number>;
|
|
294
380
|
}
|
|
295
381
|
export interface ProvisionScopeInput {
|
|
296
382
|
tenantId: TenantId;
|
|
@@ -337,6 +423,12 @@ export interface ScopeFilter {
|
|
|
337
423
|
* conjunctive AND; omitting all of them reads the whole log, which is why `limit`
|
|
338
424
|
* exists — the table is append-only and only grows.
|
|
339
425
|
*/
|
|
426
|
+
export interface AccessLogFilter {
|
|
427
|
+
actor?: PlatformActorId;
|
|
428
|
+
tenantId?: TenantId;
|
|
429
|
+
method?: string;
|
|
430
|
+
limit?: number;
|
|
431
|
+
}
|
|
340
432
|
export interface AuditLogFilter {
|
|
341
433
|
tenantId?: TenantId;
|
|
342
434
|
scopeId?: ScopeId;
|
package/dist/scope-host.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scope-host.d.ts","sourceRoot":"","sources":["../src/scope-host.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,SAAS,EACT,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,cAAc,EACd,cAAc,EACd,IAAI,EACJ,GAAG,EACH,KAAK,EACL,aAAa,EACb,aAAa,EACb,eAAe,EACf,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,cAAc,EACd,KAAK,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B,sFAAsF;IACtF,cAAc,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAEvD;;;;;;;;;;;OAWG;IACH,gBAAgB,CAAC,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI,CAAC;IAEhF,kGAAkG;IAClG,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;IAE3E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACxB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@substrat-run/kernel",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Substrat kernel contracts and services — pure TypeScript, no platform imports (D-14)",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -22,16 +22,18 @@
|
|
|
22
22
|
"dist"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@substrat-run/contracts": "^0.
|
|
25
|
+
"@substrat-run/contracts": "^0.8.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"typescript": "^5.6.0"
|
|
28
|
+
"typescript": "^5.6.0",
|
|
29
|
+
"vitest": "^3.0.0"
|
|
29
30
|
},
|
|
30
31
|
"publishConfig": {
|
|
31
32
|
"access": "public"
|
|
32
33
|
},
|
|
33
34
|
"scripts": {
|
|
34
35
|
"build": "tsc -p tsconfig.json",
|
|
35
|
-
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
36
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
37
|
+
"test": "vitest run"
|
|
36
38
|
}
|
|
37
39
|
}
|