@package-broker/runtime-node 2.0.0-rc.3 → 2.0.0-rc.4
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/.tsbuildinfo +1 -1
- package/dist/blob/filesystem.d.ts.map +1 -1
- package/dist/blob/filesystem.js +128 -3
- package/dist/blob/filesystem.js.map +1 -1
- package/dist/blob/s3.d.ts.map +1 -1
- package/dist/blob/s3.js +146 -6
- package/dist/blob/s3.js.map +1 -1
- package/dist/client-ip.d.ts +2 -0
- package/dist/client-ip.d.ts.map +1 -1
- package/dist/client-ip.js +6 -0
- package/dist/client-ip.js.map +1 -1
- package/dist/entry.d.ts +1 -0
- package/dist/entry.d.ts.map +1 -1
- package/dist/entry.js +2 -1
- package/dist/entry.js.map +1 -1
- package/dist/import-jobs.d.ts +1 -1
- package/dist/import-jobs.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +245 -17
- package/dist/index.js.map +1 -1
- package/dist/jobs/loop.d.ts +1 -1
- package/dist/jobs/loop.d.ts.map +1 -1
- package/dist/jobs/loop.js +7 -1
- package/dist/jobs/loop.js.map +1 -1
- package/dist/notifications/transport.d.ts +19 -0
- package/dist/notifications/transport.d.ts.map +1 -0
- package/dist/notifications/transport.js +60 -0
- package/dist/notifications/transport.js.map +1 -0
- package/dist/sources/git-provider.d.ts.map +1 -1
- package/dist/sources/git-provider.js +2 -0
- package/dist/sources/git-provider.js.map +1 -1
- package/dist/sources/guarded-fetch.d.ts +2 -0
- package/dist/sources/guarded-fetch.d.ts.map +1 -1
- package/dist/sources/guarded-fetch.js +9 -1
- package/dist/sources/guarded-fetch.js.map +1 -1
- package/dist/startup.d.ts +2 -1
- package/dist/startup.d.ts.map +1 -1
- package/dist/startup.js +42 -7
- package/dist/startup.js.map +1 -1
- package/dist/token-jobs.d.ts +2 -2
- package/dist/token-jobs.d.ts.map +1 -1
- package/dist/token-jobs.js +12 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I,KAC/B,IAAI,CAAC;IACV,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,EAAE,QAAQ,EAAE,MAAM,IAAI,KAAK,IAAI,CAAC;CACjF;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEpD;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAOzD;AAWD,wBAAgB,cAAc,CAC5B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC1B,IAAI,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAC5B,IAAI,SAAI,EACR,OAAO,GAAE;IACP,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACvC,GACL,MAAM,IAAI,CA8BZ;AAED,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,OAAO,CAAC,aAAa,CAAC,EAChC,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,EACjD,OAAO,EAAE,YAAY,GACpB,OAAO,CAAC,IAAI,CAAC,CA+Df;AA2BD,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAOjF"}
|
package/dist/entry.js
CHANGED
|
@@ -64,7 +64,7 @@ export async function runEntry(manifest, env, runtime) {
|
|
|
64
64
|
let port;
|
|
65
65
|
let timeoutMs;
|
|
66
66
|
try {
|
|
67
|
-
const { plugins, migrations, platformPorts, observability, registry, tokens, vulnerability, mcp, } = await manifest;
|
|
67
|
+
const { plugins, migrations, platformPorts, observability, registry, tokens, vulnerability, mcp, notifications, } = await manifest;
|
|
68
68
|
try {
|
|
69
69
|
port = parsePort(env['PORT']);
|
|
70
70
|
timeoutMs = parseShutdownTimeout(env['PB_SHUTDOWN_TIMEOUT_MS']);
|
|
@@ -85,6 +85,7 @@ export async function runEntry(manifest, env, runtime) {
|
|
|
85
85
|
...(tokens === undefined ? {} : { tokens }),
|
|
86
86
|
...(vulnerability === undefined ? {} : { vulnerability }),
|
|
87
87
|
...(mcp === undefined ? {} : { mcp }),
|
|
88
|
+
...(notifications === undefined ? {} : { notifications }),
|
|
88
89
|
});
|
|
89
90
|
}
|
|
90
91
|
catch (error) {
|
package/dist/entry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAIxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAqB,MAAM,cAAc,CAAC;AAEhF,MAAM,YAAY,GAAG,IAAI,CAAC;AAC1B,MAAM,2BAA2B,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../src/entry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,6CAA6C,CAAC;AAIxF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAE7E,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAqB,MAAM,c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AAE;QACpE,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAClC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC;QAC1C,QAAQ,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC;QAC5D,cAAc,EAAE,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,CAAC;KACjE,CAAC,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;QAC1B,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/import-jobs.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { ImportApplyStore } from '@package-broker/core/import/apply';
|
|
|
2
2
|
import type { ImportRollbackStore } from '@package-broker/core/import/rollback';
|
|
3
3
|
import type { ImportVerificationStore } from '@package-broker/core/import/verification';
|
|
4
4
|
import type { RegisteredCoreJob } from '@package-broker/core/kernel/registry';
|
|
5
|
-
import type { BlobStore } from '@package-broker/core/platform/blob';
|
|
5
|
+
import type { CoreBlobStore as BlobStore } from '@package-broker/core/platform/blob';
|
|
6
6
|
export interface ImportJobStores {
|
|
7
7
|
readonly verificationStore: ImportVerificationStore;
|
|
8
8
|
readonly applyStore: ImportApplyStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"import-jobs.d.ts","sourceRoot":"","sources":["../src/import-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAM1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"import-jobs.d.ts","sourceRoot":"","sources":["../src/import-jobs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAM1E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAChF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AAExF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,KAAK,EAAE,aAAa,IAAI,SAAS,EAAE,MAAM,oCAAoC,CAAC;AAIrF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,iBAAiB,EAAE,uBAAuB,CAAC;IACpD,QAAQ,CAAC,UAAU,EAAE,gBAAgB,CAAC;IACtC,QAAQ,CAAC,aAAa,EAAE,mBAAmB,CAAC;IAC5C,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;CACxC;AAED,MAAM,WAAW,eAAe;IAC9B,GAAG,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAAC;IACnC,GAAG,IAAI,eAAe,CAAC;CACxB;AAED,wBAAgB,qBAAqB,IAAI,eAAe,CAYvD;AASD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,GAAG,SAAS,iBAAiB,EAAE,CAyC5F"}
|
package/dist/index.d.ts
CHANGED
|
@@ -51,6 +51,8 @@ export interface NodeServerOptions {
|
|
|
51
51
|
readonly tokens?: BrokerConfig['tokens'];
|
|
52
52
|
readonly vulnerability?: BrokerConfig['vulnerability'];
|
|
53
53
|
readonly mcp?: BrokerConfig['mcp'];
|
|
54
|
+
/** Outbound publish notifications; off unless `enabled` is exactly true. */
|
|
55
|
+
readonly notifications?: BrokerConfig['notifications'];
|
|
54
56
|
/** Resolves true once the broker may serve; a falsy answer refuses everything except liveness. */
|
|
55
57
|
readonly servingGate?: () => Promise<boolean>;
|
|
56
58
|
/** Registry routes need the database, auth, platform services and this input together. */
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAqBnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qCAAqC,CAAC;AAsCxE,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAItD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,wCAAwC,CAAC;AACnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mDAAmD,CAAC;AAC/F,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AACjF,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,sDAAsD,CAAC;AACpG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAC5F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yCAAyC,CAAC;AAElF,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EAEhB,MAAM,mCAAmC,CAAC;A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package-broker/db-sqlite/repositories/npm-unpublish';
|
|
3
|
+
import { createDistTagStore } from '@package-broker/db-sqlite/repositories/npm-dist-tags';
|
|
4
|
+
import { createDeprecationStore } from '@package-broker/db-sqlite/repositories/npm-deprecate';
|
|
5
|
+
import { createWorkloadTokenService } from '@package-broker/core/authz/service-token-service';
|
|
6
|
+
import { createWorkloadTokenStore } from '@package-broker/db-sqlite/repositories/workload-token';
|
|
7
|
+
import { createOidcRepository } from '@package-broker/db-sqlite/repositories/oidc';
|
|
8
|
+
import { createAccessRepository } from '@package-broker/db-sqlite/repositories/access';
|
|
9
|
+
import { checkPublishAdmission, createPublishReads, createPublishWriteGuard, } from '@package-broker/db-sqlite/repositories/catalogue-publish-guard';
|
|
10
|
+
import { createPublishScanJob, createPublishScanSweepJob, } from '@package-broker/core/ingest/publish-scan-job';
|
|
11
|
+
import { createNpmVcsBuildOutcomes, createNpmVcsBuildReader, createNpmVcsBuildPendingReader, } from '@package-broker/db-sqlite/repositories/npm-vcs-build';
|
|
12
|
+
import { createCatalogueWriteGuard } from '@package-broker/db-sqlite/repositories/catalogue-write-package';
|
|
13
|
+
import { createPublishApprovalExpireJob } from '@package-broker/core/ingest/publish-approval-expire-job';
|
|
14
|
+
import { createPublishesRepository } from '@package-broker/db-sqlite/repositories/publishes';
|
|
15
|
+
import { createPackageAccessExpiryJob } from '@package-broker/core/api/routes/package-access-requests-expiry';
|
|
16
|
+
import { REGISTRY_POLICY_JOB_EVENTS, registryPolicyJobs, } from '@package-broker/core/runtime/policy-jobs';
|
|
17
|
+
import { createRegistryPolicyExpiry } from '@package-broker/db-sqlite/repositories/registry-policy-expiry';
|
|
18
|
+
import { createRegistryPolicyReader } from '@package-broker/db-sqlite/repositories/registry-policy-read';
|
|
19
|
+
import { createPolicyReadAuditSink } from '@package-broker/db-sqlite/repositories/registry-policy-read-audit';
|
|
20
|
+
import { registryPolicySchemaReady } from '@package-broker/db-sqlite/repositories/registry-policy-schema';
|
|
21
|
+
import { createPackageAccessRequestRepository } from '@package-broker/db-sqlite/repositories/package-access-requests';
|
|
22
|
+
import { createUserRepository } from '@package-broker/db-sqlite/repositories/user';
|
|
23
|
+
import { createServicePrincipalRepository } from '@package-broker/db-sqlite/repositories/service-principal';
|
|
1
24
|
import { schemaMigrationsMatch } from '@package-broker/db-sqlite/migrations/runner';
|
|
2
|
-
import { createApiRoutes } from '@package-broker/db-sqlite/repositories/api-services';
|
|
25
|
+
import { createApiRoutes, notificationRoutesAvailable, } from '@package-broker/db-sqlite/repositories/api-services';
|
|
3
26
|
import { createComposerRepositoryProvider } from '@package-broker/core/ingest/composer/composer-repository';
|
|
4
27
|
import { createMcpTools } from '@package-broker/core/mcp/tools';
|
|
5
28
|
import { createInProcessMcpLimiter } from '@package-broker/core/mcp/limit';
|
|
@@ -34,20 +57,21 @@ import { createAuditSealRepository } from '@package-broker/db-sqlite/repositorie
|
|
|
34
57
|
import { createAuditVerifyReader } from '@package-broker/db-sqlite/repositories/audit-verify';
|
|
35
58
|
import { createServer } from 'node:http';
|
|
36
59
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
60
|
+
import { parseLocalAuthPolicy } from '@package-broker/core/auth/module';
|
|
37
61
|
import { getRequestListener } from '@hono/node-server';
|
|
38
62
|
import { deferredDispatch } from '@package-broker/core/authz/token-use';
|
|
39
63
|
import { createPackageAccess, } from '@package-broker/core/catalogue/package-access';
|
|
40
64
|
import { createVisibilityService, } from '@package-broker/core/catalogue/visibility-service';
|
|
41
65
|
import { buildClosureReport, } from '@package-broker/core/catalogue/closure-report';
|
|
42
66
|
import {} from '@package-broker/core/authz/administration';
|
|
43
|
-
import { createRegistryModule, } from '@package-broker/core/registry/module';
|
|
67
|
+
import { createRegistryModule, createNpmHandleOf, } from '@package-broker/core/registry/module';
|
|
44
68
|
import { createAccessRecorder } from '@package-broker/core/registry/access-recorder';
|
|
45
69
|
import { createScopedAdmittingAccess } from '@package-broker/core/registry/scoped-access';
|
|
46
70
|
import { GITHUB_API } from '@package-broker/core/ingest/composer/packagist-proxy';
|
|
47
71
|
import { INGEST_EVENTS, INGEST_REASON_CODES } from '@package-broker/core/ingest/finalize-guard';
|
|
48
72
|
import { createRepositoryJobs } from '@package-broker/core/platform/jobs-port';
|
|
49
73
|
import { resolveTokenLifetimePolicy, TokenConfigError, } from '@package-broker/core/authz/token-lifetime';
|
|
50
|
-
import { createPatJobHolder,
|
|
74
|
+
import { createPatJobHolder, tokenJobRegistrations, tokenWiring, } from './token-jobs.js';
|
|
51
75
|
import { SEAMS_KEY } from './internal/seams-key.js';
|
|
52
76
|
import { PlatformUnavailableError } from '@package-broker/core/platform/errors';
|
|
53
77
|
import { createPolicyFetch } from '@package-broker/core/sources/policy-fetch';
|
|
@@ -63,7 +87,7 @@ import { createKernel } from '@package-broker/core/kernel/kernel';
|
|
|
63
87
|
import { createSetupUiRoutes, createUiRoutes, rewriteSetupRequest, } from '@package-broker/core/kernel/ui-routes';
|
|
64
88
|
import { fileURLToPath } from 'node:url';
|
|
65
89
|
import { createNodeAssets } from './assets.js';
|
|
66
|
-
import { nodeClientIp } from './client-ip.js';
|
|
90
|
+
import { nodeAdmissionIp, nodeClientIp } from './client-ip.js';
|
|
67
91
|
import { nodeCodecs } from './codec/node-codec.js';
|
|
68
92
|
import { reportedVcsProviders } from '@package-broker/core/sources/config';
|
|
69
93
|
import { createDnsGuard } from './sources/dns-guard.js';
|
|
@@ -75,6 +99,12 @@ import { createOrgResolver } from '@package-broker/core/kernel/org';
|
|
|
75
99
|
import { collectRegistrations, KernelConfigError } from '@package-broker/core/kernel/registry';
|
|
76
100
|
import { mcpEnabled } from '@package-broker/core/config';
|
|
77
101
|
import { registerCoreJob } from '@package-broker/core/runtime/core-jobs';
|
|
102
|
+
import { NotificationRuntimeConfigError, notificationRuntime, notificationsSwitch, } from '@package-broker/core/runtime/notification-jobs';
|
|
103
|
+
import { createNotificationAttemptRepository } from '@package-broker/db-sqlite/repositories/notification-attempt';
|
|
104
|
+
import { createNotificationDispatchRepository } from '@package-broker/db-sqlite/repositories/notification-dispatch';
|
|
105
|
+
import { createNotificationPrepareRepository } from '@package-broker/db-sqlite/repositories/notification-prepare';
|
|
106
|
+
import { createNotificationRetentionRepository } from '@package-broker/db-sqlite/repositories/notification-retention';
|
|
107
|
+
import { createNodeNotificationTransport } from './notifications/transport.js';
|
|
78
108
|
import { KeyringMismatchError, KeyringPasswordHashUnreadableError, KeyringStoreUnavailableError, KeyringVerifierMissingError, KeyringVersionInUseError, RESEED_VARIABLE, verifyKeyring, } from '@package-broker/core/secrets/keyring-verifier';
|
|
79
109
|
import { createKeyringVerifierStore } from '@package-broker/db-sqlite/repositories/keyring-verifier';
|
|
80
110
|
import { createBlobAccessRepository } from '@package-broker/db-sqlite/repositories/blob-access';
|
|
@@ -127,6 +157,11 @@ function retentionRegistrations(executor, storage) {
|
|
|
127
157
|
const removal = createBlobLifecycle({
|
|
128
158
|
metadata,
|
|
129
159
|
store: {
|
|
160
|
+
putStaged: (...args) => store.putStaged(...args),
|
|
161
|
+
openStaged: (...args) => store.openStaged(...args),
|
|
162
|
+
promote: (...args) => store.promote(...args),
|
|
163
|
+
discardStaged: (...args) => store.discardStaged(...args),
|
|
164
|
+
listStaged: (...args) => store.listStaged(...args),
|
|
130
165
|
putVerified: (...args) => store.putVerified(...args),
|
|
131
166
|
head: (...args) => store.head(...args),
|
|
132
167
|
get: (...args) => store.get(...args),
|
|
@@ -157,7 +192,18 @@ function retentionRegistrations(executor, storage) {
|
|
|
157
192
|
};
|
|
158
193
|
const bound = definition.name === retentionScanJob.name
|
|
159
194
|
? createRetentionScanJob({ reader: createBlobReferenceReader(guarded), lifecycle })
|
|
160
|
-
: createBlobPurgeJob({
|
|
195
|
+
: createBlobPurgeJob({
|
|
196
|
+
lifecycle,
|
|
197
|
+
staged: {
|
|
198
|
+
listStaged: (...args) => store.listStaged(...args),
|
|
199
|
+
async discardStaged(handle) {
|
|
200
|
+
checkSignal();
|
|
201
|
+
await executor.batch(guard);
|
|
202
|
+
checkSignal();
|
|
203
|
+
await store.discardStaged(handle);
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
});
|
|
161
207
|
await bound.handler(payload, context);
|
|
162
208
|
},
|
|
163
209
|
}));
|
|
@@ -169,7 +215,8 @@ function rejectingExecutor() {
|
|
|
169
215
|
const unavailable = () => Promise.reject(new Error('no SQL executor configured for this runtime'));
|
|
170
216
|
return { driver: 'node-sqlite', all: unavailable, batch: unavailable };
|
|
171
217
|
}
|
|
172
|
-
async function assembleAccess(registration, plugins, auth, executor, log, tokens, clientIp) {
|
|
218
|
+
async function assembleAccess(registration, plugins, auth, executor, log, tokens, clientIp, admissionIp) {
|
|
219
|
+
const localAuth = parseLocalAuthPolicy(auth.env['PB_AUTH_LOCAL']);
|
|
173
220
|
await auth.keyring.hmacKey('token-pepper', auth.keyring.currentVersion);
|
|
174
221
|
const providers = buildIdentityProviders(registration, plugins, {
|
|
175
222
|
fetch: (request) => fetch(request),
|
|
@@ -181,6 +228,7 @@ async function assembleAccess(registration, plugins, auth, executor, log, tokens
|
|
|
181
228
|
keyring: auth.keyring,
|
|
182
229
|
publicOrigin: auth.publicOrigin,
|
|
183
230
|
providers,
|
|
231
|
+
localAuth,
|
|
184
232
|
clock: systemClock,
|
|
185
233
|
ids: { ulid },
|
|
186
234
|
log,
|
|
@@ -189,7 +237,7 @@ async function assembleAccess(registration, plugins, auth, executor, log, tokens
|
|
|
189
237
|
registration,
|
|
190
238
|
tokens,
|
|
191
239
|
});
|
|
192
|
-
return built;
|
|
240
|
+
return { ...built, npmLogin: { ...built.npmLogin, admissionIp } };
|
|
193
241
|
}
|
|
194
242
|
function buildPackageReads(executor) {
|
|
195
243
|
const reader = createCatalogueReader(executor);
|
|
@@ -406,7 +454,7 @@ function assembleRegistry(input) {
|
|
|
406
454
|
seams.observeCredentials?.(credentials);
|
|
407
455
|
const sources = createSourceRepository(executor);
|
|
408
456
|
const reads = createRegistryReads(executor);
|
|
409
|
-
const writer = createCatalogueWriter(executor);
|
|
457
|
+
const writer = createCatalogueWriter(executor, { notifications: input.notifications });
|
|
410
458
|
const sessions = createIngestSessions(executor);
|
|
411
459
|
const blobAccess = createBlobAccessRepository(executor);
|
|
412
460
|
const inFlight = new Set();
|
|
@@ -425,6 +473,7 @@ function assembleRegistry(input) {
|
|
|
425
473
|
return jobsFactory('core', unattended);
|
|
426
474
|
};
|
|
427
475
|
const jobs = seams.jobs ?? {
|
|
476
|
+
enqueueStatements: (...args) => coreJobs().enqueueStatements(...args),
|
|
428
477
|
enqueue: (ctx, type, payload, enqueueInput) => coreJobs().enqueue(ctx, type, payload, enqueueInput),
|
|
429
478
|
get: (ctx, id) => coreJobs().get(ctx, id),
|
|
430
479
|
};
|
|
@@ -463,6 +512,41 @@ function assembleRegistry(input) {
|
|
|
463
512
|
const policyFetch = (userAgent, context) => createPolicyFetch({ fetchImpl: outboundFetch, policy, userAgent, observability, ...context });
|
|
464
513
|
const module = createRegistryModule({
|
|
465
514
|
runtime: 'node',
|
|
515
|
+
policy: {
|
|
516
|
+
reader: createRegistryPolicyReader(executor),
|
|
517
|
+
audit: createPolicyReadAuditSink(executor),
|
|
518
|
+
hooks: input.policyHooks,
|
|
519
|
+
ids: { ulid },
|
|
520
|
+
},
|
|
521
|
+
npmOidc: {
|
|
522
|
+
clientIp: input.admissionIp,
|
|
523
|
+
repository: createOidcRepository(executor),
|
|
524
|
+
tokens: createWorkloadTokenService({
|
|
525
|
+
tokens: createWorkloadTokenStore(executor),
|
|
526
|
+
keyring: auth.keyring,
|
|
527
|
+
clock: systemClock,
|
|
528
|
+
ids: { ulid },
|
|
529
|
+
}),
|
|
530
|
+
organization: async () => {
|
|
531
|
+
const org = await input.findOrganization();
|
|
532
|
+
return org === null ? null : orgContext(org.id);
|
|
533
|
+
},
|
|
534
|
+
},
|
|
535
|
+
npmTokens: createNpmTokenAdapters(executor, (ctx) => input.anchors.anchors(ctx)),
|
|
536
|
+
npmPublish: {
|
|
537
|
+
deprecations: createDeprecationStore(executor, { notifications: input.notifications }),
|
|
538
|
+
distTags: createDistTagStore(executor, { notifications: input.notifications }),
|
|
539
|
+
unpublish: createUnpublishStore(executor, { notifications: input.notifications }),
|
|
540
|
+
reads: createPublishReads(executor),
|
|
541
|
+
lookupToken: createAccessRepository(executor).lookupToken,
|
|
542
|
+
anchors: (ctx) => input.anchors.anchors(ctx),
|
|
543
|
+
writeGuard: createPublishWriteGuard,
|
|
544
|
+
admitted: (ctx, guard) => checkPublishAdmission(executor, ctx, guard),
|
|
545
|
+
writer,
|
|
546
|
+
requiredScanners: input.requiredScanners,
|
|
547
|
+
scanJobs: jobs,
|
|
548
|
+
},
|
|
549
|
+
handleOf: createNpmHandleOf(createUserRepository(executor), createServicePrincipalRepository(executor)),
|
|
466
550
|
registryJobs: registryJobDependencies({
|
|
467
551
|
executor,
|
|
468
552
|
providers: providerRegistry,
|
|
@@ -496,6 +580,10 @@ function assembleRegistry(input) {
|
|
|
496
580
|
policyFetch,
|
|
497
581
|
deploymentId: input.deploymentId,
|
|
498
582
|
providers,
|
|
583
|
+
npmAudit: {
|
|
584
|
+
sources,
|
|
585
|
+
provenance: createVulnerabilityRepository(executor, systemClock),
|
|
586
|
+
},
|
|
499
587
|
catalogue: {
|
|
500
588
|
reader: input.reader,
|
|
501
589
|
scopedAdmission: createScopedAdmission(executor),
|
|
@@ -521,6 +609,12 @@ function assembleRegistry(input) {
|
|
|
521
609
|
credential: credentials.forSource,
|
|
522
610
|
credentialUnavailable: (ctx, id) => sources.markCredentialUnavailable(ctx, id),
|
|
523
611
|
},
|
|
612
|
+
npmVcsBuild: {
|
|
613
|
+
outcomes: createNpmVcsBuildOutcomes(executor),
|
|
614
|
+
target: createNpmVcsBuildReader(executor),
|
|
615
|
+
pending: createNpmVcsBuildPendingReader(executor),
|
|
616
|
+
writeGuard: createCatalogueWriteGuard,
|
|
617
|
+
},
|
|
524
618
|
sync: {
|
|
525
619
|
packageId: createPackageIdReads(executor).packageId,
|
|
526
620
|
upstreamState: createUpstreamStateRepository(executor),
|
|
@@ -608,13 +702,13 @@ function assembleRegistry(input) {
|
|
|
608
702
|
},
|
|
609
703
|
};
|
|
610
704
|
}
|
|
611
|
-
function buildCatalogue(executor, reads, anchors, log) {
|
|
705
|
+
function buildCatalogue(executor, reads, anchors, log, notifications) {
|
|
612
706
|
return Object.freeze({
|
|
613
707
|
reader: reads.reader,
|
|
614
|
-
writer: createCatalogueWriter(executor),
|
|
708
|
+
writer: createCatalogueWriter(executor, { notifications }),
|
|
615
709
|
packageAccess: reads.packageAccess,
|
|
616
710
|
visibility: createVisibilityService({
|
|
617
|
-
store: createVisibilityStore(executor, { providerAnchors: anchors }),
|
|
711
|
+
store: createVisibilityStore(executor, { providerAnchors: anchors, notifications }),
|
|
618
712
|
log,
|
|
619
713
|
}),
|
|
620
714
|
closureReport: (actor, organizationPermissions, ecosystem) => buildClosureReport(reads.reader, actor, organizationPermissions, ecosystem, systemClock),
|
|
@@ -636,8 +730,25 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
636
730
|
const log = options.log ?? defaultLog;
|
|
637
731
|
const executor = options.executor ?? rejectingExecutor();
|
|
638
732
|
const lifetime = resolveTokenLifetime(options.tokens);
|
|
733
|
+
let notificationsOn;
|
|
734
|
+
try {
|
|
735
|
+
notificationsOn = notificationsSwitch(options.notifications);
|
|
736
|
+
}
|
|
737
|
+
catch (error) {
|
|
738
|
+
if (error instanceof NotificationRuntimeConfigError)
|
|
739
|
+
throw new KernelConfigError([...error.problems]);
|
|
740
|
+
throw error;
|
|
741
|
+
}
|
|
742
|
+
const captureNotifications = notificationsOn;
|
|
743
|
+
if (notificationsOn &&
|
|
744
|
+
(options.executor === undefined ||
|
|
745
|
+
options.platformServices === undefined ||
|
|
746
|
+
options.auth === undefined))
|
|
747
|
+
throw new KernelConfigError(['notifications: delivery is unavailable on this runtime']);
|
|
748
|
+
let notificationJobs;
|
|
639
749
|
const remoteAddress = new AsyncLocalStorage();
|
|
640
750
|
const clientIp = (request) => nodeClientIp(request, remoteAddress.getStore() ?? null, options.trustedProxy);
|
|
751
|
+
const admissionIp = (request) => nodeAdmissionIp(request, remoteAddress.getStore() ?? null, options.trustedProxy);
|
|
641
752
|
const repository = createOrganizationRepository(executor);
|
|
642
753
|
const bootstrap = createOrganizationBootstrap(executor);
|
|
643
754
|
const ports = Object.freeze({
|
|
@@ -645,7 +756,9 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
645
756
|
clock: systemClock,
|
|
646
757
|
ids: { ulid },
|
|
647
758
|
});
|
|
648
|
-
const
|
|
759
|
+
const auth = options.auth === undefined
|
|
760
|
+
? undefined
|
|
761
|
+
: { ...options.auth, env: Object.freeze({ ...options.auth.env }) };
|
|
649
762
|
const importJobs = createImportJobHolder();
|
|
650
763
|
const patJobs = createPatJobHolder();
|
|
651
764
|
let drainRegistry;
|
|
@@ -672,6 +785,8 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
672
785
|
};
|
|
673
786
|
const verifyOnce = () => (keyringVerification ??= verify());
|
|
674
787
|
const application = (async () => {
|
|
788
|
+
const notificationRoutes = options.executor !== undefined &&
|
|
789
|
+
(await notificationRoutesAvailable(executor, notificationsOn, log));
|
|
675
790
|
// A closed migration gate defers verification until the broker may serve.
|
|
676
791
|
if (options.servingGate === undefined || (await options.servingGate()))
|
|
677
792
|
await verifyOnce();
|
|
@@ -723,6 +838,20 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
723
838
|
});
|
|
724
839
|
}
|
|
725
840
|
const reads = options.executor === undefined ? undefined : buildPackageReads(executor);
|
|
841
|
+
let policyHooks = [];
|
|
842
|
+
const policyEnabled = options.registry?.config.policy.enabled === true;
|
|
843
|
+
// With the flag off a failed probe only leaves management unmounted; boot stays as before.
|
|
844
|
+
const policySchema = options.executor !== undefined &&
|
|
845
|
+
(await registryPolicySchemaReady(executor).catch((error) => {
|
|
846
|
+
if (policyEnabled)
|
|
847
|
+
throw error;
|
|
848
|
+
return false;
|
|
849
|
+
}));
|
|
850
|
+
if (options.executor !== undefined && policyEnabled && !policySchema) {
|
|
851
|
+
throw new KernelConfigError([
|
|
852
|
+
'registry.policy.enabled: the registry policy migration is missing',
|
|
853
|
+
]);
|
|
854
|
+
}
|
|
726
855
|
const deploymentId = options.observability?.deploymentId ?? 'unconfigured';
|
|
727
856
|
const registry = options.registry === undefined ||
|
|
728
857
|
reads === undefined ||
|
|
@@ -743,7 +872,14 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
743
872
|
}),
|
|
744
873
|
deploymentId,
|
|
745
874
|
findOrganization: bootstrap.findSingleton,
|
|
875
|
+
admissionIp,
|
|
746
876
|
ingestScope,
|
|
877
|
+
anchors: {
|
|
878
|
+
anchors: (ctx) => access?.providerAnchors.anchors(ctx) ?? Promise.resolve([]),
|
|
879
|
+
},
|
|
880
|
+
requiredScanners: () => plugins.flatMap((plugin) => (plugin.publishPolicy ? [plugin.publishPolicy.id] : [])),
|
|
881
|
+
policyHooks: () => policyHooks,
|
|
882
|
+
notifications: captureNotifications,
|
|
747
883
|
});
|
|
748
884
|
const vulnerabilityPolicy = createOutboundPolicy({
|
|
749
885
|
allowPrivateHosts: [],
|
|
@@ -767,6 +903,41 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
767
903
|
drainRegistry = registry?.drain;
|
|
768
904
|
const packageResolver = registry?.module.visibilityPort ?? reads?.resolver;
|
|
769
905
|
const retention = options.platformServices?.retention;
|
|
906
|
+
const notifications = auth === undefined || options.platformServices === undefined
|
|
907
|
+
? { enabled: false, jobs: [] }
|
|
908
|
+
: notificationRuntime({
|
|
909
|
+
notifications: options.notifications,
|
|
910
|
+
transport: createNodeNotificationTransport({
|
|
911
|
+
selfOrigins: options.registry?.config.outbound.selfOrigins ?? [auth.publicOrigin],
|
|
912
|
+
...(seams.resolver === undefined ? {} : { resolver: seams.resolver }),
|
|
913
|
+
...(seams.notificationConnector === undefined
|
|
914
|
+
? {}
|
|
915
|
+
: { connector: seams.notificationConnector }),
|
|
916
|
+
}),
|
|
917
|
+
repositories: () => ({
|
|
918
|
+
dispatch: createNotificationDispatchRepository(executor),
|
|
919
|
+
attempts: createNotificationAttemptRepository(executor),
|
|
920
|
+
prepare: createNotificationPrepareRepository(executor),
|
|
921
|
+
retention: createNotificationRetentionRepository(executor),
|
|
922
|
+
}),
|
|
923
|
+
credentials: () => {
|
|
924
|
+
const repository = createCredentialRepository(executor);
|
|
925
|
+
return {
|
|
926
|
+
repository,
|
|
927
|
+
store: createCredentialStore({
|
|
928
|
+
repository,
|
|
929
|
+
cipher: createSecretCipher(auth.keyring, 'credential-encryption'),
|
|
930
|
+
ids: { ulid },
|
|
931
|
+
clock: systemClock,
|
|
932
|
+
}),
|
|
933
|
+
};
|
|
934
|
+
},
|
|
935
|
+
clock: systemClock,
|
|
936
|
+
ids: { ulid },
|
|
937
|
+
wake: async (ctx, id) => notificationJobs?.notify?.(ctx, id),
|
|
938
|
+
});
|
|
939
|
+
if (notifications.enabled !== notificationsOn)
|
|
940
|
+
throw new KernelConfigError(['notifications: delivery is unavailable on this runtime']);
|
|
770
941
|
const registration = collectRegistrations(plugins, {
|
|
771
942
|
...(registry === undefined ? {} : { sourceProviderContext: registry.sourceProviderContext }),
|
|
772
943
|
...(packageResolver === undefined ? {} : { packageResolver }),
|
|
@@ -779,6 +950,31 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
779
950
|
routeTemplates: new Set(),
|
|
780
951
|
})),
|
|
781
952
|
...(retention === undefined ? [] : retentionRegistrations(executor, () => retention)),
|
|
953
|
+
registerIngestJob(createPublishScanJob({
|
|
954
|
+
publishes: createPublishesRepository(executor, [], {
|
|
955
|
+
notifications: captureNotifications,
|
|
956
|
+
}),
|
|
957
|
+
scanners: plugins.flatMap((plugin) => plugin.publishPolicy ? [plugin.publishPolicy] : []),
|
|
958
|
+
blob: options.platformServices.blob,
|
|
959
|
+
})),
|
|
960
|
+
registerIngestJob(createPublishScanSweepJob({
|
|
961
|
+
publishes: createPublishesRepository(executor, [], {
|
|
962
|
+
notifications: captureNotifications,
|
|
963
|
+
}),
|
|
964
|
+
})),
|
|
965
|
+
registerIngestJob(createPublishApprovalExpireJob({
|
|
966
|
+
publishes: createPublishesRepository(executor, [], {
|
|
967
|
+
notifications: captureNotifications,
|
|
968
|
+
}),
|
|
969
|
+
})),
|
|
970
|
+
registerIngestJob(createPackageAccessExpiryJob(createPackageAccessRequestRepository(executor, []))),
|
|
971
|
+
...(options.registry === undefined
|
|
972
|
+
? []
|
|
973
|
+
: registryPolicyJobs(options.registry.config, () => createRegistryPolicyExpiry(executor)).map((job) => registerIngestJob(job, {
|
|
974
|
+
events: new Set([...INGEST_EVENTS, ...REGISTRY_POLICY_JOB_EVENTS]),
|
|
975
|
+
reasonCodes: INGEST_REASON_CODES,
|
|
976
|
+
routeTemplates: new Set(),
|
|
977
|
+
}))),
|
|
782
978
|
registerAuditJob(auditSealJob(createAuditSealRepository(executor))),
|
|
783
979
|
registerAuditJob(auditVerifyJob(createAuditVerifyReader(executor))),
|
|
784
980
|
...(registry?.module.coreJobs ?? []).map((job) => registerIngestJob(job.definition)),
|
|
@@ -786,9 +982,11 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
786
982
|
? []
|
|
787
983
|
: [registerIngestJob(registry.module.packageSyncJob)]),
|
|
788
984
|
...(auth === undefined ? [] : importJobRegistrations(importJobs)),
|
|
789
|
-
...(auth === undefined ? [] :
|
|
985
|
+
...(auth === undefined ? [] : tokenJobRegistrations(executor, patJobs, log)),
|
|
986
|
+
...notifications.jobs,
|
|
790
987
|
],
|
|
791
988
|
});
|
|
989
|
+
policyHooks = registration.hooks['registry.read'];
|
|
792
990
|
if (registry !== undefined && options.platformServices !== undefined) {
|
|
793
991
|
await registry.bindSourceProviders(registration.sourceProviders.values());
|
|
794
992
|
registry.bindJobs(createRepositoryJobs({
|
|
@@ -798,6 +996,14 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
798
996
|
ids: { ulid },
|
|
799
997
|
}));
|
|
800
998
|
}
|
|
999
|
+
if (notifications.enabled && options.platformServices !== undefined) {
|
|
1000
|
+
notificationJobs = createRepositoryJobs({
|
|
1001
|
+
store: options.platformServices.jobStore,
|
|
1002
|
+
jobs: registration.jobs,
|
|
1003
|
+
clock: systemClock,
|
|
1004
|
+
ids: { ulid },
|
|
1005
|
+
})('core', { projectId: null, tokenId: null });
|
|
1006
|
+
}
|
|
801
1007
|
if (auth !== undefined && options.platformServices !== undefined) {
|
|
802
1008
|
patJobs.set(createRepositoryJobs({
|
|
803
1009
|
store: options.platformServices.jobStore,
|
|
@@ -808,7 +1014,7 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
808
1014
|
}
|
|
809
1015
|
const access = auth === undefined
|
|
810
1016
|
? undefined
|
|
811
|
-
: await assembleAccess(registration, plugins, auth, executor, log, tokenWiring(lifetime, patJobs, options.platformServices !== undefined), clientIp);
|
|
1017
|
+
: await assembleAccess(registration, plugins, auth, executor, log, tokenWiring(lifetime, patJobs, options.platformServices !== undefined), clientIp, admissionIp);
|
|
812
1018
|
if (access !== undefined && options.platformServices !== undefined) {
|
|
813
1019
|
importJobs.set({
|
|
814
1020
|
verificationStore: createImportVerificationStore({
|
|
@@ -822,10 +1028,25 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
822
1028
|
}
|
|
823
1029
|
const packages = access === undefined || reads === undefined
|
|
824
1030
|
? null
|
|
825
|
-
: buildCatalogue(executor, reads, access.anchors, log);
|
|
1031
|
+
: buildCatalogue(executor, reads, access.anchors, log, captureNotifications);
|
|
826
1032
|
const apiRoutes = auth === undefined || access === undefined || packages === null
|
|
827
1033
|
? []
|
|
828
1034
|
: createApiRoutes({
|
|
1035
|
+
discoveryFetch: createPolicyFetch({
|
|
1036
|
+
fetchImpl: registry?.services.outboundFetch ??
|
|
1037
|
+
seams.transport ??
|
|
1038
|
+
createGuardedFetch(vulnerabilityPolicy),
|
|
1039
|
+
policy: vulnerabilityPolicy,
|
|
1040
|
+
userAgent: 'PackageBroker/2.0',
|
|
1041
|
+
}),
|
|
1042
|
+
notifications: captureNotifications,
|
|
1043
|
+
notificationRoutes,
|
|
1044
|
+
notificationSelfOrigins: options.registry?.config.outbound.selfOrigins ?? [
|
|
1045
|
+
auth.publicOrigin,
|
|
1046
|
+
],
|
|
1047
|
+
...(registry?.module.lookupTrustedPublisherRepository === undefined
|
|
1048
|
+
? {}
|
|
1049
|
+
: { trustedPublisherLookup: registry?.module.lookupTrustedPublisherRepository }),
|
|
829
1050
|
clientIp,
|
|
830
1051
|
executor,
|
|
831
1052
|
runtime: 'node',
|
|
@@ -846,6 +1067,10 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
846
1067
|
blob: options.platformServices?.blob,
|
|
847
1068
|
vcsProviders: () => registry?.vcsProviders() ?? [],
|
|
848
1069
|
refuseVcsProvider: (provider) => provider === 'git' && !(registry?.vcsProviders() ?? []).includes('git'),
|
|
1070
|
+
registryPolicy: {
|
|
1071
|
+
...(policySchema ? { management: true } : {}),
|
|
1072
|
+
...(registry?.module.policy === undefined ? {} : { serving: registry.module.policy }),
|
|
1073
|
+
},
|
|
849
1074
|
});
|
|
850
1075
|
const authorization = options.authorization ?? access?.module.authorization;
|
|
851
1076
|
const assets = await createNodeAssets(fileURLToPath(new URL('./assets/', import.meta.url))).catch((error) => {
|
|
@@ -864,7 +1089,7 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
864
1089
|
}, { publicOrigin: auth?.publicOrigin ?? 'http://localhost', log });
|
|
865
1090
|
const coreRoutes = [
|
|
866
1091
|
...(access?.module.coreRoutes ?? []),
|
|
867
|
-
...apiRoutes,
|
|
1092
|
+
...apiRoutes.filter((route) => route.path.startsWith('/_pb/')),
|
|
868
1093
|
openApiRoute(openApiDocument),
|
|
869
1094
|
...(registry?.module.coreRoutes ?? []).map((route) => ({
|
|
870
1095
|
...route,
|
|
@@ -892,7 +1117,10 @@ export function createNodeServer(plugins, options = {}) {
|
|
|
892
1117
|
const kernel = await createKernel({
|
|
893
1118
|
platform: 'node',
|
|
894
1119
|
...(packageResolver === undefined ? {} : { packageResolver }),
|
|
895
|
-
|
|
1120
|
+
ecosystemRoutes: [
|
|
1121
|
+
...(registry?.module.ecosystemRoutes ?? []),
|
|
1122
|
+
...apiRoutes.filter((route) => !route.path.startsWith('/_pb/')),
|
|
1123
|
+
],
|
|
896
1124
|
plugins,
|
|
897
1125
|
publicOrigin: auth?.publicOrigin,
|
|
898
1126
|
registration,
|