@tokenoftrust/storefront-runner 2.0.23 → 2.0.25
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/apps/storefront/astro.config.mjs +5 -0
- package/apps/storefront/integrations/lifecycle-host-asset.mjs +125 -0
- package/apps/storefront/src/layouts/Layout.astro +8 -10
- package/apps/storefront/src/lib/integration/bakedManagedInstalls.ts +56 -0
- package/apps/storefront/src/lib/integration/managedInstallDeclarations.ts +11 -3
- package/apps/storefront/src/lib/integration/stageDestinationIds.ts +103 -0
- package/apps/storefront/src/middleware/renderChain.ts +15 -1
- package/package.json +1 -1
- package/packages/public-runtime/package.json +2 -1
- package/packages/public-runtime/schemas/managed-analytics/v1/adapter-definition.schema.json +2 -1
- package/packages/public-runtime/schemas/managed-analytics/v1/create-integration-install-request.schema.json +79 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/create-migration-draft-request.schema.json +79 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/integration-revision.schema.json +79 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/migration-draft.schema.json +79 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/revise-integration-install-request.schema.json +79 -0
- package/packages/public-runtime/schemas/managed-analytics/v1/update-migration-draft-request.schema.json +79 -0
- package/packages/public-runtime/src/gtm-migration/draft-generator.ts +5 -2
- package/packages/public-runtime/src/integration/baked-managed-installs.ts +188 -0
- package/packages/public-runtime/src/integration/index.ts +1 -0
- package/packages/public-runtime/src/integration/lifecycle-boot.ts +72 -0
- package/packages/public-runtime/src/integration/lifecycle-host-asset.d.mts +3 -0
- package/packages/public-runtime/src/integration/lifecycle-host-asset.mjs +17 -0
- package/packages/public-runtime/src/integration/lifecycle-host-entry.ts +16 -0
- package/packages/public-runtime/src/integration/lifecycle-runtime.ts +59 -0
- package/packages/public-runtime/src/integration/managed-analytics-api-v1.schemas.ts +18 -1
- package/packages/public-runtime/src/integration/managed-analytics-api-v1.ts +48 -3
- package/packages/public-runtime/src/integration/render-phases.ts +30 -2
package/packages/public-runtime/schemas/managed-analytics/v1/integration-revision.schema.json
CHANGED
|
@@ -176,6 +176,85 @@
|
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
"type": "integer"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"type": "object",
|
|
182
|
+
"additionalProperties": false,
|
|
183
|
+
"minProperties": 1,
|
|
184
|
+
"properties": {
|
|
185
|
+
"candidate": {
|
|
186
|
+
"type": "string",
|
|
187
|
+
"not": {
|
|
188
|
+
"anyOf": [
|
|
189
|
+
{
|
|
190
|
+
"type": "string",
|
|
191
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"type": "string",
|
|
195
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+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Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
204
|
+
}
|
|
205
|
+
]
|
|
206
|
+
},
|
|
207
|
+
"minLength": 1
|
|
208
|
+
},
|
|
209
|
+
"staged": {
|
|
210
|
+
"type": "string",
|
|
211
|
+
"not": {
|
|
212
|
+
"anyOf": [
|
|
213
|
+
{
|
|
214
|
+
"type": "string",
|
|
215
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"type": "string",
|
|
219
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\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_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
228
|
+
}
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
"minLength": 1
|
|
232
|
+
},
|
|
233
|
+
"live": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"not": {
|
|
236
|
+
"anyOf": [
|
|
237
|
+
{
|
|
238
|
+
"type": "string",
|
|
239
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"type": "string",
|
|
243
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[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-z_$][A-Za-z0-9_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
252
|
+
}
|
|
253
|
+
]
|
|
254
|
+
},
|
|
255
|
+
"minLength": 1
|
|
256
|
+
}
|
|
257
|
+
}
|
|
179
258
|
}
|
|
180
259
|
]
|
|
181
260
|
}
|
|
@@ -135,6 +135,85 @@
|
|
|
135
135
|
},
|
|
136
136
|
{
|
|
137
137
|
"type": "integer"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
"type": "object",
|
|
141
|
+
"additionalProperties": false,
|
|
142
|
+
"minProperties": 1,
|
|
143
|
+
"properties": {
|
|
144
|
+
"candidate": {
|
|
145
|
+
"type": "string",
|
|
146
|
+
"not": {
|
|
147
|
+
"anyOf": [
|
|
148
|
+
{
|
|
149
|
+
"type": "string",
|
|
150
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"type": "string",
|
|
154
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
"type": "string",
|
|
158
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .-]?[0-9]{3}[ .-]?[0-9]{4}(?=$|[^0-9]))"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
"type": "string",
|
|
162
|
+
"pattern": "(?:</?[A-Za-z][^>]*>|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]\\s*:|[Ee][Vv][Aa][Ll]\\s*\\(|(?:[Aa][Ll][Ee][Rr][Tt]|[Ff][Ee][Tt][Cc][Hh])\\s*\\(|\\{\\{|\\}\\}|\\$\\{|#[A-Za-z_][A-Za-z0-9_-]*|(?:^|[\\s,>+~])\\.[A-Za-z_-][A-Za-z0-9_-]*(?:$|[\\s,>+~.#[\\:])|\\[[A-Za-z_:][-A-Za-z0-9_:.]*(?:[~|^$*]?=[^\\]]+)?\\]|(?:[Ll][Oo][Cc][Aa][Ll]|[Ss][Ee][Ss][Ss][Ii][Oo][Nn])[Ss][Tt][Oo][Rr][Aa][Gg][Ee]|[Ii][Nn][Dd][Ee][Xx][Ee][Dd][Dd][Bb]|[Qq][Uu][Ee][Rr][Yy][Ss][Ee][Ll][Ee][Cc][Tt][Oo][Rr]|(?:[Ww][Ii][Nn][Dd][Oo][Ww]|[Dd][Oo][Cc][Uu][Mm][Ee][Nn][Tt]|[Gg][Ll][Oo][Bb][Aa][Ll][Tt][Hh][Ii][Ss]|[Cc][Oo][Nn][Ss][Oo][Ll][Ee])\\s*(?:\\.|\\[)|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\.\\s*[A-Za-z_$][A-Za-z0-9_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
163
|
+
}
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"minLength": 1
|
|
167
|
+
},
|
|
168
|
+
"staged": {
|
|
169
|
+
"type": "string",
|
|
170
|
+
"not": {
|
|
171
|
+
"anyOf": [
|
|
172
|
+
{
|
|
173
|
+
"type": "string",
|
|
174
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"type": "string",
|
|
178
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\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qq][Uu][Ee][Rr][Yy][Ss][Ee][Ll][Ee][Cc][Tt][Oo][Rr]|(?:[Ww][Ii][Nn][Dd][Oo][Ww]|[Dd][Oo][Cc][Uu][Mm][Ee][Nn][Tt]|[Gg][Ll][Oo][Bb][Aa][Ll][Tt][Hh][Ii][Ss]|[Cc][Oo][Nn][Ss][Oo][Ll][Ee])\\s*(?:\\.|\\[)|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\.\\s*[A-Za-z_$][A-Za-z0-9_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
187
|
+
}
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
"minLength": 1
|
|
191
|
+
},
|
|
192
|
+
"live": {
|
|
193
|
+
"type": "string",
|
|
194
|
+
"not": {
|
|
195
|
+
"anyOf": [
|
|
196
|
+
{
|
|
197
|
+
"type": "string",
|
|
198
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"type": "string",
|
|
202
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"type": "string",
|
|
206
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .-]?[0-9]{3}[ .-]?[0-9]{4}(?=$|[^0-9]))"
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"type": "string",
|
|
210
|
+
"pattern": "(?:</?[A-Za-z][^>]*>|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]\\s*:|[Ee][Vv][Aa][Ll]\\s*\\(|(?:[Aa][Ll][Ee][Rr][Tt]|[Ff][Ee][Tt][Cc][Hh])\\s*\\(|\\{\\{|\\}\\}|\\$\\{|#[A-Za-z_][A-Za-z0-9_-]*|(?:^|[\\s,>+~])\\.[A-Za-z_-][A-Za-z0-9_-]*(?:$|[\\s,>+~.#[\\:])|\\[[A-Za-z_:][-A-Za-z0-9_:.]*(?:[~|^$*]?=[^\\]]+)?\\]|(?:[Ll][Oo][Cc][Aa][Ll]|[Ss][Ee][Ss][Ss][Ii][Oo][Nn])[Ss][Tt][Oo][Rr][Aa][Gg][Ee]|[Ii][Nn][Dd][Ee][Xx][Ee][Dd][Dd][Bb]|[Qq][Uu][Ee][Rr][Yy][Ss][Ee][Ll][Ee][Cc][Tt][Oo][Rr]|(?:[Ww][Ii][Nn][Dd][Oo][Ww]|[Dd][Oo][Cc][Uu][Mm][Ee][Nn][Tt]|[Gg][Ll][Oo][Bb][Aa][Ll][Tt][Hh][Ii][Ss]|[Cc][Oo][Nn][Ss][Oo][Ll][Ee])\\s*(?:\\.|\\[)|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\.\\s*[A-Za-z_$][A-Za-z0-9_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
211
|
+
}
|
|
212
|
+
]
|
|
213
|
+
},
|
|
214
|
+
"minLength": 1
|
|
215
|
+
}
|
|
216
|
+
}
|
|
138
217
|
}
|
|
139
218
|
]
|
|
140
219
|
}
|
|
@@ -146,6 +146,85 @@
|
|
|
146
146
|
},
|
|
147
147
|
{
|
|
148
148
|
"type": "integer"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
"type": "object",
|
|
152
|
+
"additionalProperties": false,
|
|
153
|
+
"minProperties": 1,
|
|
154
|
+
"properties": {
|
|
155
|
+
"candidate": {
|
|
156
|
+
"type": "string",
|
|
157
|
+
"not": {
|
|
158
|
+
"anyOf": [
|
|
159
|
+
{
|
|
160
|
+
"type": "string",
|
|
161
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"type": "string",
|
|
165
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"type": "string",
|
|
169
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .-]?[0-9]{3}[ .-]?[0-9]{4}(?=$|[^0-9]))"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"type": "string",
|
|
173
|
+
"pattern": "(?:</?[A-Za-z][^>]*>|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]\\s*:|[Ee][Vv][Aa][Ll]\\s*\\(|(?:[Aa][Ll][Ee][Rr][Tt]|[Ff][Ee][Tt][Cc][Hh])\\s*\\(|\\{\\{|\\}\\}|\\$\\{|#[A-Za-z_][A-Za-z0-9_-]*|(?:^|[\\s,>+~])\\.[A-Za-z_-][A-Za-z0-9_-]*(?:$|[\\s,>+~.#[\\:])|\\[[A-Za-z_:][-A-Za-z0-9_:.]*(?:[~|^$*]?=[^\\]]+)?\\]|(?:[Ll][Oo][Cc][Aa][Ll]|[Ss][Ee][Ss][Ss][Ii][Oo][Nn])[Ss][Tt][Oo][Rr][Aa][Gg][Ee]|[Ii][Nn][Dd][Ee][Xx][Ee][Dd][Dd][Bb]|[Qq][Uu][Ee][Rr][Yy][Ss][Ee][Ll][Ee][Cc][Tt][Oo][Rr]|(?:[Ww][Ii][Nn][Dd][Oo][Ww]|[Dd][Oo][Cc][Uu][Mm][Ee][Nn][Tt]|[Gg][Ll][Oo][Bb][Aa][Ll][Tt][Hh][Ii][Ss]|[Cc][Oo][Nn][Ss][Oo][Ll][Ee])\\s*(?:\\.|\\[)|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\.\\s*[A-Za-z_$][A-Za-z0-9_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
},
|
|
177
|
+
"minLength": 1
|
|
178
|
+
},
|
|
179
|
+
"staged": {
|
|
180
|
+
"type": "string",
|
|
181
|
+
"not": {
|
|
182
|
+
"anyOf": [
|
|
183
|
+
{
|
|
184
|
+
"type": "string",
|
|
185
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"type": "string",
|
|
189
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
"type": "string",
|
|
193
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .-]?[0-9]{3}[ .-]?[0-9]{4}(?=$|[^0-9]))"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"type": "string",
|
|
197
|
+
"pattern": "(?:</?[A-Za-z][^>]*>|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]\\s*:|[Ee][Vv][Aa][Ll]\\s*\\(|(?:[Aa][Ll][Ee][Rr][Tt]|[Ff][Ee][Tt][Cc][Hh])\\s*\\(|\\{\\{|\\}\\}|\\$\\{|#[A-Za-z_][A-Za-z0-9_-]*|(?:^|[\\s,>+~])\\.[A-Za-z_-][A-Za-z0-9_-]*(?:$|[\\s,>+~.#[\\:])|\\[[A-Za-z_:][-A-Za-z0-9_:.]*(?:[~|^$*]?=[^\\]]+)?\\]|(?:[Ll][Oo][Cc][Aa][Ll]|[Ss][Ee][Ss][Ss][Ii][Oo][Nn])[Ss][Tt][Oo][Rr][Aa][Gg][Ee]|[Ii][Nn][Dd][Ee][Xx][Ee][Dd][Dd][Bb]|[Qq][Uu][Ee][Rr][Yy][Ss][Ee][Ll][Ee][Cc][Tt][Oo][Rr]|(?:[Ww][Ii][Nn][Dd][Oo][Ww]|[Dd][Oo][Cc][Uu][Mm][Ee][Nn][Tt]|[Gg][Ll][Oo][Bb][Aa][Ll][Tt][Hh][Ii][Ss]|[Cc][Oo][Nn][Ss][Oo][Ll][Ee])\\s*(?:\\.|\\[)|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\.\\s*[A-Za-z_$][A-Za-z0-9_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
198
|
+
}
|
|
199
|
+
]
|
|
200
|
+
},
|
|
201
|
+
"minLength": 1
|
|
202
|
+
},
|
|
203
|
+
"live": {
|
|
204
|
+
"type": "string",
|
|
205
|
+
"not": {
|
|
206
|
+
"anyOf": [
|
|
207
|
+
{
|
|
208
|
+
"type": "string",
|
|
209
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
"type": "string",
|
|
213
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"type": "string",
|
|
217
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .-]?[0-9]{3}[ .-]?[0-9]{4}(?=$|[^0-9]))"
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
"type": "string",
|
|
221
|
+
"pattern": "(?:</?[A-Za-z][^>]*>|[Jj][Aa][Vv][Aa][Ss][Cc][Rr][Ii][Pp][Tt]\\s*:|[Ee][Vv][Aa][Ll]\\s*\\(|(?:[Aa][Ll][Ee][Rr][Tt]|[Ff][Ee][Tt][Cc][Hh])\\s*\\(|\\{\\{|\\}\\}|\\$\\{|#[A-Za-z_][A-Za-z0-9_-]*|(?:^|[\\s,>+~])\\.[A-Za-z_-][A-Za-z0-9_-]*(?:$|[\\s,>+~.#[\\:])|\\[[A-Za-z_:][-A-Za-z0-9_:.]*(?:[~|^$*]?=[^\\]]+)?\\]|(?:[Ll][Oo][Cc][Aa][Ll]|[Ss][Ee][Ss][Ss][Ii][Oo][Nn])[Ss][Tt][Oo][Rr][Aa][Gg][Ee]|[Ii][Nn][Dd][Ee][Xx][Ee][Dd][Dd][Bb]|[Qq][Uu][Ee][Rr][Yy][Ss][Ee][Ll][Ee][Cc][Tt][Oo][Rr]|(?:[Ww][Ii][Nn][Dd][Oo][Ww]|[Dd][Oo][Cc][Uu][Mm][Ee][Nn][Tt]|[Gg][Ll][Oo][Bb][Aa][Ll][Tt][Hh][Ii][Ss]|[Cc][Oo][Nn][Ss][Oo][Ll][Ee])\\s*(?:\\.|\\[)|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\.\\s*[A-Za-z_$][A-Za-z0-9_$]*\\s*\\(|[A-Za-z_$][A-Za-z0-9_$]*\\s*\\([^)]*\\)\\s*;|[Rr][Ee][Tt][Uu][Rr][Nn][^;{}]*;|[Ff][Uu][Nn][Cc][Tt][Ii][Oo][Nn]|=>|(?:[Vv][Aa][Rr]|[Ll][Ee][Tt]|[Cc][Oo][Nn][Ss][Tt])\\s+[A-Za-z_$])"
|
|
222
|
+
}
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
"minLength": 1
|
|
226
|
+
}
|
|
227
|
+
}
|
|
149
228
|
}
|
|
150
229
|
]
|
|
151
230
|
}
|
|
@@ -147,6 +147,85 @@
|
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
"type": "integer"
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"type": "object",
|
|
153
|
+
"additionalProperties": false,
|
|
154
|
+
"minProperties": 1,
|
|
155
|
+
"properties": {
|
|
156
|
+
"candidate": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"not": {
|
|
159
|
+
"anyOf": [
|
|
160
|
+
{
|
|
161
|
+
"type": "string",
|
|
162
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"type": "string",
|
|
166
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
"type": "string",
|
|
170
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .-]?[0-9]{3}[ .-]?[0-9]{4}(?=$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
|
|
181
|
+
"type": "string",
|
|
182
|
+
"not": {
|
|
183
|
+
"anyOf": [
|
|
184
|
+
{
|
|
185
|
+
"type": "string",
|
|
186
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
"type": "string",
|
|
190
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
"type": "string",
|
|
194
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .-]?[0-9]{3}[ .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|
|
204
|
+
"live": {
|
|
205
|
+
"type": "string",
|
|
206
|
+
"not": {
|
|
207
|
+
"anyOf": [
|
|
208
|
+
{
|
|
209
|
+
"type": "string",
|
|
210
|
+
"pattern": "(?:[Gg][Tt][Mm]-[A-Za-z0-9]+|[Uu][Aa]-[0-9]+-[0-9]+)"
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
"type": "string",
|
|
214
|
+
"pattern": "(?:-----BEGIN(?: [A-Z]+)? PRIVATE KEY-----|\\bAKIA[0-9A-Z]{16}\\b|\\bsk-proj-[A-Za-z0-9_-]{8,}\\b|\\bsk-[A-Za-z0-9_-]{20,}\\b|\\b(?:sk|rk)_(?:live|test|prod)_[A-Za-z0-9_-]{8,}\\b|\\b(?:gh[pousr]_|github_pat_)[A-Za-z0-9_]{20,}\\b|\\b(?:npm_|glpat-)[A-Za-z0-9_.-]{8,}\\b|\\bxox[baprs]-[A-Za-z0-9-]{10,}\\b|\\bAIza[A-Za-z0-9_-]{20,}\\b|\\bSG\\.[A-Za-z0-9_.-]{8,}\\b|\\b(?:[Ss]ecret|[Pp]assword|[Cc]redential)[_-][A-Za-z0-9_-]{4,}\\b|\\b[Bb]earer\\s+[A-Za-z0-9._~+/-]{12,}={0,2}\\b|\\beyJ[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]{8,}\\.[A-Za-z0-9_-]+\\b|\\b(?:api[_ -]?[Kk]ey|client[_ -]?[Ss]ecret|[Pp]assword|[Cc]redential|private[_ -]?[Kk]ey)\\s*[:=]\\s*\\S+)"
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"type": "string",
|
|
218
|
+
"pattern": "(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}|\\b[0-9]{3}-[0-9]{2}-[0-9]{4}\\b|\\b(?:[0-9][ -]?){13,19}\\b|(?:^|[^0-9])(?:\\+?1[ .-]?)?(?:\\([2-9][0-9]{2}\\)|[2-9][0-9]{2})[ .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1
|
|
227
|
+
}
|
|
228
|
+
}
|
|
150
229
|
}
|
|
151
230
|
]
|
|
152
231
|
}
|
|
@@ -58,7 +58,7 @@ export const WS1_GOOGLE_MEASUREMENT_ADAPTER_ID: OpaquePublicId = "platform.googl
|
|
|
58
58
|
* The canonical WS1 config field key the google-measurement adapter declares for
|
|
59
59
|
* its destination id. Used as the DEFAULT config key when no catalog is supplied.
|
|
60
60
|
*/
|
|
61
|
-
export const WS1_GOOGLE_MEASUREMENT_DESTINATION_KEY = "
|
|
61
|
+
export const WS1_GOOGLE_MEASUREMENT_DESTINATION_KEY = "destinationIds";
|
|
62
62
|
|
|
63
63
|
/** The opaque adapter handle used when a container has no supported GA4 concept. */
|
|
64
64
|
export const NO_ADAPTER_SELECTED_ID: OpaquePublicId = "none-selected";
|
|
@@ -343,7 +343,10 @@ export function generateDisabledMigrationDraft(
|
|
|
343
343
|
break; // deterministic: first config carrying a literal id wins.
|
|
344
344
|
}
|
|
345
345
|
}
|
|
346
|
-
|
|
346
|
+
// A container's GA4 id is the merchant's LIVE destination, so the draft proposes it
|
|
347
|
+
// at that stage only. A non-live stage needs its own TEST id, which the merchant adds
|
|
348
|
+
// before verifying — the contract refuses reusing the live one there.
|
|
349
|
+
if (destinationId !== null) proposedConfiguration[destinationKey] = { live: destinationId };
|
|
347
350
|
}
|
|
348
351
|
|
|
349
352
|
// --- Redacted finding codes (no source text; stable, sorted-by-construction). -
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The baked managed-install wire (ADR 0013).
|
|
3
|
+
*
|
|
4
|
+
* ADR 0013 already specifies what a public page does about admin-installed state:
|
|
5
|
+
* managed installs are "baked at publish, never read per request on a public page"
|
|
6
|
+
* (`publicRender.ts`). The read side honored that by supplying no declarations; this is
|
|
7
|
+
* the bake side that gives it something to honor. Without it a tenant whose public site
|
|
8
|
+
* serves CDN → content-addressed storage can never measure anything, however correctly
|
|
9
|
+
* its install is configured — the served page carries a complete-looking integration
|
|
10
|
+
* plan with an empty `integrations` list, which is indistinguishable from "this tenant
|
|
11
|
+
* has no integrations" on every surface that reports configuration rather than delivery.
|
|
12
|
+
*
|
|
13
|
+
* WHAT IS SIGNED: the resolved DECLARATIONS, not the resolved plan. A plan is
|
|
14
|
+
* route-dependent — `deriveSiteSurface` varies `siteSurface` by pathname, and the stage
|
|
15
|
+
* comes from the request — so one signed plan cannot serve every route of a bundle.
|
|
16
|
+
* Declarations are route-independent, so the render resolves each route's own plan from
|
|
17
|
+
* them exactly as the Worker does, through the same resolver.
|
|
18
|
+
*
|
|
19
|
+
* The trust model mirrors the consent snapshot's, because the constraint is the same: the
|
|
20
|
+
* go-live Worker holds D1 and the signing secret, the bake holds neither. Two gates make
|
|
21
|
+
* the header un-forgeable, and BOTH must hold:
|
|
22
|
+
* 1. MATERIALIZE-MODE binding — honored only when `TOT_MATERIALIZE_MODE` is set, which
|
|
23
|
+
* the materializer's wrangler dev injects and the DEPLOYED Worker never has. So a
|
|
24
|
+
* client cannot inject installs on the live Worker, and no cacheable response can
|
|
25
|
+
* vary on the header, because it is never read there.
|
|
26
|
+
* 2. HMAC-SHA256 over a length-prefixed, DOMAIN-SEPARATED framing of
|
|
27
|
+
* (purpose, tenantId, serialized) — verified constant-time. The purpose label is
|
|
28
|
+
* what keeps this envelope and the consent envelope from being interchangeable
|
|
29
|
+
* under one secret: a signature minted for one can never be replayed as the other,
|
|
30
|
+
* independently of whether the payload would happen to parse.
|
|
31
|
+
*
|
|
32
|
+
* Either gate failing ⇒ no baked installs, and the render falls through to the
|
|
33
|
+
* environment-only plan (nothing loads). Fail-safe, never fail-open.
|
|
34
|
+
*
|
|
35
|
+
* Web Crypto only (`crypto.subtle`), so it runs unchanged on workerd.
|
|
36
|
+
*/
|
|
37
|
+
import type { IntegrationDeclarationInput } from "./resolve.js";
|
|
38
|
+
import { validateIntegrationManifest } from "./manifest.js";
|
|
39
|
+
import { findForbiddenFields } from "./secrets.js";
|
|
40
|
+
|
|
41
|
+
/** The materialize-only request header carrying a tenant's resolved managed installs. */
|
|
42
|
+
export const MANAGED_INSTALLS_INPUT_HEADER = "x-tot-managed-installs";
|
|
43
|
+
|
|
44
|
+
/** The hex HMAC-SHA256 signature over {@link MANAGED_INSTALLS_INPUT_HEADER}. */
|
|
45
|
+
export const MANAGED_INSTALLS_SIG_HEADER = "x-tot-managed-installs-sig";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* The domain-separation label for this envelope's signatures. It is part of the signed
|
|
49
|
+
* bytes, so a signature is bound to this purpose and cannot be reused for another.
|
|
50
|
+
*/
|
|
51
|
+
const MANAGED_INSTALLS_SIG_PURPOSE = "managed-installs.v1";
|
|
52
|
+
|
|
53
|
+
const encoder = new TextEncoder();
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* The exact string a signature covers: purpose, tenant and payload each prefixed by
|
|
57
|
+
* their own UTF-8 byte length, so no value can be read as a field separator and no
|
|
58
|
+
* field's content can shift a byte across a boundary.
|
|
59
|
+
*/
|
|
60
|
+
function signaturePayload(tenantId: string, serialized: string): string {
|
|
61
|
+
const purposeBytes = encoder.encode(MANAGED_INSTALLS_SIG_PURPOSE).length;
|
|
62
|
+
const tenantBytes = encoder.encode(tenantId).length;
|
|
63
|
+
const payloadBytes = encoder.encode(serialized).length;
|
|
64
|
+
return (
|
|
65
|
+
`${purposeBytes}:${MANAGED_INSTALLS_SIG_PURPOSE}` +
|
|
66
|
+
`${tenantBytes}:${tenantId}` +
|
|
67
|
+
`${payloadBytes}:${serialized}`
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function hmacKey(secret: string): Promise<CryptoKey> {
|
|
72
|
+
return crypto.subtle.importKey(
|
|
73
|
+
"raw",
|
|
74
|
+
encoder.encode(secret) as unknown as BufferSource,
|
|
75
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
76
|
+
false,
|
|
77
|
+
["sign", "verify"],
|
|
78
|
+
);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function hexToBytes(hex: string): Uint8Array | null {
|
|
82
|
+
if (hex.length === 0 || hex.length % 2 !== 0 || /[^0-9a-fA-F]/.test(hex)) return null;
|
|
83
|
+
const out = new Uint8Array(hex.length / 2);
|
|
84
|
+
for (let i = 0; i < out.length; i++) out[i] = parseInt(hex.slice(i * 2, i * 2 + 2), 16);
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/** Serialize resolved declarations for transport. The inverse of {@link parseManagedInstalls}. */
|
|
89
|
+
export function serializeManagedInstalls(
|
|
90
|
+
declarations: readonly IntegrationDeclarationInput[],
|
|
91
|
+
): string {
|
|
92
|
+
return JSON.stringify(declarations);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Parse a serialized managed-install list fail-closed. Anything unexpected — malformed
|
|
97
|
+
* JSON, a non-array, an entry missing its fields, a manifest that does not validate, or
|
|
98
|
+
* any secret-bearing public config — yields `null` for the WHOLE list rather than a
|
|
99
|
+
* partial one, so a tampered payload can never contribute a subset of declarations.
|
|
100
|
+
*
|
|
101
|
+
* The resolver re-validates every manifest again downstream; this is the outer layer, so
|
|
102
|
+
* a bad payload is rejected before it can reach plan resolution at all.
|
|
103
|
+
*/
|
|
104
|
+
export function parseManagedInstalls(
|
|
105
|
+
raw: unknown,
|
|
106
|
+
): IntegrationDeclarationInput[] | null {
|
|
107
|
+
let parsed: unknown = raw;
|
|
108
|
+
if (typeof raw === "string") {
|
|
109
|
+
try {
|
|
110
|
+
parsed = JSON.parse(raw);
|
|
111
|
+
} catch {
|
|
112
|
+
return null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (!Array.isArray(parsed)) return null;
|
|
116
|
+
|
|
117
|
+
const out: IntegrationDeclarationInput[] = [];
|
|
118
|
+
for (const entry of parsed) {
|
|
119
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) return null;
|
|
120
|
+
const record = entry as Record<string, unknown>;
|
|
121
|
+
if (typeof record["origin"] !== "string" || typeof record["ref"] !== "string") return null;
|
|
122
|
+
|
|
123
|
+
const publicConfig = record["publicConfig"];
|
|
124
|
+
if (typeof publicConfig !== "object" || publicConfig === null || Array.isArray(publicConfig)) {
|
|
125
|
+
return null;
|
|
126
|
+
}
|
|
127
|
+
if (findForbiddenFields(publicConfig, "publicConfig").length > 0) return null;
|
|
128
|
+
|
|
129
|
+
const assets = record["materializedAssets"];
|
|
130
|
+
if (!Array.isArray(assets) || assets.some((a) => typeof a !== "string")) return null;
|
|
131
|
+
|
|
132
|
+
const manifest = validateIntegrationManifest(record["manifest"]);
|
|
133
|
+
if (!manifest.ok) return null;
|
|
134
|
+
|
|
135
|
+
out.push({
|
|
136
|
+
origin: record["origin"] as IntegrationDeclarationInput["origin"],
|
|
137
|
+
ref: record["ref"],
|
|
138
|
+
manifest: manifest.value,
|
|
139
|
+
publicConfig: publicConfig as Record<string, unknown>,
|
|
140
|
+
materializedAssets: assets as string[],
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return out;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Sign a tenant's serialized managed installs: hex HMAC-SHA256 over the length-prefixed,
|
|
148
|
+
* domain-separated {@link signaturePayload}. The go-live Worker calls this; the
|
|
149
|
+
* materialize render verifies with the same secret via {@link verifyManagedInstallsSig}.
|
|
150
|
+
*/
|
|
151
|
+
export async function signManagedInstalls(
|
|
152
|
+
secret: string,
|
|
153
|
+
tenantId: string,
|
|
154
|
+
serialized: string,
|
|
155
|
+
): Promise<string> {
|
|
156
|
+
const key = await hmacKey(secret);
|
|
157
|
+
const sig = await crypto.subtle.sign(
|
|
158
|
+
"HMAC",
|
|
159
|
+
key,
|
|
160
|
+
encoder.encode(signaturePayload(tenantId, serialized)) as unknown as BufferSource,
|
|
161
|
+
);
|
|
162
|
+
let hex = "";
|
|
163
|
+
for (const b of new Uint8Array(sig)) hex += b.toString(16).padStart(2, "0");
|
|
164
|
+
return hex;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Verify a managed-install signature (constant-time via `crypto.subtle.verify`). A
|
|
169
|
+
* malformed, short, or absent signature returns `false` rather than throwing — fail
|
|
170
|
+
* closed, so no caller can smuggle in unsigned or forged installs.
|
|
171
|
+
*/
|
|
172
|
+
export async function verifyManagedInstallsSig(
|
|
173
|
+
secret: string,
|
|
174
|
+
tenantId: string,
|
|
175
|
+
serialized: string,
|
|
176
|
+
signatureHex: string | null | undefined,
|
|
177
|
+
): Promise<boolean> {
|
|
178
|
+
if (!signatureHex) return false;
|
|
179
|
+
const sig = hexToBytes(signatureHex.trim());
|
|
180
|
+
if (!sig) return false;
|
|
181
|
+
const key = await hmacKey(secret);
|
|
182
|
+
return crypto.subtle.verify(
|
|
183
|
+
"HMAC",
|
|
184
|
+
key,
|
|
185
|
+
sig as unknown as BufferSource,
|
|
186
|
+
encoder.encode(signaturePayload(tenantId, serialized)) as unknown as BufferSource,
|
|
187
|
+
);
|
|
188
|
+
}
|
|
@@ -62,6 +62,7 @@ export * from "./platform-adapter-runtime.js";
|
|
|
62
62
|
export * from "./render-phases.js";
|
|
63
63
|
export * from "./interim-bridge.js";
|
|
64
64
|
export * from "./consent-broker.js";
|
|
65
|
+
export * from "./baked-managed-installs.js";
|
|
65
66
|
export * from "./consent-cmp-demand.js";
|
|
66
67
|
export * from "./consent-config.js";
|
|
67
68
|
export * from "./consent-preview.js";
|