Fix review findings validating OM-84

This commit is contained in:
Forge Sandbox committed 2026-12-04 01:51:27 +00:00
1 parent d6e5ef0b1f
commit 8f23959a01
2 files changed
+9

No files matched your search

+2
View File
@@ -186,6 +186,8 @@ describe('secret routes', () => {
const bodies = [
{ value: 'v', agentHidden: true },
{ value: 'v', agentHidden: true, allowedHosts: ['*'] },
{ value: 'v', agentHidden: true, allowedHosts: ['*.com'] },
{ value: 'v', agentHidden: true, allowedHosts: ['*.io'] },
{ value: 'v', agentHidden: true, allowedHosts: ['https://example.com'] },
{ value: 'v', agentHidden: true, allowedHosts: ['example.com:443'] },
{ value: 'v', agentHidden: true, allowedHosts: ['example.com/path'] },
+7
View File
@@ -83,6 +83,13 @@ export const SecretAllowedHostSchema = z
code: 'custom',
message: 'Host must be a hostname or a *.wildcard hostname without a scheme, port, path, or IP address',
})
return
}
if (host.startsWith('*.') && !host.slice(2).includes('.')) {
ctx.addIssue({
code: 'custom',
message: 'Wildcard hosts must cover a domain with at least two labels, such as *.example.com',
})
}
})
.transform((host) => host.toLowerCase())