@fabrika/provider-zerops 0.5.2 → 0.5.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabrika/provider-zerops",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",
@@ -43,14 +43,14 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "zod": "^3.25.76",
46
- "@fabrika/auth": "0.5.2",
47
- "@fabrika/auth-core": "0.5.2",
48
- "@fabrika/email": "0.5.2",
49
- "@fabrika/iam-contract": "0.5.2",
50
- "@fabrika/installation-init": "0.5.2",
51
- "@fabrika/operations-contract": "0.5.2",
52
- "@fabrika/provider-contract": "0.5.2",
53
- "@fabrika/proxy-core": "0.5.2",
46
+ "@fabrika/auth": "0.5.4",
47
+ "@fabrika/auth-core": "0.5.4",
48
+ "@fabrika/email": "0.5.4",
49
+ "@fabrika/iam-contract": "0.5.4",
50
+ "@fabrika/installation-init": "0.5.4",
51
+ "@fabrika/operations-contract": "0.5.4",
52
+ "@fabrika/provider-contract": "0.5.4",
53
+ "@fabrika/proxy-core": "0.5.4",
54
54
  "yaml": "^2.9.1"
55
55
  }
56
56
  }
@@ -148,7 +148,7 @@ export const readPinnedTag = async (dir: string): Promise<string> => {
148
148
  }
149
149
 
150
150
  /**
151
- * The default sidecar repository for an installation, following the `contember/vozka-platform-mangoweb`
151
+ * The default sidecar repository for an installation, following the predecessor's `vozka-platform-<account>`
152
152
  * precedent: named so its relation to the installation is obvious. A parameter, never a constant — one
153
153
  * operator's installations are not another's.
154
154
  */
@@ -1,6 +1,6 @@
1
1
  import { appEnvironmentId } from '@fabrika/auth-core'
2
2
  import { decodeEnvelope, type ProviderNamespaceMember } from '@fabrika/provider-contract'
3
- import { isPolicyOrigin } from '@fabrika/proxy-core/headers'
3
+ import { isCrossOrigin, isPolicyOrigin, MAX_CROSS_ORIGINS } from '@fabrika/proxy-core/headers'
4
4
  import { contractProxyTable, type ProxyManifest } from '@fabrika/proxy-core/manifest'
5
5
  import { assertFabrikaManifestCoordinates, zeropsArtifactCodec } from '../manifest'
6
6
 
@@ -32,6 +32,14 @@ export function compileNamespaceProxyManifest(namespaceId: string, members: read
32
32
  if (operationsOrigin !== undefined && !isPolicyOrigin(operationsOrigin, ['https:', 'http:'])) {
33
33
  throw new Error(`Zerops proxy target ${member.appId}/${member.env} has an Operations ingest origin that is not an http(s) origin`)
34
34
  }
35
+ const crossOrigins = member.crossOrigins ?? []
36
+ if (
37
+ crossOrigins.length > MAX_CROSS_ORIGINS
38
+ || new Set(crossOrigins).size !== crossOrigins.length
39
+ || crossOrigins.some((origin) => !isCrossOrigin(origin) || new URL(origin).hostname === host)
40
+ ) {
41
+ throw new Error(`Zerops proxy target ${member.appId}/${member.env} has a cross-origin list the proxy manifest refuses`)
42
+ }
35
43
  apps.push({
36
44
  id,
37
45
  hosts: [host],
@@ -41,6 +49,7 @@ export function compileNamespaceProxyManifest(namespaceId: string, members: read
41
49
  scheme: 'https',
42
50
  ...contractProxyTable(access.contract),
43
51
  ...(operationsOrigin === undefined ? {} : { operationsOrigin }),
52
+ ...(crossOrigins.length === 0 ? {} : { crossOrigins: [...crossOrigins] }),
44
53
  })
45
54
  }
46
55
  return { apps }