(sourceUrl: string | URL)
| 212 | } |
| 213 | |
| 214 | export function isTrustedInstallSourceUrl(sourceUrl: string | URL): boolean { |
| 215 | const parsed = sourceUrl instanceof URL ? sourceUrl : new URL(sourceUrl); |
| 216 | const hostname = parsed.hostname.toLowerCase(); |
| 217 | if (!hostname) return false; |
| 218 | const pathname = parsed.pathname; |
| 219 | return ( |
| 220 | isTrustedGithubActionsArtifactUrl(hostname, pathname) || |
| 221 | isTrustedEasArtifactUrl(hostname, pathname) |
| 222 | ); |
| 223 | } |
| 224 | |
| 225 | function isTrustedGithubActionsArtifactUrl(hostname: string, pathname: string): boolean { |
| 226 | if (hostname === 'api.github.com') { |
no test coverage detected