Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion pkg/workflow/data/ecosystem_domains.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,12 @@
"repo.grails.org",
"download.eclipse.org",
"download.oracle.com",
"jcenter.bintray.com"
"jcenter.bintray.com",
"dlcdn.apache.org",
"archive.apache.org",
"download.java.net",
"api.foojay.io",
"cdn.azul.com"
],
"linux-distros": [
"deb.debian.org",
Expand Down
31 changes: 31 additions & 0 deletions pkg/workflow/ecosystem_domains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,37 @@ func TestEcosystemDomainExpansion(t *testing.T) {
}
})

t.Run("java ecosystem includes Java package and tooling domains", func(t *testing.T) {
permissions := &NetworkPermissions{
Allowed: []string{"java"},
}
domains := GetAllowedDomains(permissions)

expectedDomains := []string{
"repo.maven.apache.org",
"services.gradle.org",
"download.oracle.com",
"dlcdn.apache.org",
"archive.apache.org",
"download.java.net",
"api.foojay.io",
"cdn.azul.com",
}

for _, expectedDomain := range expectedDomains {
found := false
for _, domain := range domains {
if domain == expectedDomain {
found = true
break
}
}
if !found {
t.Errorf("Expected domain '%s' to be included in java ecosystem, but it was not found", expectedDomain)
}
}
})

t.Run("node ecosystem includes Node.js package domains", func(t *testing.T) {
permissions := &NetworkPermissions{
Allowed: []string{"node"},
Expand Down
Loading