@crombolo/server 0.56.0 → 0.58.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +16 -13
- package/src/adapters/bundles.ts +72 -6
- package/src/adapters/health.ts +30 -1
- package/src/bundle-admin.ts +246 -23
- package/src/bundle-api.ts +299 -0
- package/src/bundle-build.ts +4 -3
- package/src/bundle-grants.ts +133 -18
- package/src/bundle-install.ts +153 -21
- package/src/bundle-sections.ts +19 -0
- package/src/bundles.ts +87 -7
- package/src/component-templates-api.ts +27 -6
- package/src/components.ts +7 -0
- package/src/config.ts +36 -3
- package/src/core.ts +188 -16
- package/src/created-extension.ts +101 -0
- package/src/extension-components.ts +157 -0
- package/src/extension-discovery.ts +180 -0
- package/src/extension-process.ts +854 -0
- package/src/extension-sql.ts +85 -0
- package/src/index.ts +17 -0
- package/src/marketplace.ts +182 -54
- package/src/ports.ts +8 -0
- package/src/provenance.ts +186 -17
- package/src/remote.ts +54 -8
- package/src/schema.ts +31 -4
- package/src/seed/compile.ts +4 -2
- package/src/seed/export.ts +1 -1
- package/src/seed/values.ts +3 -3
- package/src/seo.ts +101 -6
- package/src/server.ts +194 -43
- package/src/settings.ts +12 -4
- package/src/signing-keys.ts +155 -0
- package/src/site-content.ts +11 -1
- package/src/site-file.ts +20 -6
- package/src/site-public.ts +1 -1
- package/src/site-sections.ts +1 -1
- package/src/site-trust.ts +267 -0
- package/src/transfer-dashboard.ts +6 -0
- package/src/trusted-signers-admin.ts +132 -0
- package/src/webhooks.ts +16 -1
package/src/webhooks.ts
CHANGED
|
@@ -213,6 +213,11 @@ export interface WebhookServiceOptions {
|
|
|
213
213
|
/** Publishes the schema directory to a shared store, when there is one. */
|
|
214
214
|
onFilesChanged?: () => Promise<void>
|
|
215
215
|
now?: () => Date
|
|
216
|
+
/**
|
|
217
|
+
* The origins a bundle's event `fetch` may reach (story 308); undefined for a
|
|
218
|
+
* bundle written before schema 4, which the address rule alone holds.
|
|
219
|
+
*/
|
|
220
|
+
bundleOrigins?(bundleId: string): readonly string[] | undefined
|
|
216
221
|
/** Whether a bundle is turned on (story 222); its events are not delivered while it is off. */
|
|
217
222
|
isBundleOn?(bundleId: string): boolean
|
|
218
223
|
/** The site's own handlers (story 298): which events it handles, and how one is handed over. */
|
|
@@ -634,7 +639,17 @@ export function createWebhookService(options: WebhookServiceOptions): WebhookSer
|
|
|
634
639
|
payload: delivery.payload as { Id: string },
|
|
635
640
|
deliveryId: delivery.id,
|
|
636
641
|
attempt: delivery.attempts,
|
|
637
|
-
fetch: (input, init) =>
|
|
642
|
+
fetch: (input, init) => {
|
|
643
|
+
const origins = options.bundleOrigins?.(bundleId)
|
|
644
|
+
const url = new URL(input instanceof Request ? input.url : String(input))
|
|
645
|
+
if (origins && !origins.includes(url.origin))
|
|
646
|
+
return Promise.reject(
|
|
647
|
+
new OutboundRefused(
|
|
648
|
+
`${bundleId} may not reach ${url.origin}: its http.outbound names ${origins.join(', ') || 'nothing'}.`,
|
|
649
|
+
),
|
|
650
|
+
)
|
|
651
|
+
return pinnedFetch(input, { signal, ...init }, outbound)
|
|
652
|
+
},
|
|
638
653
|
log: {
|
|
639
654
|
info: (message, properties) => named.info(message, properties),
|
|
640
655
|
warn: (message, properties) => named.warn(message, properties),
|