Skip to content

Commit d303d4e

Browse files
CopilotMossaka
andauthored
Add download.jetbrains.com to kotlin ecosystem domain allowlist (#22942)
* Initial plan * Add download.jetbrains.com to kotlin ecosystem domain allowlist Add the missing download.jetbrains.com domain to the kotlin ecosystem in ecosystem_domains.json. The other domains mentioned in the issue (packages.jetbrains.team and maven.pkg.jetbrains.space) were already present. Also add kotlin ecosystem test coverage to ecosystem_domains_test.go and include kotlin in existing ecosystem enumeration tests. Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> Agent-Logs-Url: https://github.com/github/gh-aw/sessions/97050330-ec02-4b67-9b36-b862c68ed66a --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Mossaka <5447827+Mossaka@users.noreply.github.com> Co-authored-by: Jiaxiao Zhou <duibao55328@gmail.com>
1 parent f684e4c commit d303d4e

2 files changed

Lines changed: 25 additions & 3 deletions

File tree

pkg/workflow/data/ecosystem_domains.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
"*.gradle-enterprise.cloud"
158158
],
159159
"julia": ["pkg.julialang.org", "*.pkg.julialang.org", "julialang.org", "julialang-s3.julialang.org", "storage.julialang.net"],
160-
"kotlin": ["ge.jetbrains.com", "packages.jetbrains.team", "kotlin.bintray.com", "maven.pkg.jetbrains.space"],
160+
"kotlin": ["download.jetbrains.com", "ge.jetbrains.com", "packages.jetbrains.team", "kotlin.bintray.com", "maven.pkg.jetbrains.space"],
161161
"linux-distros": [
162162
"deb.debian.org",
163163
"security.debian.org",

pkg/workflow/ecosystem_domains_test.go

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,28 @@ func TestEcosystemDomainExpansion(t *testing.T) {
339339
}
340340
})
341341

342+
t.Run("kotlin ecosystem includes JetBrains and Kotlin domains", func(t *testing.T) {
343+
permissions := &NetworkPermissions{
344+
Allowed: []string{"kotlin"},
345+
}
346+
domains := GetAllowedDomains(permissions)
347+
348+
expectedDomains := []string{
349+
"download.jetbrains.com",
350+
"ge.jetbrains.com",
351+
"packages.jetbrains.team",
352+
"kotlin.bintray.com",
353+
"maven.pkg.jetbrains.space",
354+
}
355+
356+
for _, expectedDomain := range expectedDomains {
357+
found := slices.Contains(domains, expectedDomain)
358+
if !found {
359+
t.Errorf("Expected domain '%s' to be included in kotlin ecosystem, but it was not found", expectedDomain)
360+
}
361+
}
362+
})
363+
342364
t.Run("multiple ecosystems can be combined", func(t *testing.T) {
343365
permissions := &NetworkPermissions{
344366
Allowed: []string{"defaults", "dotnet", "python", "example.com"},
@@ -389,7 +411,7 @@ func TestAllEcosystemDomainFunctions(t *testing.T) {
389411
// Test that all ecosystem categories return non-empty slices
390412
ecosystemCategories := []string{
391413
"defaults", "containers", "bazel", "dotnet", "dart", "github", "go",
392-
"terraform", "haskell", "java", "julia", "linux-distros", "lua", "node",
414+
"terraform", "haskell", "java", "julia", "kotlin", "linux-distros", "lua", "node",
393415
"ocaml", "perl", "php", "playwright", "python", "r", "ruby", "rust", "swift",
394416
}
395417

@@ -414,7 +436,7 @@ func TestEcosystemDomainsUniqueness(t *testing.T) {
414436
// Test that each ecosystem category returns unique domains (no duplicates)
415437
ecosystemCategories := []string{
416438
"defaults", "containers", "bazel", "dotnet", "dart", "github", "go",
417-
"terraform", "haskell", "java", "julia", "linux-distros", "lua", "node",
439+
"terraform", "haskell", "java", "julia", "kotlin", "linux-distros", "lua", "node",
418440
"ocaml", "perl", "php", "playwright", "python", "r", "ruby", "rust", "swift",
419441
}
420442

0 commit comments

Comments
 (0)