MCPcopy Index your code
hub / github.com/simstudioai/sim / assertSafeZoomInfoUrl

Function assertSafeZoomInfoUrl

apps/sim/app/api/tools/zoominfo/shared.ts:70–91  ·  view source on GitHub ↗
(rawUrl: string, label: string)

Source from the content-addressed store, hash-verified

68}
69
70export function assertSafeZoomInfoUrl(rawUrl: string, label: string): URL {
71 let parsed: URL
72 try {
73 parsed = new URL(rawUrl)
74 } catch {
75 throw new Error(`${label} must be a valid URL`)
76 }
77 if (parsed.protocol !== 'https:') {
78 throw new Error(`${label} must use https://`)
79 }
80 const host = parsed.hostname.toLowerCase()
81 if (FORBIDDEN_HOSTS.has(host)) {
82 throw new Error(`${label} host is not allowed`)
83 }
84 if (isPrivateIPv4(host)) {
85 throw new Error(`${label} host is not allowed (private/loopback range)`)
86 }
87 if (host !== 'api.zoominfo.com') {
88 throw new Error(`${label} host must be api.zoominfo.com`)
89 }
90 return parsed
91}
92
93interface CachedToken {
94 accessToken: string

Callers 2

callZoomInfoFunction · 0.90
fetchZoomInfoAccessTokenFunction · 0.85

Calls 1

isPrivateIPv4Function · 0.70

Tested by

no test coverage detected