@wildo-ai/platform-config-lib 1.1.13 → 1.1.14
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/esm/bootstrap/minion-database-queue-confinement.contracts.d.ts +41 -0
- package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.d.ts.map +1 -0
- package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.js +53 -0
- package/dist/esm/bootstrap/minion-database-queue-confinement.contracts.js.map +1 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts +64 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js +49 -0
- package/dist/esm/bootstrap/postgresql-owed-grants.contracts.js.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts +14 -0
- package/dist/esm/bootstrap/runtime-topology.contracts.d.ts.map +1 -1
- package/dist/esm/bootstrap/runtime-topology.contracts.js +24 -0
- package/dist/esm/bootstrap/runtime-topology.contracts.js.map +1 -1
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.d.ts +72 -2
- package/dist/esm/key-management/approval-seal-verifier.d.ts.map +1 -1
- package/dist/esm/key-management/approval-seal-verifier.js +102 -0
- package/dist/esm/key-management/approval-seal-verifier.js.map +1 -1
- package/dist/esm/pnpm-settings/application-pnpm-settings.d.ts +1 -1
- package/dist/esm/pnpm-settings/application-pnpm-settings.js +1 -1
- package/dist/esm/pnpm-settings/application-pnpm-settings.js.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts +10 -0
- package/dist/esm/project-config/provider-runtime-artifacts.d.ts.map +1 -1
- package/dist/esm/project-config/provider-runtime-artifacts.js +29 -5
- package/dist/esm/project-config/provider-runtime-artifacts.js.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.d.ts +37 -5
- package/dist/esm/project-config/shared/environment.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/environment.schemas.js +57 -5
- package/dist/esm/project-config/shared/environment.schemas.js.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts +8 -0
- package/dist/esm/project-config/shared/infra-providers.schemas.d.ts.map +1 -1
- package/dist/esm/project-config/shared/infra-providers.schemas.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -8
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which rows of the DATABASE queue a minion may reach (#2303).
|
|
3
|
+
*
|
|
4
|
+
* Under the `small` service profile the application's processes share the queue kept in its own database
|
|
5
|
+
* (`QueueAdapterType.DATABASE`, the `queueMessages` resource). A minion's PostgreSQL role then needs that table, and a
|
|
6
|
+
* plain table grant would let it read and delete every queued job of its application, where its RabbitMQ credential
|
|
7
|
+
* reads only its own queues (`buildMinionConsumeRegex` in `@wildo-ai/platform-infra-providers`'s RabbitMQ module). This
|
|
8
|
+
* derives the same confinement as rows: its tick queue, the queues under it, and its own reply queues. Applied as a
|
|
9
|
+
* PostgreSQL row-level security policy through the owed-grants contract (`postgresql-owed-grants.contracts.ts`).
|
|
10
|
+
*
|
|
11
|
+
* The names come from the builders the runtime itself uses (`buildMinionTickQueueName`, `buildReplyQueueNamePrefix`,
|
|
12
|
+
* {@link buildRuntimePrincipalQueueSegment}), so the policy and the queue names cannot drift.
|
|
13
|
+
*
|
|
14
|
+
* MongoDB has no row-level security, so a MongoDB application's minions get nothing here, and the `small` profile refuses
|
|
15
|
+
* them (`describeMinionsRefusedByEnvironmentServiceProfile`).
|
|
16
|
+
*/
|
|
17
|
+
import { type ResourceType } from '@wildo-ai/saas-models';
|
|
18
|
+
import { type PostgresOwedRowMatchRule } from './postgresql-owed-grants.contracts';
|
|
19
|
+
/**
|
|
20
|
+
* The resource type of the DATABASE queue's table, in the platform's vocabulary. The engine declares it as
|
|
21
|
+
* `BackendResourceType.QUEUE_MESSAGES` in `@wildo-ai/saas-backend-lib`, which this package cannot import; a test there
|
|
22
|
+
* holds the two equal.
|
|
23
|
+
*/
|
|
24
|
+
export declare const DATABASE_QUEUE_MESSAGES_RESOURCE_TYPE: ResourceType;
|
|
25
|
+
/** The field of a queue message naming its queue (`QueueMessageRow.queueName`; held equal by the same test). */
|
|
26
|
+
export declare const DATABASE_QUEUE_NAME_FIELD = "queueName";
|
|
27
|
+
/** The queue rows one minion may reach: a resource type, the field the policy reads, and the rules. */
|
|
28
|
+
export interface MinionDatabaseQueueConfinement {
|
|
29
|
+
readonly resourceType: ResourceType;
|
|
30
|
+
readonly field: string;
|
|
31
|
+
readonly rowsReachable: readonly PostgresOwedRowMatchRule[];
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* The DATABASE queue rows a minion may lease, settle and delete. Inserting is not confined (see
|
|
35
|
+
* `PostgresRowConfinedTableGrant`): a minion publishes work anywhere in its application, as its broker credential may.
|
|
36
|
+
*
|
|
37
|
+
* Refuses a minion name that sanitises to nothing: its reply segment would be absent, and the reply prefix without a
|
|
38
|
+
* segment is the backend's, which prefixes every runtime's replies.
|
|
39
|
+
*/
|
|
40
|
+
export declare function deriveMinionDatabaseQueueConfinement(wildoApplicationId: string, minionName: string): MinionDatabaseQueueConfinement;
|
|
41
|
+
//# sourceMappingURL=minion-database-queue-confinement.contracts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minion-database-queue-confinement.contracts.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/minion-database-queue-confinement.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAwB,KAAK,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAGzG;;;;GAIG;AACH,eAAO,MAAM,qCAAqC,EAAE,YAA8B,CAAC;AAEnF,gHAAgH;AAChH,eAAO,MAAM,yBAAyB,cAAc,CAAC;AAErD,uGAAuG;AACvG,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,aAAa,EAAE,SAAS,wBAAwB,EAAE,CAAC;CAC7D;AAED;;;;;;GAMG;AACH,wBAAgB,oCAAoC,CAAC,kBAAkB,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,8BAA8B,CAmBnI"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which rows of the DATABASE queue a minion may reach (#2303).
|
|
3
|
+
*
|
|
4
|
+
* Under the `small` service profile the application's processes share the queue kept in its own database
|
|
5
|
+
* (`QueueAdapterType.DATABASE`, the `queueMessages` resource). A minion's PostgreSQL role then needs that table, and a
|
|
6
|
+
* plain table grant would let it read and delete every queued job of its application, where its RabbitMQ credential
|
|
7
|
+
* reads only its own queues (`buildMinionConsumeRegex` in `@wildo-ai/platform-infra-providers`'s RabbitMQ module). This
|
|
8
|
+
* derives the same confinement as rows: its tick queue, the queues under it, and its own reply queues. Applied as a
|
|
9
|
+
* PostgreSQL row-level security policy through the owed-grants contract (`postgresql-owed-grants.contracts.ts`).
|
|
10
|
+
*
|
|
11
|
+
* The names come from the builders the runtime itself uses (`buildMinionTickQueueName`, `buildReplyQueueNamePrefix`,
|
|
12
|
+
* {@link buildRuntimePrincipalQueueSegment}), so the policy and the queue names cannot drift.
|
|
13
|
+
*
|
|
14
|
+
* MongoDB has no row-level security, so a MongoDB application's minions get nothing here, and the `small` profile refuses
|
|
15
|
+
* them (`describeMinionsRefusedByEnvironmentServiceProfile`).
|
|
16
|
+
*/
|
|
17
|
+
import { QueueNamingUtils } from '@wildo-ai/saas-models';
|
|
18
|
+
import { PostgresOwedRowMatch } from './postgresql-owed-grants.contracts.js';
|
|
19
|
+
import { ApplicationRuntimePrincipalKind, buildRuntimePrincipalQueueSegment } from './runtime-principal.contracts.js';
|
|
20
|
+
/**
|
|
21
|
+
* The resource type of the DATABASE queue's table, in the platform's vocabulary. The engine declares it as
|
|
22
|
+
* `BackendResourceType.QUEUE_MESSAGES` in `@wildo-ai/saas-backend-lib`, which this package cannot import; a test there
|
|
23
|
+
* holds the two equal.
|
|
24
|
+
*/
|
|
25
|
+
export const DATABASE_QUEUE_MESSAGES_RESOURCE_TYPE = 'queueMessages';
|
|
26
|
+
/** The field of a queue message naming its queue (`QueueMessageRow.queueName`; held equal by the same test). */
|
|
27
|
+
export const DATABASE_QUEUE_NAME_FIELD = 'queueName';
|
|
28
|
+
/**
|
|
29
|
+
* The DATABASE queue rows a minion may lease, settle and delete. Inserting is not confined (see
|
|
30
|
+
* `PostgresRowConfinedTableGrant`): a minion publishes work anywhere in its application, as its broker credential may.
|
|
31
|
+
*
|
|
32
|
+
* Refuses a minion name that sanitises to nothing: its reply segment would be absent, and the reply prefix without a
|
|
33
|
+
* segment is the backend's, which prefixes every runtime's replies.
|
|
34
|
+
*/
|
|
35
|
+
export function deriveMinionDatabaseQueueConfinement(wildoApplicationId, minionName) {
|
|
36
|
+
const replySegment = buildRuntimePrincipalQueueSegment(ApplicationRuntimePrincipalKind.MINION, minionName);
|
|
37
|
+
if (!wildoApplicationId || !replySegment) {
|
|
38
|
+
throw new Error(`Cannot confine minion "${minionName}" of application "${wildoApplicationId}" to its own queues: `
|
|
39
|
+
+ 'its application id or its queue segment is empty, and a confinement built from either would reach other runtimes\' rows.');
|
|
40
|
+
}
|
|
41
|
+
const tickQueue = QueueNamingUtils.buildMinionTickQueueName(wildoApplicationId, minionName);
|
|
42
|
+
return {
|
|
43
|
+
resourceType: DATABASE_QUEUE_MESSAGES_RESOURCE_TYPE,
|
|
44
|
+
field: DATABASE_QUEUE_NAME_FIELD,
|
|
45
|
+
rowsReachable: [
|
|
46
|
+
{ kind: PostgresOwedRowMatch.EXACT, value: tickQueue },
|
|
47
|
+
// The broker regex admits `<tick>(\..*)?`: the tick queue's own sub-queues (a dead-letter or delay queue).
|
|
48
|
+
{ kind: PostgresOwedRowMatch.PREFIX, value: `${tickQueue}.` },
|
|
49
|
+
{ kind: PostgresOwedRowMatch.PREFIX, value: QueueNamingUtils.buildReplyQueueNamePrefix(wildoApplicationId, replySegment) },
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=minion-database-queue-confinement.contracts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"minion-database-queue-confinement.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/minion-database-queue-confinement.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,gBAAgB,EAAqB,MAAM,uBAAuB,CAAC;AAE5E,OAAO,EAAE,oBAAoB,EAAiC,MAAM,oCAAoC,CAAC;AACzG,OAAO,EAAE,+BAA+B,EAAE,iCAAiC,EAAE,MAAM,+BAA+B,CAAC;AAEnH;;;;GAIG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAiB,eAAe,CAAC;AAEnF,gHAAgH;AAChH,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;AASrD;;;;;;GAMG;AACH,MAAM,UAAU,oCAAoC,CAAC,kBAA0B,EAAE,UAAkB;IACjG,MAAM,YAAY,GAAG,iCAAiC,CAAC,+BAA+B,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC;IAC3G,IAAI,CAAC,kBAAkB,IAAI,CAAC,YAAY,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,0BAA0B,UAAU,qBAAqB,kBAAkB,uBAAuB;cAChG,0HAA0H,CAC7H,CAAC;IACJ,CAAC;IACD,MAAM,SAAS,GAAG,gBAAgB,CAAC,wBAAwB,CAAC,kBAAkB,EAAE,UAAU,CAAC,CAAC;IAC5F,OAAO;QACL,YAAY,EAAE,qCAAqC;QACnD,KAAK,EAAE,yBAAyB;QAChC,aAAa,EAAE;YACb,EAAE,IAAI,EAAE,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE;YACtD,2GAA2G;YAC3G,EAAE,IAAI,EAAE,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,SAAS,GAAG,EAAE;YAC7D,EAAE,IAAI,EAAE,oBAAoB,CAAC,MAAM,EAAE,KAAK,EAAE,gBAAgB,CAAC,yBAAyB,CAAC,kBAAkB,EAAE,YAAY,CAAC,EAAE;SAC3H;KACF,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Which rows of the DATABASE queue a minion may reach (#2303).\n *\n * Under the `small` service profile the application's processes share the queue kept in its own database\n * (`QueueAdapterType.DATABASE`, the `queueMessages` resource). A minion's PostgreSQL role then needs that table, and a\n * plain table grant would let it read and delete every queued job of its application, where its RabbitMQ credential\n * reads only its own queues (`buildMinionConsumeRegex` in `@wildo-ai/platform-infra-providers`'s RabbitMQ module). This\n * derives the same confinement as rows: its tick queue, the queues under it, and its own reply queues. Applied as a\n * PostgreSQL row-level security policy through the owed-grants contract (`postgresql-owed-grants.contracts.ts`).\n *\n * The names come from the builders the runtime itself uses (`buildMinionTickQueueName`, `buildReplyQueueNamePrefix`,\n * {@link buildRuntimePrincipalQueueSegment}), so the policy and the queue names cannot drift.\n *\n * MongoDB has no row-level security, so a MongoDB application's minions get nothing here, and the `small` profile refuses\n * them (`describeMinionsRefusedByEnvironmentServiceProfile`).\n */\nimport { QueueNamingUtils, type ResourceType } from '@wildo-ai/saas-models';\n\nimport { PostgresOwedRowMatch, type PostgresOwedRowMatchRule } from './postgresql-owed-grants.contracts';\nimport { ApplicationRuntimePrincipalKind, buildRuntimePrincipalQueueSegment } from './runtime-principal.contracts';\n\n/**\n * The resource type of the DATABASE queue's table, in the platform's vocabulary. The engine declares it as\n * `BackendResourceType.QUEUE_MESSAGES` in `@wildo-ai/saas-backend-lib`, which this package cannot import; a test there\n * holds the two equal.\n */\nexport const DATABASE_QUEUE_MESSAGES_RESOURCE_TYPE: ResourceType = 'queueMessages';\n\n/** The field of a queue message naming its queue (`QueueMessageRow.queueName`; held equal by the same test). */\nexport const DATABASE_QUEUE_NAME_FIELD = 'queueName';\n\n/** The queue rows one minion may reach: a resource type, the field the policy reads, and the rules. */\nexport interface MinionDatabaseQueueConfinement {\n readonly resourceType: ResourceType;\n readonly field: string;\n readonly rowsReachable: readonly PostgresOwedRowMatchRule[];\n}\n\n/**\n * The DATABASE queue rows a minion may lease, settle and delete. Inserting is not confined (see\n * `PostgresRowConfinedTableGrant`): a minion publishes work anywhere in its application, as its broker credential may.\n *\n * Refuses a minion name that sanitises to nothing: its reply segment would be absent, and the reply prefix without a\n * segment is the backend's, which prefixes every runtime's replies.\n */\nexport function deriveMinionDatabaseQueueConfinement(wildoApplicationId: string, minionName: string): MinionDatabaseQueueConfinement {\n const replySegment = buildRuntimePrincipalQueueSegment(ApplicationRuntimePrincipalKind.MINION, minionName);\n if (!wildoApplicationId || !replySegment) {\n throw new Error(\n `Cannot confine minion \"${minionName}\" of application \"${wildoApplicationId}\" to its own queues: `\n + 'its application id or its queue segment is empty, and a confinement built from either would reach other runtimes\\' rows.',\n );\n }\n const tickQueue = QueueNamingUtils.buildMinionTickQueueName(wildoApplicationId, minionName);\n return {\n resourceType: DATABASE_QUEUE_MESSAGES_RESOURCE_TYPE,\n field: DATABASE_QUEUE_NAME_FIELD,\n rowsReachable: [\n { kind: PostgresOwedRowMatch.EXACT, value: tickQueue },\n // The broker regex admits `<tick>(\\..*)?`: the tick queue's own sub-queues (a dead-letter or delay queue).\n { kind: PostgresOwedRowMatch.PREFIX, value: `${tickQueue}.` },\n { kind: PostgresOwedRowMatch.PREFIX, value: QueueNamingUtils.buildReplyQueueNamePrefix(wildoApplicationId, replySegment) },\n ],\n };\n}\n"]}
|
|
@@ -77,4 +77,68 @@ export declare enum PostgresOwedTablePrivilege {
|
|
|
77
77
|
UPDATE = "UPDATE",
|
|
78
78
|
DELETE = "DELETE"
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* ## Row policies: a table a principal reaches only partly (#2303)
|
|
82
|
+
*
|
|
83
|
+
* Some engine tables hold rows of several principals at once. The DATABASE queue's `queuemessages` is the case that
|
|
84
|
+
* forced this: every queue of the application lives there, and a minion may lease, settle and delete only its own tick
|
|
85
|
+
* queue and its own reply queues, as its RabbitMQ credential reads only those. A table grant cannot say that, so the
|
|
86
|
+
* grant on such a table travels with a PostgreSQL ROW-LEVEL SECURITY policy, recorded beside the owed grants in
|
|
87
|
+
* {@link POSTGRES_OWED_ROW_POLICIES_TABLE} and applied by the same function, which:
|
|
88
|
+
*
|
|
89
|
+
* - enables row-level security on the table (`ENABLE`, never `FORCE`: the table's owner, the application backend, keeps
|
|
90
|
+
* reading every row, as it consumes every queue);
|
|
91
|
+
* - creates, per principal, a policy for each of SELECT, UPDATE and DELETE admitting only the rows whose column matches
|
|
92
|
+
* one recorded rule ({@link PostgresOwedRowMatch}), and an INSERT policy admitting any row. Publishing stays
|
|
93
|
+
* application-wide, as the broker's write permission is: a minion enqueues work for the backend and other minions;
|
|
94
|
+
* - issues the principal's table grant ONLY once its policies are in place. With row-level security enabled, a role
|
|
95
|
+
* with no policy sees no row, so a grant that ran ahead of its policy would still read nothing; withholding it as well
|
|
96
|
+
* means a failed policy step can never leave a principal on an unconfined table.
|
|
97
|
+
*
|
|
98
|
+
* Creating a policy and enabling row-level security need the table's ownership, which the platform's admin role holds
|
|
99
|
+
* only as a superuser (a self-hosted PostgreSQL). Where it does not, the function skips that table, withholds its grant
|
|
100
|
+
* and raises a WARNING; apps-manager reports the table as unconfined and ungranted.
|
|
101
|
+
*
|
|
102
|
+
* Policies are named {@link POSTGRES_OWED_ROW_POLICY_NAME_PREFIX} + a digest of the role, so the function finds and drops
|
|
103
|
+
* the ones no record asks for any more, and a role is never left referenced by a policy it no longer holds (PostgreSQL
|
|
104
|
+
* refuses to drop a role a policy names). A policy whose expression is unchanged is left alone: re-creating it would take
|
|
105
|
+
* the table's ACCESS EXCLUSIVE lock on every boot.
|
|
106
|
+
*/
|
|
107
|
+
/** One row per (principal role, schema, table, column, match kind, value) apps-manager derived for that principal. */
|
|
108
|
+
export declare const POSTGRES_OWED_ROW_POLICIES_TABLE = "owed_row_policies";
|
|
109
|
+
/** The name of the row-policy record's CHECK constraint on `match_kind`, re-created from {@link PostgresOwedRowMatch}. */
|
|
110
|
+
export declare const POSTGRES_OWED_ROW_POLICIES_MATCH_CHECK = "owed_row_policies_match_check";
|
|
111
|
+
/**
|
|
112
|
+
* `wildo_access.owed_row_policy_expression(role, schema, table)`: the policy expression the record yields for one
|
|
113
|
+
* principal's table. Called only inside {@link POSTGRES_APPLY_OWED_TABLE_GRANTS_FUNCTION}; EXECUTE is revoked from PUBLIC.
|
|
114
|
+
*/
|
|
115
|
+
export declare const POSTGRES_OWED_ROW_POLICY_EXPRESSION_FUNCTION = "owed_row_policy_expression";
|
|
116
|
+
/** Every policy the function creates starts with this, and only those are ever dropped by it. */
|
|
117
|
+
export declare const POSTGRES_OWED_ROW_POLICY_NAME_PREFIX = "wildo_rp_";
|
|
118
|
+
/**
|
|
119
|
+
* How a recorded rule admits a row. Closed for the same reason {@link PostgresOwedTablePrivilege} is: the function maps
|
|
120
|
+
* it through literals generated from this set into the policy expression, and the record's CHECK refuses anything else.
|
|
121
|
+
*/
|
|
122
|
+
export declare enum PostgresOwedRowMatch {
|
|
123
|
+
/** The column equals the value. */
|
|
124
|
+
EXACT = "EXACT",
|
|
125
|
+
/** The column starts with the value (`starts_with`, no LIKE pattern, so no character in the value is special). */
|
|
126
|
+
PREFIX = "PREFIX"
|
|
127
|
+
}
|
|
128
|
+
/** One rule of a row policy: rows whose column matches it are reachable. */
|
|
129
|
+
export interface PostgresOwedRowMatchRule {
|
|
130
|
+
readonly kind: PostgresOwedRowMatch;
|
|
131
|
+
readonly value: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A table a principal reaches through a row policy: SELECT, INSERT, UPDATE and DELETE are granted, and every statement
|
|
135
|
+
* but INSERT reaches only the rows whose `column` matches one of `rowsReachable`. An empty rule list is REFUSED: to
|
|
136
|
+
* reach no row, grant nothing. The table is granted only through its policy, so it is removed from any plain axis that
|
|
137
|
+
* also names it.
|
|
138
|
+
*/
|
|
139
|
+
export interface PostgresRowConfinedTableGrant {
|
|
140
|
+
readonly table: string;
|
|
141
|
+
readonly column: string;
|
|
142
|
+
readonly rowsReachable: readonly PostgresOwedRowMatchRule[];
|
|
143
|
+
}
|
|
80
144
|
//# sourceMappingURL=postgresql-owed-grants.contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgresql-owed-grants.contracts.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/postgresql-owed-grants.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,0HAA0H;AAC1H,eAAO,MAAM,iCAAiC,iBAAiB,CAAC;AAEhE,sGAAsG;AACtG,eAAO,MAAM,gCAAgC,sBAAsB,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,yCAAyC,4BAA4B,CAAC;AAEnF,kIAAkI;AAClI,eAAO,MAAM,0CAA0C,sCAAsC,CAAC;AAE9F;;;GAGG;AACH,eAAO,MAAM,uCAAuC,QAAQ,CAAC;AAE7D;;;;;GAKG;AACH,oBAAY,0BAA0B;IACpC,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB"}
|
|
1
|
+
{"version":3,"file":"postgresql-owed-grants.contracts.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/postgresql-owed-grants.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,0HAA0H;AAC1H,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|
})(PostgresOwedTablePrivilege || (PostgresOwedTablePrivilege = {}));
|
|
81
|
+
/**
|
|
82
|
+
* ## Row policies: a table a principal reaches only partly (#2303)
|
|
83
|
+
*
|
|
84
|
+
* Some engine tables hold rows of several principals at once. The DATABASE queue's `queuemessages` is the case that
|
|
85
|
+
* forced this: every queue of the application lives there, and a minion may lease, settle and delete only its own tick
|
|
86
|
+
* queue and its own reply queues, as its RabbitMQ credential reads only those. A table grant cannot say that, so the
|
|
87
|
+
* grant on such a table travels with a PostgreSQL ROW-LEVEL SECURITY policy, recorded beside the owed grants in
|
|
88
|
+
* {@link POSTGRES_OWED_ROW_POLICIES_TABLE} and applied by the same function, which:
|
|
89
|
+
*
|
|
90
|
+
* - enables row-level security on the table (`ENABLE`, never `FORCE`: the table's owner, the application backend, keeps
|
|
91
|
+
* reading every row, as it consumes every queue);
|
|
92
|
+
* - creates, per principal, a policy for each of SELECT, UPDATE and DELETE admitting only the rows whose column matches
|
|
93
|
+
* one recorded rule ({@link PostgresOwedRowMatch}), and an INSERT policy admitting any row. Publishing stays
|
|
94
|
+
* application-wide, as the broker's write permission is: a minion enqueues work for the backend and other minions;
|
|
95
|
+
* - issues the principal's table grant ONLY once its policies are in place. With row-level security enabled, a role
|
|
96
|
+
* with no policy sees no row, so a grant that ran ahead of its policy would still read nothing; withholding it as well
|
|
97
|
+
* means a failed policy step can never leave a principal on an unconfined table.
|
|
98
|
+
*
|
|
99
|
+
* Creating a policy and enabling row-level security need the table's ownership, which the platform's admin role holds
|
|
100
|
+
* only as a superuser (a self-hosted PostgreSQL). Where it does not, the function skips that table, withholds its grant
|
|
101
|
+
* and raises a WARNING; apps-manager reports the table as unconfined and ungranted.
|
|
102
|
+
*
|
|
103
|
+
* Policies are named {@link POSTGRES_OWED_ROW_POLICY_NAME_PREFIX} + a digest of the role, so the function finds and drops
|
|
104
|
+
* the ones no record asks for any more, and a role is never left referenced by a policy it no longer holds (PostgreSQL
|
|
105
|
+
* refuses to drop a role a policy names). A policy whose expression is unchanged is left alone: re-creating it would take
|
|
106
|
+
* the table's ACCESS EXCLUSIVE lock on every boot.
|
|
107
|
+
*/
|
|
108
|
+
/** One row per (principal role, schema, table, column, match kind, value) apps-manager derived for that principal. */
|
|
109
|
+
export const POSTGRES_OWED_ROW_POLICIES_TABLE = 'owed_row_policies';
|
|
110
|
+
/** The name of the row-policy record's CHECK constraint on `match_kind`, re-created from {@link PostgresOwedRowMatch}. */
|
|
111
|
+
export const POSTGRES_OWED_ROW_POLICIES_MATCH_CHECK = 'owed_row_policies_match_check';
|
|
112
|
+
/**
|
|
113
|
+
* `wildo_access.owed_row_policy_expression(role, schema, table)`: the policy expression the record yields for one
|
|
114
|
+
* principal's table. Called only inside {@link POSTGRES_APPLY_OWED_TABLE_GRANTS_FUNCTION}; EXECUTE is revoked from PUBLIC.
|
|
115
|
+
*/
|
|
116
|
+
export const POSTGRES_OWED_ROW_POLICY_EXPRESSION_FUNCTION = 'owed_row_policy_expression';
|
|
117
|
+
/** Every policy the function creates starts with this, and only those are ever dropped by it. */
|
|
118
|
+
export const POSTGRES_OWED_ROW_POLICY_NAME_PREFIX = 'wildo_rp_';
|
|
119
|
+
/**
|
|
120
|
+
* How a recorded rule admits a row. Closed for the same reason {@link PostgresOwedTablePrivilege} is: the function maps
|
|
121
|
+
* it through literals generated from this set into the policy expression, and the record's CHECK refuses anything else.
|
|
122
|
+
*/
|
|
123
|
+
export var PostgresOwedRowMatch;
|
|
124
|
+
(function (PostgresOwedRowMatch) {
|
|
125
|
+
/** The column equals the value. */
|
|
126
|
+
PostgresOwedRowMatch["EXACT"] = "EXACT";
|
|
127
|
+
/** The column starts with the value (`starts_with`, no LIKE pattern, so no character in the value is special). */
|
|
128
|
+
PostgresOwedRowMatch["PREFIX"] = "PREFIX";
|
|
129
|
+
})(PostgresOwedRowMatch || (PostgresOwedRowMatch = {}));
|
|
81
130
|
//# sourceMappingURL=postgresql-owed-grants.contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgresql-owed-grants.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/postgresql-owed-grants.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,0HAA0H;AAC1H,MAAM,CAAC,MAAM,iCAAiC,GAAG,cAAc,CAAC;AAEhE,sGAAsG;AACtG,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,yBAAyB,CAAC;AAEnF,kIAAkI;AAClI,MAAM,CAAC,MAAM,0CAA0C,GAAG,mCAAmC,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,KAAK,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,CAAN,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;AACnB,CAAC,EALW,0BAA0B,KAA1B,0BAA0B,QAKrC","sourcesContent":["/**\n * The in-database contract by which an application's PostgreSQL migrations grant a named runtime\n * principal (a minion) the tables those migrations create (#3027).\n *\n * ## The gap it closes\n *\n * A minion's role is TABLE-SCOPED, and PostgreSQL can only grant a table that exists. apps-manager\n * provisions the role BEFORE the application backend boots, and the backend's migrations create the\n * tables WHEN it boots, so every table a migration creates was skipped by the grant pass and stayed\n * out of reach until a later provisioning pass that nothing triggered. With #2894 that reached an\n * engine floor table every minion needs (`applicationDataKeys`): a minion could not open the secrets\n * the backend seals, from the moment the backend ran the migration.\n *\n * ## The contract\n *\n * apps-manager stays the ONLY party that decides what a principal may touch. Inside the grant\n * transaction it records every grant it derived, existing table or not, in\n * {@link POSTGRES_OWED_TABLE_GRANTS_SCHEMA}.{@link POSTGRES_OWED_TABLE_GRANTS_TABLE}, and installs\n * {@link POSTGRES_APPLY_OWED_TABLE_GRANTS_FUNCTION}: a `SECURITY DEFINER` function that issues the\n * recorded grants whose table now exists. EXECUTE is granted to the database OWNER (the application\n * backend) and to nobody else. The backend calls it once its migrations are applied. So the grant a\n * migration made possible lands in the same boot, and the backend executes a decision it cannot\n * change: the record and the function belong to the admin role, and the backend holds no privilege\n * on the record.\n *\n * Both sides LOCK the record table (`SHARE ROW EXCLUSIVE`, self-conflicting), so a backend applying the\n * record and apps-manager replacing it never interleave: the backend applies either the old record before\n * apps-manager's authoritative revoke-and-regrant, or the new one after. A table lock rather than an\n * advisory key, because any connected role can take an advisory key and hold it; a table lock needs a\n * privilege on the record, which only the admin holds. Every wait is bounded by\n * {@link POSTGRES_OWED_TABLE_GRANTS_LOCK_TIMEOUT}.\n *\n * The function reads the record after its lock, which is a fresh read under `READ COMMITTED`. A caller\n * running it under `REPEATABLE READ` reads the snapshot its transaction began with and may apply a record\n * apps-manager has just replaced. That caller is the database owner, which can grant its own tables to\n * anyone anyway, so it gains nothing; apps-manager's next pass corrects the grants.\n *\n * ## Rejected\n *\n * - apps-manager re-provisioning on a post-migration signal from the backend: the apps-to-manager\n * channel has no write route by design (#2921), and an application able to trigger platform\n * provisioning is a door it does not need. The signal here travels through the database, and all it\n * can cause is the grants apps-manager already recorded.\n * - The backend deriving the grants itself (`deriveMinionDatabaseGrants` is shared): a second\n * derivation of who may touch what, beside role names and declarations that only apps-manager holds.\n * Two authorities for one grant drift.\n * - `ALTER DEFAULT PRIVILEGES`: schema-wide, so it would grant every future table, which is the\n * over-grant table scoping exists to prevent.\n * - An event trigger on `CREATE TABLE`: event triggers need superuser to create and are not available\n * to every managed provider's admin role, and they fire inside every DDL statement.\n */\n\n/** The schema holding the owed-grant record and the function. Owned by the platform admin role; not the application's. */\nexport const POSTGRES_OWED_TABLE_GRANTS_SCHEMA = 'wildo_access';\n\n/** One row per (principal role, schema, table, privilege) apps-manager derived for that principal. */\nexport const POSTGRES_OWED_TABLE_GRANTS_TABLE = 'owed_table_grants';\n\n/**\n * `wildo_access.apply_owed_table_grants()`: issues every recorded grant whose table and role exist,\n * returns how many it issued. Idempotent (`GRANT` is), so it is safe on every backend boot.\n */\nexport const POSTGRES_APPLY_OWED_TABLE_GRANTS_FUNCTION = 'apply_owed_table_grants';\n\n/** The name of the record's CHECK constraint on `privilege`, re-created from {@link PostgresOwedTablePrivilege} on every pass. */\nexport const POSTGRES_OWED_TABLE_GRANTS_PRIVILEGE_CHECK = 'owed_table_grants_privilege_check';\n\n/**\n * How long either side waits for the other's lock on the record before failing (a PostgreSQL interval).\n * A pass that waits longer is stuck, and failing names it; the backend's boot reports FAILED and continues.\n */\nexport const POSTGRES_OWED_TABLE_GRANTS_LOCK_TIMEOUT = '30s';\n\n/**\n * The privileges a record row may carry. Closed because the function interpolates it into `GRANT`\n * (a privilege is a keyword, not a bindable value): the function maps a stored value through literals\n * generated from this set, so a value outside it is never spliced into SQL, and the record's CHECK\n * constraint, built from the same set, refuses to store one.\n */\nexport enum PostgresOwedTablePrivilege {\n SELECT = 'SELECT',\n INSERT = 'INSERT',\n UPDATE = 'UPDATE',\n DELETE = 'DELETE',\n}\n"]}
|
|
1
|
+
{"version":3,"file":"postgresql-owed-grants.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/postgresql-owed-grants.contracts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AAEH,0HAA0H;AAC1H,MAAM,CAAC,MAAM,iCAAiC,GAAG,cAAc,CAAC;AAEhE,sGAAsG;AACtG,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAAC;AAEpE;;;GAGG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,yBAAyB,CAAC;AAEnF,kIAAkI;AAClI,MAAM,CAAC,MAAM,0CAA0C,GAAG,mCAAmC,CAAC;AAE9F;;;GAGG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,KAAK,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,CAAN,IAAY,0BAKX;AALD,WAAY,0BAA0B;IACpC,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;IACjB,+CAAiB,CAAA;AACnB,CAAC,EALW,0BAA0B,KAA1B,0BAA0B,QAKrC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,sHAAsH;AACtH,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CAAC;AAEpE,0HAA0H;AAC1H,MAAM,CAAC,MAAM,sCAAsC,GAAG,+BAA+B,CAAC;AAEtF;;;GAGG;AACH,MAAM,CAAC,MAAM,4CAA4C,GAAG,4BAA4B,CAAC;AAEzF,iGAAiG;AACjG,MAAM,CAAC,MAAM,oCAAoC,GAAG,WAAW,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAN,IAAY,oBAKX;AALD,WAAY,oBAAoB;IAC9B,mCAAmC;IACnC,uCAAe,CAAA;IACf,kHAAkH;IAClH,yCAAiB,CAAA;AACnB,CAAC,EALW,oBAAoB,KAApB,oBAAoB,QAK/B","sourcesContent":["/**\n * The in-database contract by which an application's PostgreSQL migrations grant a named runtime\n * principal (a minion) the tables those migrations create (#3027).\n *\n * ## The gap it closes\n *\n * A minion's role is TABLE-SCOPED, and PostgreSQL can only grant a table that exists. apps-manager\n * provisions the role BEFORE the application backend boots, and the backend's migrations create the\n * tables WHEN it boots, so every table a migration creates was skipped by the grant pass and stayed\n * out of reach until a later provisioning pass that nothing triggered. With #2894 that reached an\n * engine floor table every minion needs (`applicationDataKeys`): a minion could not open the secrets\n * the backend seals, from the moment the backend ran the migration.\n *\n * ## The contract\n *\n * apps-manager stays the ONLY party that decides what a principal may touch. Inside the grant\n * transaction it records every grant it derived, existing table or not, in\n * {@link POSTGRES_OWED_TABLE_GRANTS_SCHEMA}.{@link POSTGRES_OWED_TABLE_GRANTS_TABLE}, and installs\n * {@link POSTGRES_APPLY_OWED_TABLE_GRANTS_FUNCTION}: a `SECURITY DEFINER` function that issues the\n * recorded grants whose table now exists. EXECUTE is granted to the database OWNER (the application\n * backend) and to nobody else. The backend calls it once its migrations are applied. So the grant a\n * migration made possible lands in the same boot, and the backend executes a decision it cannot\n * change: the record and the function belong to the admin role, and the backend holds no privilege\n * on the record.\n *\n * Both sides LOCK the record table (`SHARE ROW EXCLUSIVE`, self-conflicting), so a backend applying the\n * record and apps-manager replacing it never interleave: the backend applies either the old record before\n * apps-manager's authoritative revoke-and-regrant, or the new one after. A table lock rather than an\n * advisory key, because any connected role can take an advisory key and hold it; a table lock needs a\n * privilege on the record, which only the admin holds. Every wait is bounded by\n * {@link POSTGRES_OWED_TABLE_GRANTS_LOCK_TIMEOUT}.\n *\n * The function reads the record after its lock, which is a fresh read under `READ COMMITTED`. A caller\n * running it under `REPEATABLE READ` reads the snapshot its transaction began with and may apply a record\n * apps-manager has just replaced. That caller is the database owner, which can grant its own tables to\n * anyone anyway, so it gains nothing; apps-manager's next pass corrects the grants.\n *\n * ## Rejected\n *\n * - apps-manager re-provisioning on a post-migration signal from the backend: the apps-to-manager\n * channel has no write route by design (#2921), and an application able to trigger platform\n * provisioning is a door it does not need. The signal here travels through the database, and all it\n * can cause is the grants apps-manager already recorded.\n * - The backend deriving the grants itself (`deriveMinionDatabaseGrants` is shared): a second\n * derivation of who may touch what, beside role names and declarations that only apps-manager holds.\n * Two authorities for one grant drift.\n * - `ALTER DEFAULT PRIVILEGES`: schema-wide, so it would grant every future table, which is the\n * over-grant table scoping exists to prevent.\n * - An event trigger on `CREATE TABLE`: event triggers need superuser to create and are not available\n * to every managed provider's admin role, and they fire inside every DDL statement.\n */\n\n/** The schema holding the owed-grant record and the function. Owned by the platform admin role; not the application's. */\nexport const POSTGRES_OWED_TABLE_GRANTS_SCHEMA = 'wildo_access';\n\n/** One row per (principal role, schema, table, privilege) apps-manager derived for that principal. */\nexport const POSTGRES_OWED_TABLE_GRANTS_TABLE = 'owed_table_grants';\n\n/**\n * `wildo_access.apply_owed_table_grants()`: issues every recorded grant whose table and role exist,\n * returns how many it issued. Idempotent (`GRANT` is), so it is safe on every backend boot.\n */\nexport const POSTGRES_APPLY_OWED_TABLE_GRANTS_FUNCTION = 'apply_owed_table_grants';\n\n/** The name of the record's CHECK constraint on `privilege`, re-created from {@link PostgresOwedTablePrivilege} on every pass. */\nexport const POSTGRES_OWED_TABLE_GRANTS_PRIVILEGE_CHECK = 'owed_table_grants_privilege_check';\n\n/**\n * How long either side waits for the other's lock on the record before failing (a PostgreSQL interval).\n * A pass that waits longer is stuck, and failing names it; the backend's boot reports FAILED and continues.\n */\nexport const POSTGRES_OWED_TABLE_GRANTS_LOCK_TIMEOUT = '30s';\n\n/**\n * The privileges a record row may carry. Closed because the function interpolates it into `GRANT`\n * (a privilege is a keyword, not a bindable value): the function maps a stored value through literals\n * generated from this set, so a value outside it is never spliced into SQL, and the record's CHECK\n * constraint, built from the same set, refuses to store one.\n */\nexport enum PostgresOwedTablePrivilege {\n SELECT = 'SELECT',\n INSERT = 'INSERT',\n UPDATE = 'UPDATE',\n DELETE = 'DELETE',\n}\n\n/**\n * ## Row policies: a table a principal reaches only partly (#2303)\n *\n * Some engine tables hold rows of several principals at once. The DATABASE queue's `queuemessages` is the case that\n * forced this: every queue of the application lives there, and a minion may lease, settle and delete only its own tick\n * queue and its own reply queues, as its RabbitMQ credential reads only those. A table grant cannot say that, so the\n * grant on such a table travels with a PostgreSQL ROW-LEVEL SECURITY policy, recorded beside the owed grants in\n * {@link POSTGRES_OWED_ROW_POLICIES_TABLE} and applied by the same function, which:\n *\n * - enables row-level security on the table (`ENABLE`, never `FORCE`: the table's owner, the application backend, keeps\n * reading every row, as it consumes every queue);\n * - creates, per principal, a policy for each of SELECT, UPDATE and DELETE admitting only the rows whose column matches\n * one recorded rule ({@link PostgresOwedRowMatch}), and an INSERT policy admitting any row. Publishing stays\n * application-wide, as the broker's write permission is: a minion enqueues work for the backend and other minions;\n * - issues the principal's table grant ONLY once its policies are in place. With row-level security enabled, a role\n * with no policy sees no row, so a grant that ran ahead of its policy would still read nothing; withholding it as well\n * means a failed policy step can never leave a principal on an unconfined table.\n *\n * Creating a policy and enabling row-level security need the table's ownership, which the platform's admin role holds\n * only as a superuser (a self-hosted PostgreSQL). Where it does not, the function skips that table, withholds its grant\n * and raises a WARNING; apps-manager reports the table as unconfined and ungranted.\n *\n * Policies are named {@link POSTGRES_OWED_ROW_POLICY_NAME_PREFIX} + a digest of the role, so the function finds and drops\n * the ones no record asks for any more, and a role is never left referenced by a policy it no longer holds (PostgreSQL\n * refuses to drop a role a policy names). A policy whose expression is unchanged is left alone: re-creating it would take\n * the table's ACCESS EXCLUSIVE lock on every boot.\n */\n\n/** One row per (principal role, schema, table, column, match kind, value) apps-manager derived for that principal. */\nexport const POSTGRES_OWED_ROW_POLICIES_TABLE = 'owed_row_policies';\n\n/** The name of the row-policy record's CHECK constraint on `match_kind`, re-created from {@link PostgresOwedRowMatch}. */\nexport const POSTGRES_OWED_ROW_POLICIES_MATCH_CHECK = 'owed_row_policies_match_check';\n\n/**\n * `wildo_access.owed_row_policy_expression(role, schema, table)`: the policy expression the record yields for one\n * principal's table. Called only inside {@link POSTGRES_APPLY_OWED_TABLE_GRANTS_FUNCTION}; EXECUTE is revoked from PUBLIC.\n */\nexport const POSTGRES_OWED_ROW_POLICY_EXPRESSION_FUNCTION = 'owed_row_policy_expression';\n\n/** Every policy the function creates starts with this, and only those are ever dropped by it. */\nexport const POSTGRES_OWED_ROW_POLICY_NAME_PREFIX = 'wildo_rp_';\n\n/**\n * How a recorded rule admits a row. Closed for the same reason {@link PostgresOwedTablePrivilege} is: the function maps\n * it through literals generated from this set into the policy expression, and the record's CHECK refuses anything else.\n */\nexport enum PostgresOwedRowMatch {\n /** The column equals the value. */\n EXACT = 'EXACT',\n /** The column starts with the value (`starts_with`, no LIKE pattern, so no character in the value is special). */\n PREFIX = 'PREFIX',\n}\n\n/** One rule of a row policy: rows whose column matches it are reachable. */\nexport interface PostgresOwedRowMatchRule {\n readonly kind: PostgresOwedRowMatch;\n readonly value: string;\n}\n\n/**\n * A table a principal reaches through a row policy: SELECT, INSERT, UPDATE and DELETE are granted, and every statement\n * but INSERT reaches only the rows whose `column` matches one of `rowsReachable`. An empty rule list is REFUSED: to\n * reach no row, grant nothing. The table is granted only through its policy, so it is removed from any plain axis that\n * also names it.\n */\nexport interface PostgresRowConfinedTableGrant {\n readonly table: string;\n readonly column: string;\n readonly rowsReachable: readonly PostgresOwedRowMatchRule[];\n}\n"]}
|
|
@@ -158,4 +158,18 @@ export declare function buildK8sApplicationRuntimeEndpoints(input: K8sApplicatio
|
|
|
158
158
|
* NOT localhost — the remote compose stack must not advertise localhost topology.
|
|
159
159
|
*/
|
|
160
160
|
export declare function buildComposeApplicationRuntimeEndpoints(input: ComposeApplicationRuntimeEndpointsInput): Record<string, RuntimeEndpointUrls>;
|
|
161
|
+
/** Loopback hostnames a host process advertises; inside a container each names the container itself. */
|
|
162
|
+
export declare const LOOPBACK_HOSTNAMES: ReadonlySet<string>;
|
|
163
|
+
/**
|
|
164
|
+
* An internal URL as a container sees it, when the URL may name a process on the HOST (#3382, #2303): a loopback host
|
|
165
|
+
* is re-pointed at the container's host gateway (`host.docker.internal` in compose), keeping scheme, port, path, query
|
|
166
|
+
* and fragment. Any other host is returned unchanged; so is every URL when `hostGatewayHostname` is undefined, the
|
|
167
|
+
* caller then running where loopback already means the host.
|
|
168
|
+
*
|
|
169
|
+
* The one derivation both of its callers run: the CLI handing a compose minion or worker its runtime endpoints, and
|
|
170
|
+
* the platform scheduler reaching an application backend that runs on the host. Rebuilt from the PARSED parts rather
|
|
171
|
+
* than by searching the string for the host, because `URL` normalizes the host (case, default port). A bare `/` path
|
|
172
|
+
* is dropped when the original had none, so `http://localhost:4241` becomes `http://host.docker.internal:4241`.
|
|
173
|
+
*/
|
|
174
|
+
export declare function toHostGatewayUrl(url: string, hostGatewayHostname: string | undefined): string;
|
|
161
175
|
//# sourceMappingURL=runtime-topology.contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-topology.contracts.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/runtime-topology.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AASxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAEjG,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AAExC,YAAY,EACV,gCAAgC,EAChC,6BAA6B,EAC7B,mBAAmB,GACpB,MAAM,gCAAgC,CAAC;AAExC,wBAAgB,sCAAsC,CACpD,IAAI,GAAE,MAAoB,GACzB,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAWrC;AAED,MAAM,WAAW,yCAAyC;IACxD,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACxC,wBAAwB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IAC9D,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACjC,0BAA0B,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChD,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC3B;AAED,wBAAgB,yCAAyC,CACvD,KAAK,EAAE,yCAAyC,GAC/C,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAuCrC;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,QAAQ,SAAS;IAAE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACnF,eAAe,EAAE,SAAS,QAAQ,EAAE,GACnC,QAAQ,GAAG,SAAS,CAEtB;AAED,oFAAoF;AACpF,MAAM,WAAW,2BAA2B;IAC1C,yDAAyD;IACzD,QAAQ,CAAC,GAAG,CAAC,E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K,EAAE,gCAAgC,GACtC,eAAe,EAAE,CA2CnB;AAED;;;;;GAKG;AACH,MAAM,WAAW,uCAAuC;IACtD,qEAAqE;IACrE,YAAY,EAAE,MAAM,CAAC;IACrB,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAAC;IACjD;;;;OAIG;IACH,SAAS,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACpD,sFAAsF;IACtF,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,gGAAgG;IAChG,gCAAgC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,mCAAoC,SAAQ,uCAAuC;IAClG,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uCAAwC,SAAQ,uCAAuC;IACtG;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AA+DD;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,mCAAmC,GACzC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAIrC;AAED;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,uCAAuC,GAC7C,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAErC"}
|
|
1
|
+
{"version":3,"file":"runtime-topology.contracts.d.ts","sourceRoot":"","sources":["../../../src/bootstrap/runtime-topology.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,mBAAmB,EACzB,MAAM,gCAAgC,CAAC;AASxC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sDAAsD,CA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S,EAAE,aAAa,CAAC,yBAAyB,CAAC,CAAC;IACpD,sFAAsF;IACtF,iBAAiB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACvC,gGAAgG;IAChG,gCAAgC,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtD,iEAAiE;IACjE,wBAAwB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9C,8FAA8F;IAC9F,kBAAkB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACzC;AAED,MAAM,WAAW,mCAAoC,SAAQ,uCAAuC;IAClG,sDAAsD;IACtD,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,uCAAwC,SAAQ,uCAAuC;IACtG;;;;OAIG;IACH,cAAc,EAAE,MAAM,CAAC;CACxB;AA+DD;;;;GAIG;AACH,wBAAgB,mCAAmC,CACjD,KAAK,EAAE,mCAAmC,GACzC,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAIrC;AAED;;;;;;;GAOG;AACH,wBAAgB,uCAAuC,CACrD,KAAK,EAAE,uCAAuC,GAC7C,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAErC;AAED,wGAAwG;AACxG,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAAuD,CAAC;AAE3G;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,mBAAmB,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAQ7F"}
|
|
@@ -213,4 +213,28 @@ export function buildK8sApplicationRuntimeEndpoints(input) {
|
|
|
213
213
|
export function buildComposeApplicationRuntimeEndpoints(input) {
|
|
214
214
|
return buildRemoteApplicationRuntimeEndpoints(input, (port) => `http://${input.appServiceName}:${port}`);
|
|
215
215
|
}
|
|
216
|
+
/** Loopback hostnames a host process advertises; inside a container each names the container itself. */
|
|
217
|
+
export const LOOPBACK_HOSTNAMES = new Set(['localhost', '127.0.0.1', '[::1]', '::1']);
|
|
218
|
+
/**
|
|
219
|
+
* An internal URL as a container sees it, when the URL may name a process on the HOST (#3382, #2303): a loopback host
|
|
220
|
+
* is re-pointed at the container's host gateway (`host.docker.internal` in compose), keeping scheme, port, path, query
|
|
221
|
+
* and fragment. Any other host is returned unchanged; so is every URL when `hostGatewayHostname` is undefined, the
|
|
222
|
+
* caller then running where loopback already means the host.
|
|
223
|
+
*
|
|
224
|
+
* The one derivation both of its callers run: the CLI handing a compose minion or worker its runtime endpoints, and
|
|
225
|
+
* the platform scheduler reaching an application backend that runs on the host. Rebuilt from the PARSED parts rather
|
|
226
|
+
* than by searching the string for the host, because `URL` normalizes the host (case, default port). A bare `/` path
|
|
227
|
+
* is dropped when the original had none, so `http://localhost:4241` becomes `http://host.docker.internal:4241`.
|
|
228
|
+
*/
|
|
229
|
+
export function toHostGatewayUrl(url, hostGatewayHostname) {
|
|
230
|
+
if (hostGatewayHostname === undefined)
|
|
231
|
+
return url;
|
|
232
|
+
const parsed = new URL(url);
|
|
233
|
+
if (!LOOPBACK_HOSTNAMES.has(parsed.hostname))
|
|
234
|
+
return url;
|
|
235
|
+
const hadPath = /^[a-z][a-z0-9+.-]*:\/\/[^/?#]*[/]/i.test(url);
|
|
236
|
+
const path = parsed.pathname === '/' && !hadPath ? '' : parsed.pathname;
|
|
237
|
+
const port = parsed.port === '' ? '' : `:${parsed.port}`;
|
|
238
|
+
return `${parsed.protocol}//${hostGatewayHostname}${port}${path}${parsed.search}${parsed.hash}`;
|
|
239
|
+
}
|
|
216
240
|
//# sourceMappingURL=runtime-topology.contracts.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime-topology.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-topology.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,GAE9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,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SAAS,CAAC,CACjE,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,uCAAuC,CACrD,KAA8C;IAE9C,OAAO,sCAAsC,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,KAAK,CAAC,cAAc,IAAI,IAAI,EAAE,CAAC,CAAC;AAC3G,CAAC","sourcesContent":["import {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n type RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\nimport {\n buildK8sInternalUrl,\n buildK8sPublicUrl,\n buildServicePublicHost,\n buildServicePublicUrl,\n} from '../project-config/shared/k8s-utils';\nimport { PLATFORM_DEFAULT_PORTS } from '../project-config/shared/infrastructure-defaults.schemas';\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\nimport type { AppServiceDefinition } from '../project-config/shared/service-definitions.schemas';\n\nexport {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n parseRuntimeEndpointsRecord,\n PlatformApplicationType,\n PlatformRuntimeEndpointKey,\n serializeRuntimeEndpointsRecord,\n} from '@wildo-ai/platform-core-shared';\n\nexport type {\n ApplicationRuntimeEndpointsInput,\n PlatformRuntimeEndpointsInput,\n RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\n\nexport function buildLocalhostPlatformRuntimeEndpoints(\n host: string = 'localhost',\n): Record<string, RuntimeEndpointUrls> {\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildPlatformRuntimeEndpoints({\n appsManager: buildUrl(PLATFORM_DEFAULT_PORTS.APPS_MANAGER),\n crontabsBatchesManager: buildUrl(PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER),\n moduleRegistry: buildUrl(PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY),\n });\n}\n\nexport interface LocalhostApplicationRuntimeEndpointsInput {\n mainBackendApiPort?: number | undefined;\n frontendApplicationPorts?: Record<string, number> | undefined;\n websitePort?: number | undefined;\n technicalDocumentationPort?: number | undefined;\n host?: string | undefined;\n}\n\nexport function buildLocalhostApplicationRuntimeEndpoints(\n input: LocalhostApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n const host = input.host ?? 'localhost';\n /**\n * Local endpoints are plain http, publicly and internally, and there is no knob.\n *\n * A configurable local scheme existed until 2026-08-14 and was removed: it applied ONE scheme to\n * EVERY endpoint's own port, which is only correct when a single ingress fronts them all. Local\n * Docker Compose has none, so declaring https made `main_backend_api.publicUrl` name a port that\n * held no certificate, and every browser session died on its WebSocket readiness poll.\n *\n * Remote is unaffected and always was: `buildServicePublicUrl` hardcodes `https://` because TLS\n * terminates at Traefik/nginx in front of one origin, where a single scheme IS true for every\n * endpoint. That is the only place the question has a well-defined answer, and it never consulted\n * this input.\n */\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications: input.frontendApplicationPorts\n ? Object.fromEntries(\n Object.entries(input.frontendApplicationPorts).map(([frontendServiceName, port]) => [\n frontendServiceName,\n buildUrl(port),\n ]),\n )\n : undefined,\n ...(input.websitePort ? { website: buildUrl(input.websitePort) } : {}),\n ...(input.technicalDocumentationPort\n ? { technicalDocumentation: buildUrl(input.technicalDocumentationPort) }\n : {}),\n ...(input.mainBackendApiPort\n ? {\n mainBackendApi: buildUrl(input.mainBackendApiPort),\n }\n : {}),\n });\n}\n\n/**\n * Which backend is an application's MAIN backend API — the one its browser-facing\n * surfaces call. The `backendApi` service key when declared, else the first backend\n * row. One rule, used by the CLI's endpoint and ingress derivation and by the public\n * website's local origins, so the three cannot name different backends.\n */\nexport function selectPrimaryBackendService<TService extends { readonly key: string }>(\n backendServices: readonly TService[],\n): TService | undefined {\n return backendServices.find((backend) => backend.key === 'backendApi') ?? backendServices[0];\n}\n\n/** The origins a locally-running application serves its app and its main API on. */\nexport interface LocalhostApplicationOrigins {\n /** The `SAAS_APP` frontend, when one declares a port. */\n readonly app?: string | undefined;\n /** The main backend API ({@link selectPrimaryBackendService}), when it declares a port. */\n readonly api?: string | undefined;\n}\n\n/**\n * The local-development origins of an application's product and API, derived from\n * the `defaultPort` each service already declares in `wildo.saas.config.ts` — the\n * same ports, host and plain-http scheme {@link buildLocalhostApplicationRuntimeEndpoints}\n * advertises, so a local surface that links into the product reaches the process\n * `wildo local dev` actually started.\n *\n * It exists for the public website, which is a separate origin from the product:\n * its CTAs and capture forms must reach `http://localhost:<appPort>` and\n * `http://localhost:<backendPort>` under `astro dev`. Before this, the API origin\n * was a port hardcoded into each site and the app origin had no local form at all,\n * so every \"Start free\" in local development pointed at a production-shaped host\n * that resolves to nothing.\n */\nexport function resolveLocalhostApplicationOrigins(\n services: Readonly<Record<string, Pick<AppServiceDefinition, 'defaultPort' | 'frontendType'>>>,\n host = 'localhost',\n): LocalhostApplicationOrigins {\n const rows = Object.entries(services).map(([key, service]) => ({ key, ...service }));\n const primaryBackend = selectPrimaryBackendService(rows.filter((row) => row.frontendType === undefined));\n const saasApp = rows.find((row) => row.frontendType === AppFrontendType.SAAS_APP);\n const originOf = (port: number | undefined): string | undefined => (port === undefined ? undefined : `http://${host}:${port}`);\n return { app: originOf(saasApp?.defaultPort), api: originOf(primaryBackend?.defaultPort) };\n}\n\nexport function buildK8sPlatformRuntimeEndpoints(input: {\n publicDomain: string;\n namespace: string;\n}): Record<string, RuntimeEndpointUrls> {\n return buildPlatformRuntimeEndpoints({\n appsManager: {\n publicUrl: buildK8sPublicUrl('platform-apps-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-apps-manager', PLATFORM_DEFAULT_PORTS.APPS_MANAGER, input.namespace),\n },\n crontabsBatchesManager: {\n publicUrl: buildK8sPublicUrl('platform-crontabs-batches-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-crontabs-batches-manager', PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER, input.namespace),\n },\n moduleRegistry: {\n publicUrl: buildK8sPublicUrl('platform-module-registry', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-module-registry', PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY, input.namespace),\n },\n });\n}\n\nexport interface K8sIngressRoute {\n /** Public hostname Traefik/ingress routes on (from the serviceHosts resolver). */\n host: string;\n /**\n * Per-service k8s Service NAME this host routes to. In the per-service deploy\n * model each service is its OWN Deployment+Service, so the route target is the\n * service's `serviceName` (e.g. `wonder-todos-backend-api`, `wonder-todos-app`)\n * — NOT one shared app Service. This is the value stamped into the ingress\n * rule's `backend.service.name`.\n */\n serviceName: string;\n /** Port on that per-service Service to route this host to. */\n port: number;\n}\n\n/**\n * One public frontend in the app's service topology. `serviceName` and\n * `serviceKey` are DECOUPLED on purpose:\n * - `serviceName` — the `runtime.endPoints` map key (the consumer contract:\n * `lookupFrontendPublicUrl` / X-Frontend-Service-Name key by serviceName).\n * - `serviceKey` — the `config.services.<key>`, which is the serviceHosts\n * authoring key. The public HOST resolves from THIS, never from serviceName.\n * Conflating them silently ignores authored `serviceHosts` (the serviceName\n * `wonder-todos-app` misses the authored `app` entry).\n */\nexport interface ApplicationPublicFrontend {\n serviceName: string;\n serviceKey: string;\n port: number;\n}\n\nexport interface K8sApplicationIngressRoutesInput {\n publicDomain: string;\n serviceHosts: Record<string, string> | undefined;\n /** Public frontends. Host resolves from `serviceKey` (config key); route target is the frontend's own `serviceName`. */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API per-service k8s Service name (the ingress route target). */\n mainBackendApiServiceName?: string | undefined;\n /** Backend API Service port. */\n mainBackendApiPort?: number | undefined;\n}\n\n/**\n * Ingress routes for the app's PUBLIC services (every frontend + the main\n * backend API), serviceHosts-driven. Every host resolves from the service's\n * `config.services.<key>` (`serviceKey`) — so GIVEN THE SAME frontends/keys,\n * the routes match the `runtime.endPoints.publicUrl` that\n * {@link buildK8sApplicationRuntimeEndpoints} produces (both key public hosts on\n * `serviceKey`). Coherence is a property of feeding both the SAME `serviceKey`s,\n * not automatic — see the divergence guards in the domain plan. Health, webhooks,\n * the OAuth provider and MCP are routes on the backend's own port, so they reach\n * the public host through the backend API route like any other path (#1783).\n */\nexport function buildK8sApplicationIngressRoutes(\n input: K8sApplicationIngressRoutesInput,\n): K8sIngressRoute[] {\n const host = (serviceKey: string): string =>\n buildServicePublicHost({ serviceKey, serviceHosts: input.serviceHosts, publicDomain: input.publicDomain });\n\n const entries: Array<{ serviceKey: string; serviceName: string; host: string; port: number }> =\n input.frontends.map((f) => ({\n serviceKey: f.serviceKey,\n serviceName: f.serviceName,\n host: host(f.serviceKey),\n port: f.port,\n }));\n if (\n input.mainBackendApiServiceKey !== undefined &&\n input.mainBackendApiServiceName !== undefined &&\n input.mainBackendApiPort !== undefined\n ) {\n entries.push({\n serviceKey: input.mainBackendApiServiceKey,\n serviceName: input.mainBackendApiServiceName,\n host: host(input.mainBackendApiServiceKey),\n port: input.mainBackendApiPort,\n });\n }\n\n // Fail-closed host-uniqueness guard: each public host routes entirely to ONE\n // service:port (no path-based sharing), so two distinct services resolving to\n // the same host — e.g. both authored to the apex (`''`), or an unauthored key\n // that collides with an authored subdomain — is an ambiguous, silently-broken\n // ingress. Reject it at build time with the colliding keys named, rather than\n // emitting a manifest whose routing is undefined.\n const claimedBy = new Map<string, string>();\n for (const entry of entries) {\n const existing = claimedBy.get(entry.host);\n if (existing !== undefined && existing !== entry.serviceKey) {\n throw new Error(\n `serviceHosts collision: services '${existing}' and '${entry.serviceKey}' both resolve to public host '${entry.host}'. ` +\n `Each service needs a distinct 'serviceHosts' subdomain (only one service may map to the apex '').`,\n );\n }\n claimedBy.set(entry.host, entry.serviceKey);\n }\n\n return entries.map(({ host: h, serviceName, port }) => ({ host: h, serviceName, port }));\n}\n\n/**\n * Fields shared by every REMOTE runtime-endpoints builder (k8s + compose). The\n * PUBLIC side (serviceHosts resolution) is runtime-agnostic; only the INTERNAL\n * URL form differs, injected via the `internalUrlFor` callback of the core\n * builder ({@link buildRemoteApplicationRuntimeEndpoints}).\n */\nexport interface RemoteApplicationRuntimeEndpointsCommon {\n /** Operator's public domain (`WildoInfraEnvConfig.publicDomain`). */\n publicDomain: string;\n /** Authored per-service subdomain map (`wildo.infra.<env>.config.ts`). */\n serviceHosts: Record<string, string> | undefined;\n /**\n * Public frontends. The `runtime.endPoints` map is keyed by each frontend's\n * `serviceName` (consumer contract); the public HOST resolves from its\n * `serviceKey` (config key / serviceHosts key). See {@link ApplicationPublicFrontend}.\n */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** `serviceKey` of the STATIC_WEBSITE frontend (feeds the fixed website endpoint). */\n websiteServiceKey?: string | undefined;\n /** `serviceKey` of the TECH_DOC frontend (feeds the fixed technical-documentation endpoint). */\n technicalDocumentationServiceKey?: string | undefined;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API container port — the one port the backend process binds (its internal URL). */\n mainBackendApiPort?: number | undefined;\n}\n\nexport interface K8sApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /** K8s namespace for cluster-internal service DNS. */\n namespace: string;\n /**\n * K8s Service name for cluster-internal URLs. Single Service per app (all\n * frontends + APIs ride it on different ports), so this is the app's own\n * service name (= its slug).\n */\n appServiceName: string;\n}\n\nexport interface ComposeApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /**\n * Compose service (container) name for internal URLs. Single container per\n * app serving all frontends + APIs on their ports, reachable by other\n * containers on the shared network as `http://<appServiceName>:<port>`.\n */\n appServiceName: string;\n}\n\n/**\n * Core REMOTE application runtime-endpoints assembly, shared by the k8s and\n * compose builders so their public-URL semantics never drift. PUBLIC URLs come\n * from {@link buildServicePublicUrl} (so ingress hosts, `runtime.endPoints.publicUrl`,\n * and CORS all agree — greenfield, no multi-tenant fan-out). INTERNAL URLs are\n * supplied by `internalUrlFor` (cluster-DNS for k8s, container DNS for compose).\n * The backend declares ONE endpoint: health, webhooks, the OAuth provider and MCP\n * are routes on its port, not sibling listeners (#1783).\n */\nfunction buildRemoteApplicationRuntimeEndpoints(\n input: RemoteApplicationRuntimeEndpointsCommon,\n internalUrlFor: (port: number) => string,\n): Record<string, RuntimeEndpointUrls> {\n const { publicDomain, serviceHosts } = input;\n const pub = (serviceKey: string): string =>\n buildServicePublicUrl({ serviceKey, serviceHosts, publicDomain });\n const internal = internalUrlFor;\n\n // Map key = serviceName (consumer contract: lookupFrontendPublicUrl keys by\n // serviceName); public host = serviceKey (serviceHosts key). Decoupled.\n const frontendApplications = input.frontends.length > 0\n ? Object.fromEntries(\n input.frontends.map((f) => [\n f.serviceName,\n { publicUrl: pub(f.serviceKey), internalUrl: internal(f.port) },\n ]),\n )\n : undefined;\n\n const websiteFrontend = input.websiteServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.websiteServiceKey)\n : undefined;\n const docsFrontend = input.technicalDocumentationServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.technicalDocumentationServiceKey)\n : undefined;\n const { mainBackendApiServiceKey, mainBackendApiPort } = input;\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications,\n ...(websiteFrontend\n ? { website: { publicUrl: pub(websiteFrontend.serviceKey), internalUrl: internal(websiteFrontend.port) } }\n : {}),\n ...(docsFrontend\n ? {\n technicalDocumentation: {\n publicUrl: pub(docsFrontend.serviceKey),\n internalUrl: internal(docsFrontend.port),\n },\n }\n : {}),\n ...(mainBackendApiServiceKey !== undefined && mainBackendApiPort !== undefined\n ? {\n mainBackendApi: {\n publicUrl: pub(mainBackendApiServiceKey),\n internalUrl: internal(mainBackendApiPort),\n },\n }\n : {}),\n });\n}\n\n/**\n * Build K8s application runtime endpoints — the self-hosted, single-app,\n * `serviceHosts`-driven counterpart to {@link buildLocalhostApplicationRuntimeEndpoints}.\n * INTERNAL URLs are the app's own cluster-DNS Service on each port.\n */\nexport function buildK8sApplicationRuntimeEndpoints(\n input: K8sApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) =>\n buildK8sInternalUrl(input.appServiceName, port, input.namespace),\n );\n}\n\n/**\n * Build Docker-Compose application runtime endpoints — the compose counterpart\n * of {@link buildK8sApplicationRuntimeEndpoints}. PUBLIC URLs are IDENTICAL\n * (serviceHosts-driven, so the Traefik ingress routes and `runtime.endPoints`\n * agree — the CORS invariant holds for compose too). INTERNAL URLs are the app\n * container's own name on the shared compose network (`http://<appServiceName>:<port>`),\n * NOT localhost — the remote compose stack must not advertise localhost topology.\n */\nexport function buildComposeApplicationRuntimeEndpoints(\n input: ComposeApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) => `http://${input.appServiceName}:${port}`);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"runtime-topology.contracts.js","sourceRoot":"","sources":["../../../src/bootstrap/runtime-topology.contracts.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gCAAgC,EAChC,6BAA6B,GAE9B,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,mBAAmB,EACnB,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAClG,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAGvE,OAAO,EACL,gCAAgC,EAChC,6BAA6B,EAC7B,2BAA2B,EAC3B,uBAAuB,EACvB,0BAA0B,EAC1B,+BAA+B,GAChC,MAAM,gCAAgC,CAAC;AAQxC,MAAM,UAAU,sCAAsC,CACpD,OAAe,WAAW;IAE1B,MAAM,QAAQ,GAAG,CAAC,IAAY,E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AAM,UAAU,gBAAgB,CAAC,GAAW,EAAE,mBAAuC;IACnF,IAAI,mBAAmB,KAAK,SAAS;QAAE,OAAO,GAAG,CAAC;IAClD,MAAM,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC;QAAE,OAAO,GAAG,CAAC;IACzD,MAAM,OAAO,GAAG,oCAAoC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC/D,MAAM,IAAI,GAAG,MAAM,CAAC,QAAQ,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC;IACxE,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;IACzD,OAAO,GAAG,MAAM,CAAC,QAAQ,KAAK,mBAAmB,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;AAClG,CAAC","sourcesContent":["import {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n type RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\nimport {\n buildK8sInternalUrl,\n buildK8sPublicUrl,\n buildServicePublicHost,\n buildServicePublicUrl,\n} from '../project-config/shared/k8s-utils';\nimport { PLATFORM_DEFAULT_PORTS } from '../project-config/shared/infrastructure-defaults.schemas';\nimport { AppFrontendType } from '@wildo-ai/saas-models/public-runtime';\nimport type { AppServiceDefinition } from '../project-config/shared/service-definitions.schemas';\n\nexport {\n buildApplicationRuntimeEndpoints,\n buildPlatformRuntimeEndpoints,\n parseRuntimeEndpointsRecord,\n PlatformApplicationType,\n PlatformRuntimeEndpointKey,\n serializeRuntimeEndpointsRecord,\n} from '@wildo-ai/platform-core-shared';\n\nexport type {\n ApplicationRuntimeEndpointsInput,\n PlatformRuntimeEndpointsInput,\n RuntimeEndpointUrls,\n} from '@wildo-ai/platform-core-shared';\n\nexport function buildLocalhostPlatformRuntimeEndpoints(\n host: string = 'localhost',\n): Record<string, RuntimeEndpointUrls> {\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildPlatformRuntimeEndpoints({\n appsManager: buildUrl(PLATFORM_DEFAULT_PORTS.APPS_MANAGER),\n crontabsBatchesManager: buildUrl(PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER),\n moduleRegistry: buildUrl(PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY),\n });\n}\n\nexport interface LocalhostApplicationRuntimeEndpointsInput {\n mainBackendApiPort?: number | undefined;\n frontendApplicationPorts?: Record<string, number> | undefined;\n websitePort?: number | undefined;\n technicalDocumentationPort?: number | undefined;\n host?: string | undefined;\n}\n\nexport function buildLocalhostApplicationRuntimeEndpoints(\n input: LocalhostApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n const host = input.host ?? 'localhost';\n /**\n * Local endpoints are plain http, publicly and internally, and there is no knob.\n *\n * A configurable local scheme existed until 2026-08-14 and was removed: it applied ONE scheme to\n * EVERY endpoint's own port, which is only correct when a single ingress fronts them all. Local\n * Docker Compose has none, so declaring https made `main_backend_api.publicUrl` name a port that\n * held no certificate, and every browser session died on its WebSocket readiness poll.\n *\n * Remote is unaffected and always was: `buildServicePublicUrl` hardcodes `https://` because TLS\n * terminates at Traefik/nginx in front of one origin, where a single scheme IS true for every\n * endpoint. That is the only place the question has a well-defined answer, and it never consulted\n * this input.\n */\n const buildUrl = (port: number): RuntimeEndpointUrls => ({\n publicUrl: `http://${host}:${port}`,\n internalUrl: `http://${host}:${port}`,\n });\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications: input.frontendApplicationPorts\n ? Object.fromEntries(\n Object.entries(input.frontendApplicationPorts).map(([frontendServiceName, port]) => [\n frontendServiceName,\n buildUrl(port),\n ]),\n )\n : undefined,\n ...(input.websitePort ? { website: buildUrl(input.websitePort) } : {}),\n ...(input.technicalDocumentationPort\n ? { technicalDocumentation: buildUrl(input.technicalDocumentationPort) }\n : {}),\n ...(input.mainBackendApiPort\n ? {\n mainBackendApi: buildUrl(input.mainBackendApiPort),\n }\n : {}),\n });\n}\n\n/**\n * Which backend is an application's MAIN backend API — the one its browser-facing\n * surfaces call. The `backendApi` service key when declared, else the first backend\n * row. One rule, used by the CLI's endpoint and ingress derivation and by the public\n * website's local origins, so the three cannot name different backends.\n */\nexport function selectPrimaryBackendService<TService extends { readonly key: string }>(\n backendServices: readonly TService[],\n): TService | undefined {\n return backendServices.find((backend) => backend.key === 'backendApi') ?? backendServices[0];\n}\n\n/** The origins a locally-running application serves its app and its main API on. */\nexport interface LocalhostApplicationOrigins {\n /** The `SAAS_APP` frontend, when one declares a port. */\n readonly app?: string | undefined;\n /** The main backend API ({@link selectPrimaryBackendService}), when it declares a port. */\n readonly api?: string | undefined;\n}\n\n/**\n * The local-development origins of an application's product and API, derived from\n * the `defaultPort` each service already declares in `wildo.saas.config.ts` — the\n * same ports, host and plain-http scheme {@link buildLocalhostApplicationRuntimeEndpoints}\n * advertises, so a local surface that links into the product reaches the process\n * `wildo local dev` actually started.\n *\n * It exists for the public website, which is a separate origin from the product:\n * its CTAs and capture forms must reach `http://localhost:<appPort>` and\n * `http://localhost:<backendPort>` under `astro dev`. Before this, the API origin\n * was a port hardcoded into each site and the app origin had no local form at all,\n * so every \"Start free\" in local development pointed at a production-shaped host\n * that resolves to nothing.\n */\nexport function resolveLocalhostApplicationOrigins(\n services: Readonly<Record<string, Pick<AppServiceDefinition, 'defaultPort' | 'frontendType'>>>,\n host = 'localhost',\n): LocalhostApplicationOrigins {\n const rows = Object.entries(services).map(([key, service]) => ({ key, ...service }));\n const primaryBackend = selectPrimaryBackendService(rows.filter((row) => row.frontendType === undefined));\n const saasApp = rows.find((row) => row.frontendType === AppFrontendType.SAAS_APP);\n const originOf = (port: number | undefined): string | undefined => (port === undefined ? undefined : `http://${host}:${port}`);\n return { app: originOf(saasApp?.defaultPort), api: originOf(primaryBackend?.defaultPort) };\n}\n\nexport function buildK8sPlatformRuntimeEndpoints(input: {\n publicDomain: string;\n namespace: string;\n}): Record<string, RuntimeEndpointUrls> {\n return buildPlatformRuntimeEndpoints({\n appsManager: {\n publicUrl: buildK8sPublicUrl('platform-apps-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-apps-manager', PLATFORM_DEFAULT_PORTS.APPS_MANAGER, input.namespace),\n },\n crontabsBatchesManager: {\n publicUrl: buildK8sPublicUrl('platform-crontabs-batches-manager', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-crontabs-batches-manager', PLATFORM_DEFAULT_PORTS.CRONTABS_BATCHES_MANAGER, input.namespace),\n },\n moduleRegistry: {\n publicUrl: buildK8sPublicUrl('platform-module-registry', input.publicDomain),\n internalUrl: buildK8sInternalUrl('platform-module-registry', PLATFORM_DEFAULT_PORTS.MODULE_REGISTRY, input.namespace),\n },\n });\n}\n\nexport interface K8sIngressRoute {\n /** Public hostname Traefik/ingress routes on (from the serviceHosts resolver). */\n host: string;\n /**\n * Per-service k8s Service NAME this host routes to. In the per-service deploy\n * model each service is its OWN Deployment+Service, so the route target is the\n * service's `serviceName` (e.g. `wonder-todos-backend-api`, `wonder-todos-app`)\n * — NOT one shared app Service. This is the value stamped into the ingress\n * rule's `backend.service.name`.\n */\n serviceName: string;\n /** Port on that per-service Service to route this host to. */\n port: number;\n}\n\n/**\n * One public frontend in the app's service topology. `serviceName` and\n * `serviceKey` are DECOUPLED on purpose:\n * - `serviceName` — the `runtime.endPoints` map key (the consumer contract:\n * `lookupFrontendPublicUrl` / X-Frontend-Service-Name key by serviceName).\n * - `serviceKey` — the `config.services.<key>`, which is the serviceHosts\n * authoring key. The public HOST resolves from THIS, never from serviceName.\n * Conflating them silently ignores authored `serviceHosts` (the serviceName\n * `wonder-todos-app` misses the authored `app` entry).\n */\nexport interface ApplicationPublicFrontend {\n serviceName: string;\n serviceKey: string;\n port: number;\n}\n\nexport interface K8sApplicationIngressRoutesInput {\n publicDomain: string;\n serviceHosts: Record<string, string> | undefined;\n /** Public frontends. Host resolves from `serviceKey` (config key); route target is the frontend's own `serviceName`. */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API per-service k8s Service name (the ingress route target). */\n mainBackendApiServiceName?: string | undefined;\n /** Backend API Service port. */\n mainBackendApiPort?: number | undefined;\n}\n\n/**\n * Ingress routes for the app's PUBLIC services (every frontend + the main\n * backend API), serviceHosts-driven. Every host resolves from the service's\n * `config.services.<key>` (`serviceKey`) — so GIVEN THE SAME frontends/keys,\n * the routes match the `runtime.endPoints.publicUrl` that\n * {@link buildK8sApplicationRuntimeEndpoints} produces (both key public hosts on\n * `serviceKey`). Coherence is a property of feeding both the SAME `serviceKey`s,\n * not automatic — see the divergence guards in the domain plan. Health, webhooks,\n * the OAuth provider and MCP are routes on the backend's own port, so they reach\n * the public host through the backend API route like any other path (#1783).\n */\nexport function buildK8sApplicationIngressRoutes(\n input: K8sApplicationIngressRoutesInput,\n): K8sIngressRoute[] {\n const host = (serviceKey: string): string =>\n buildServicePublicHost({ serviceKey, serviceHosts: input.serviceHosts, publicDomain: input.publicDomain });\n\n const entries: Array<{ serviceKey: string; serviceName: string; host: string; port: number }> =\n input.frontends.map((f) => ({\n serviceKey: f.serviceKey,\n serviceName: f.serviceName,\n host: host(f.serviceKey),\n port: f.port,\n }));\n if (\n input.mainBackendApiServiceKey !== undefined &&\n input.mainBackendApiServiceName !== undefined &&\n input.mainBackendApiPort !== undefined\n ) {\n entries.push({\n serviceKey: input.mainBackendApiServiceKey,\n serviceName: input.mainBackendApiServiceName,\n host: host(input.mainBackendApiServiceKey),\n port: input.mainBackendApiPort,\n });\n }\n\n // Fail-closed host-uniqueness guard: each public host routes entirely to ONE\n // service:port (no path-based sharing), so two distinct services resolving to\n // the same host — e.g. both authored to the apex (`''`), or an unauthored key\n // that collides with an authored subdomain — is an ambiguous, silently-broken\n // ingress. Reject it at build time with the colliding keys named, rather than\n // emitting a manifest whose routing is undefined.\n const claimedBy = new Map<string, string>();\n for (const entry of entries) {\n const existing = claimedBy.get(entry.host);\n if (existing !== undefined && existing !== entry.serviceKey) {\n throw new Error(\n `serviceHosts collision: services '${existing}' and '${entry.serviceKey}' both resolve to public host '${entry.host}'. ` +\n `Each service needs a distinct 'serviceHosts' subdomain (only one service may map to the apex '').`,\n );\n }\n claimedBy.set(entry.host, entry.serviceKey);\n }\n\n return entries.map(({ host: h, serviceName, port }) => ({ host: h, serviceName, port }));\n}\n\n/**\n * Fields shared by every REMOTE runtime-endpoints builder (k8s + compose). The\n * PUBLIC side (serviceHosts resolution) is runtime-agnostic; only the INTERNAL\n * URL form differs, injected via the `internalUrlFor` callback of the core\n * builder ({@link buildRemoteApplicationRuntimeEndpoints}).\n */\nexport interface RemoteApplicationRuntimeEndpointsCommon {\n /** Operator's public domain (`WildoInfraEnvConfig.publicDomain`). */\n publicDomain: string;\n /** Authored per-service subdomain map (`wildo.infra.<env>.config.ts`). */\n serviceHosts: Record<string, string> | undefined;\n /**\n * Public frontends. The `runtime.endPoints` map is keyed by each frontend's\n * `serviceName` (consumer contract); the public HOST resolves from its\n * `serviceKey` (config key / serviceHosts key). See {@link ApplicationPublicFrontend}.\n */\n frontends: ReadonlyArray<ApplicationPublicFrontend>;\n /** `serviceKey` of the STATIC_WEBSITE frontend (feeds the fixed website endpoint). */\n websiteServiceKey?: string | undefined;\n /** `serviceKey` of the TECH_DOC frontend (feeds the fixed technical-documentation endpoint). */\n technicalDocumentationServiceKey?: string | undefined;\n /** Backend API `config.services.<key>` (host resolution key). */\n mainBackendApiServiceKey?: string | undefined;\n /** Backend API container port — the one port the backend process binds (its internal URL). */\n mainBackendApiPort?: number | undefined;\n}\n\nexport interface K8sApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /** K8s namespace for cluster-internal service DNS. */\n namespace: string;\n /**\n * K8s Service name for cluster-internal URLs. Single Service per app (all\n * frontends + APIs ride it on different ports), so this is the app's own\n * service name (= its slug).\n */\n appServiceName: string;\n}\n\nexport interface ComposeApplicationRuntimeEndpointsInput extends RemoteApplicationRuntimeEndpointsCommon {\n /**\n * Compose service (container) name for internal URLs. Single container per\n * app serving all frontends + APIs on their ports, reachable by other\n * containers on the shared network as `http://<appServiceName>:<port>`.\n */\n appServiceName: string;\n}\n\n/**\n * Core REMOTE application runtime-endpoints assembly, shared by the k8s and\n * compose builders so their public-URL semantics never drift. PUBLIC URLs come\n * from {@link buildServicePublicUrl} (so ingress hosts, `runtime.endPoints.publicUrl`,\n * and CORS all agree — greenfield, no multi-tenant fan-out). INTERNAL URLs are\n * supplied by `internalUrlFor` (cluster-DNS for k8s, container DNS for compose).\n * The backend declares ONE endpoint: health, webhooks, the OAuth provider and MCP\n * are routes on its port, not sibling listeners (#1783).\n */\nfunction buildRemoteApplicationRuntimeEndpoints(\n input: RemoteApplicationRuntimeEndpointsCommon,\n internalUrlFor: (port: number) => string,\n): Record<string, RuntimeEndpointUrls> {\n const { publicDomain, serviceHosts } = input;\n const pub = (serviceKey: string): string =>\n buildServicePublicUrl({ serviceKey, serviceHosts, publicDomain });\n const internal = internalUrlFor;\n\n // Map key = serviceName (consumer contract: lookupFrontendPublicUrl keys by\n // serviceName); public host = serviceKey (serviceHosts key). Decoupled.\n const frontendApplications = input.frontends.length > 0\n ? Object.fromEntries(\n input.frontends.map((f) => [\n f.serviceName,\n { publicUrl: pub(f.serviceKey), internalUrl: internal(f.port) },\n ]),\n )\n : undefined;\n\n const websiteFrontend = input.websiteServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.websiteServiceKey)\n : undefined;\n const docsFrontend = input.technicalDocumentationServiceKey\n ? input.frontends.find((f) => f.serviceKey === input.technicalDocumentationServiceKey)\n : undefined;\n const { mainBackendApiServiceKey, mainBackendApiPort } = input;\n\n return buildApplicationRuntimeEndpoints({\n frontendApplications,\n ...(websiteFrontend\n ? { website: { publicUrl: pub(websiteFrontend.serviceKey), internalUrl: internal(websiteFrontend.port) } }\n : {}),\n ...(docsFrontend\n ? {\n technicalDocumentation: {\n publicUrl: pub(docsFrontend.serviceKey),\n internalUrl: internal(docsFrontend.port),\n },\n }\n : {}),\n ...(mainBackendApiServiceKey !== undefined && mainBackendApiPort !== undefined\n ? {\n mainBackendApi: {\n publicUrl: pub(mainBackendApiServiceKey),\n internalUrl: internal(mainBackendApiPort),\n },\n }\n : {}),\n });\n}\n\n/**\n * Build K8s application runtime endpoints — the self-hosted, single-app,\n * `serviceHosts`-driven counterpart to {@link buildLocalhostApplicationRuntimeEndpoints}.\n * INTERNAL URLs are the app's own cluster-DNS Service on each port.\n */\nexport function buildK8sApplicationRuntimeEndpoints(\n input: K8sApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) =>\n buildK8sInternalUrl(input.appServiceName, port, input.namespace),\n );\n}\n\n/**\n * Build Docker-Compose application runtime endpoints — the compose counterpart\n * of {@link buildK8sApplicationRuntimeEndpoints}. PUBLIC URLs are IDENTICAL\n * (serviceHosts-driven, so the Traefik ingress routes and `runtime.endPoints`\n * agree — the CORS invariant holds for compose too). INTERNAL URLs are the app\n * container's own name on the shared compose network (`http://<appServiceName>:<port>`),\n * NOT localhost — the remote compose stack must not advertise localhost topology.\n */\nexport function buildComposeApplicationRuntimeEndpoints(\n input: ComposeApplicationRuntimeEndpointsInput,\n): Record<string, RuntimeEndpointUrls> {\n return buildRemoteApplicationRuntimeEndpoints(input, (port) => `http://${input.appServiceName}:${port}`);\n}\n\n/** Loopback hostnames a host process advertises; inside a container each names the container itself. */\nexport const LOOPBACK_HOSTNAMES: ReadonlySet<string> = new Set(['localhost', '127.0.0.1', '[::1]', '::1']);\n\n/**\n * An internal URL as a container sees it, when the URL may name a process on the HOST (#3382, #2303): a loopback host\n * is re-pointed at the container's host gateway (`host.docker.internal` in compose), keeping scheme, port, path, query\n * and fragment. Any other host is returned unchanged; so is every URL when `hostGatewayHostname` is undefined, the\n * caller then running where loopback already means the host.\n *\n * The one derivation both of its callers run: the CLI handing a compose minion or worker its runtime endpoints, and\n * the platform scheduler reaching an application backend that runs on the host. Rebuilt from the PARSED parts rather\n * than by searching the string for the host, because `URL` normalizes the host (case, default port). A bare `/` path\n * is dropped when the original had none, so `http://localhost:4241` becomes `http://host.docker.internal:4241`.\n */\nexport function toHostGatewayUrl(url: string, hostGatewayHostname: string | undefined): string {\n if (hostGatewayHostname === undefined) return url;\n const parsed = new URL(url);\n if (!LOOPBACK_HOSTNAMES.has(parsed.hostname)) return url;\n const hadPath = /^[a-z][a-z0-9+.-]*:\\/\\/[^/?#]*[/]/i.test(url);\n const path = parsed.pathname === '/' && !hadPath ? '' : parsed.pathname;\n const port = parsed.port === '' ? '' : `:${parsed.port}`;\n return `${parsed.protocol}//${hostGatewayHostname}${port}${path}${parsed.search}${parsed.hash}`;\n}\n"]}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from './bootstrap/runtime-secret-env.contracts';
|
|
|
18
18
|
export * from './bootstrap/runtime-topology.contracts';
|
|
19
19
|
export * from './bootstrap/runtime-principal.contracts';
|
|
20
20
|
export * from './bootstrap/postgresql-owed-grants.contracts';
|
|
21
|
+
export * from './bootstrap/minion-database-queue-confinement.contracts';
|
|
21
22
|
export * from './bootstrap/runtime-response-integrity';
|
|
22
23
|
export * from './key-management/es256-jws';
|
|
23
24
|
export * from './key-management/data-key.contracts';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,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CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export * from './bootstrap/runtime-secret-env.contracts.js';
|
|
|
18
18
|
export * from './bootstrap/runtime-topology.contracts.js';
|
|
19
19
|
export * from './bootstrap/runtime-principal.contracts.js';
|
|
20
20
|
export * from './bootstrap/postgresql-owed-grants.contracts.js';
|
|
21
|
+
export * from './bootstrap/minion-database-queue-confinement.contracts.js';
|
|
21
22
|
export * from './bootstrap/runtime-response-integrity.js';
|
|
22
23
|
export * from './key-management/es256-jws.js';
|
|
23
24
|
export * from './key-management/data-key.contracts.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4CAA4C,CAAC;AAE3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './project-config';\nexport * from './workspace-scope';\nexport * from './credentials/credential-generator.service';\n\nexport * from './schemas/platform-application-config.schemas';\nexport * from './schemas/platform-application-secrets.schemas';\nexport * from './schemas/platform-config.schemas';\nexport * from './schemas/framework-info.schemas';\nexport * from './schemas/framework-secrets.schemas';\nexport * from './release/framework-release.constants';\nexport * from './bootstrap/bootstrap.schemas';\nexport * from './bootstrap/bootstrap.contracts';\nexport * from './bootstrap/bootstrap-planner';\nexport * from './bootstrap/application-backend-env.contracts';\nexport * from './bootstrap/wildo-owner-organization.contracts';\nexport * from './bootstrap/application-creation-verification-env.contracts';\nexport * from './bootstrap/platform-runtime-env.contracts';\nexport * from './bootstrap/runtime-secret-env.contracts';\nexport * from './bootstrap/runtime-topology.contracts';\nexport * from './bootstrap/runtime-principal.contracts';\nexport * from './bootstrap/postgresql-owed-grants.contracts';\nexport * from './bootstrap/runtime-response-integrity';\nexport * from './key-management/es256-jws';\nexport * from './key-management/data-key.contracts';\nexport * from './key-management/key-provider.spi';\nexport * from './key-management/application-signing-key-rotation.contracts';\nexport * from './key-management/application-legacy-envelope-key.contracts';\nexport * from './key-management/keyring-rotation.contracts';\nexport * from './key-management/keyring-status.contracts';\nexport * from './key-management/signature-request.contracts';\nexport * from './key-management/approval-seal.contracts';\nexport * from './key-management/approval-seal-verifier';\nexport * from './key-management/approval-seal-manifested-copy';\nexport * from './key-management/signing-log-export.contracts';\nexport * from './key-management/vault-custody.contracts';\nexport * from './bootstrap/runtime-backing-service-access';\nexport * from './bootstrap/platform-store-preconnect';\nexport * from './bootstrap/runtime-network-topology';\nexport * from './bootstrap/runtime-network-policy';\nexport * from './bootstrap/runtime-platform-access';\nexport * from './project-config/minion-local-provider-registration';\nexport * from './project-config/shared/minion-resource-access.validation';\nexport * from './project-config/shared/object-storage-session-policy';\nexport * from './lockfile/wildo-saas-lock.shared.schemas';\nexport * from './lockfile/lockfile-io';\nexport * from './lockfile/file-lock-hold';\nexport * from './lockfile/build-parallelism';\nexport * from './lockfile/materialize-infra-section';\nexport * from './lockfile/canonical-json';\nexport * from './canonical-json/rfc8785-canonical-json';\nexport * from './registry';\nexport * from './pnpm-settings/application-pnpm-settings';\nexport * from './blueprint/blueprint.schemas';\nexport * from './blueprint/anchored-region';\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,4CAA4C,CAAC;AAE3D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,qCAAqC,CAAC;AACpD,cAAc,uCAAuC,CAAC;AACtD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+CAA+C,CAAC;AAC9D,cAAc,gDAAgD,CAAC;AAC/D,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4CAA4C,CAAC;AAC3D,cAAc,0CAA0C,CAAC;AACzD,cAAc,wCAAwC,CAAC;AACvD,cAAc,yCAAyC,CAAC;AACxD,cAAc,8CAA8C,CAAC;AAC7D,cAAc,yDAAyD,CAAC;AACxE,cAAc,wCAAwC,CAAC;AACvD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qCAAqC,CAAC;AACpD,cAAc,mCAAmC,CAAC;AAClD,cAAc,6DAA6D,CAAC;AAC5E,cAAc,4DAA4D,CAAC;AAC3E,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2CAA2C,CAAC;AAC1D,cAAc,8CAA8C,CAAC;AAC7D,cAAc,0CAA0C,CAAC;AACzD,cAAc,yCAAyC,CAAC;AACxD,cAAc,gDAAgD,CAAC;AAC/D,cAAc,+CAA+C,CAAC;AAC9D,cAAc,0CAA0C,CAAC;AACzD,cAAc,4CAA4C,CAAC;AAC3D,cAAc,uCAAuC,CAAC;AACtD,cAAc,sCAAsC,CAAC;AACrD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC;AACpD,cAAc,qDAAqD,CAAC;AACpE,cAAc,2DAA2D,CAAC;AAC1E,cAAc,uDAAuD,CAAC;AACtE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,sCAAsC,CAAC;AACrD,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yCAAyC,CAAC;AACxD,cAAc,YAAY,CAAC;AAC3B,cAAc,2CAA2C,CAAC;AAC1D,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC","sourcesContent":["export * from './project-config';\nexport * from './workspace-scope';\nexport * from './credentials/credential-generator.service';\n\nexport * from './schemas/platform-application-config.schemas';\nexport * from './schemas/platform-application-secrets.schemas';\nexport * from './schemas/platform-config.schemas';\nexport * from './schemas/framework-info.schemas';\nexport * from './schemas/framework-secrets.schemas';\nexport * from './release/framework-release.constants';\nexport * from './bootstrap/bootstrap.schemas';\nexport * from './bootstrap/bootstrap.contracts';\nexport * from './bootstrap/bootstrap-planner';\nexport * from './bootstrap/application-backend-env.contracts';\nexport * from './bootstrap/wildo-owner-organization.contracts';\nexport * from './bootstrap/application-creation-verification-env.contracts';\nexport * from './bootstrap/platform-runtime-env.contracts';\nexport * from './bootstrap/runtime-secret-env.contracts';\nexport * from './bootstrap/runtime-topology.contracts';\nexport * from './bootstrap/runtime-principal.contracts';\nexport * from './bootstrap/postgresql-owed-grants.contracts';\nexport * from './bootstrap/minion-database-queue-confinement.contracts';\nexport * from './bootstrap/runtime-response-integrity';\nexport * from './key-management/es256-jws';\nexport * from './key-management/data-key.contracts';\nexport * from './key-management/key-provider.spi';\nexport * from './key-management/application-signing-key-rotation.contracts';\nexport * from './key-management/application-legacy-envelope-key.contracts';\nexport * from './key-management/keyring-rotation.contracts';\nexport * from './key-management/keyring-status.contracts';\nexport * from './key-management/signature-request.contracts';\nexport * from './key-management/approval-seal.contracts';\nexport * from './key-management/approval-seal-verifier';\nexport * from './key-management/approval-seal-manifested-copy';\nexport * from './key-management/signing-log-export.contracts';\nexport * from './key-management/vault-custody.contracts';\nexport * from './bootstrap/runtime-backing-service-access';\nexport * from './bootstrap/platform-store-preconnect';\nexport * from './bootstrap/runtime-network-topology';\nexport * from './bootstrap/runtime-network-policy';\nexport * from './bootstrap/runtime-platform-access';\nexport * from './project-config/minion-local-provider-registration';\nexport * from './project-config/shared/minion-resource-access.validation';\nexport * from './project-config/shared/object-storage-session-policy';\nexport * from './lockfile/wildo-saas-lock.shared.schemas';\nexport * from './lockfile/lockfile-io';\nexport * from './lockfile/file-lock-hold';\nexport * from './lockfile/build-parallelism';\nexport * from './lockfile/materialize-infra-section';\nexport * from './lockfile/canonical-json';\nexport * from './canonical-json/rfc8785-canonical-json';\nexport * from './registry';\nexport * from './pnpm-settings/application-pnpm-settings';\nexport * from './blueprint/blueprint.schemas';\nexport * from './blueprint/anchored-region';\n"]}
|