-
Notifications
You must be signed in to change notification settings - Fork 237
Add ecosystem domains for clojure, elixir, kotlin, scala, zig #17072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -154,6 +154,14 @@ var runtimeToEcosystem = map[string]string{ | |||||
| "bun": "node", // bun.sh is in the node ecosystem | ||||||
| "deno": "node", // deno.land is in the node ecosystem | ||||||
| "uv": "python", // uv is a Python package manager | ||||||
| "clojure": "clojure", | ||||||
| "dart": "dart", | ||||||
| "elixir": "elixir", | ||||||
| "kotlin": "kotlin", | ||||||
| "php": "php", | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice addition of new runtime-to-ecosystem mappings. The |
||||||
| "scala": "scala", | ||||||
| "swift": "swift", | ||||||
| "zig": "zig", | ||||||
| } | ||||||
|
|
||||||
| // getDomainsFromRuntimes extracts ecosystem domains based on the specified runtimes | ||||||
|
|
@@ -226,14 +234,17 @@ func getDomainsFromRuntimes(runtimes map[string]any) []string { | |||||
| // | ||||||
| // # Supported ecosystem identifiers: | ||||||
| // - "defaults": basic infrastructure (certs, JSON schema, Ubuntu, package mirrors) | ||||||
| // - "clojure": Clojure/Clojars | ||||||
| // - "containers": container registries (Docker, GHCR, etc.) | ||||||
| // - "dotnet": .NET and NuGet ecosystem | ||||||
| // - "dart": Dart/Flutter ecosystem | ||||||
| // - "dotnet": .NET and NuGet ecosystem | ||||||
| // - "elixir": Elixir/Hex | ||||||
| // - "github": GitHub domains (*.githubusercontent.com, github.githubassets.com, etc.) | ||||||
| // - "github-actions": GitHub Actions blob storage domains | ||||||
| // - "go": Go ecosystem | ||||||
| // - "terraform": HashiCorp/Terraform | ||||||
| // - "haskell": Haskell ecosystem | ||||||
| // - "java": Java/Maven/Gradle | ||||||
| // - "kotlin": Kotlin/JetBrains | ||||||
| // - "linux-distros": Linux distribution package repositories | ||||||
| // - "node": Node.js/NPM/Yarn | ||||||
| // - "perl": Perl/CPAN | ||||||
|
|
@@ -242,8 +253,10 @@ func getDomainsFromRuntimes(runtimes map[string]any) []string { | |||||
| // - "python": Python/PyPI/Conda | ||||||
| // - "ruby": Ruby/RubyGems | ||||||
| // - "rust": Rust/Cargo/Crates | ||||||
| // - "scala": Scala/SBT | ||||||
| // - "swift": Swift/CocoaPods | ||||||
| // - "github-actions": GitHub Actions blob storage domains | ||||||
| // - "terraform": HashiCorp/Terraform | ||||||
| // - "zig": Zig | ||||||
| func GetAllowedDomains(network *NetworkPermissions) []string { | ||||||
| if network == nil { | ||||||
| domainsLog.Print("No network permissions specified, using defaults") | ||||||
|
|
@@ -295,25 +308,30 @@ func GetAllowedDomains(network *NetworkPermissions) []string { | |||||
| var ecosystemPriority = []string{ | ||||||
| "node-cdns", // before "node" — more specific CDN sub-ecosystem | ||||||
| "rust", // before "python" — crates.io/index.crates.io/static.crates.io are native Rust domains | ||||||
| "clojure", | ||||||
| "containers", | ||||||
| "dart", | ||||||
|
||||||
| "dart", | |
| "dart", // before "go" — both share storage.googleapis.com; prefer Dart resolution |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -852,11 +852,11 @@ func TestGetDomainsFromRuntimes(t *testing.T) { | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expectEmpty: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "elixir has no ecosystem mapping", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: "elixir runtime adds elixir ecosystem domains", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runtimes: map[string]any{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "elixir": map[string]any{"version": "1.15"}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expectEmpty: true, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expectContains: []string{"hex.pm", "repo.hex.pm"}, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| }, | |
| }, | |
| { | |
| name: "clojure runtime adds clojure ecosystem domains", | |
| runtimes: map[string]any{ | |
| "clojure": map[string]any{"version": "1.11"}, | |
| }, | |
| expectContains: []string{"clojars.org", "repo.clojars.org"}, | |
| }, | |
| { | |
| name: "kotlin runtime adds kotlin ecosystem domains", | |
| runtimes: map[string]any{ | |
| "kotlin": map[string]any{"version": "1.9"}, | |
| }, | |
| expectContains: []string{"repo.maven.apache.org", "gradle.org"}, | |
| }, | |
| { | |
| name: "scala runtime adds scala ecosystem domains", | |
| runtimes: map[string]any{ | |
| "scala": map[string]any{"version": "3.3"}, | |
| }, | |
| expectContains: []string{"repo.maven.apache.org", "scala-lang.org"}, | |
| }, | |
| { | |
| name: "zig runtime adds zig ecosystem domains", | |
| runtimes: map[string]any{ | |
| "zig": map[string]any{"version": "0.12"}, | |
| }, | |
| expectContains: []string{"ziglang.org", "pkg.machengine.org"}, | |
| }, | |
| { | |
| name: "dart runtime adds dart ecosystem domains", | |
| runtimes: map[string]any{ | |
| "dart": map[string]any{"version": "3.3"}, | |
| }, | |
| expectContains: []string{"pub.dev", "pub.dartlang.org"}, | |
| }, | |
| { | |
| name: "php runtime adds php ecosystem domains", | |
| runtimes: map[string]any{ | |
| "php": map[string]any{"version": "8.3"}, | |
| }, | |
| expectContains: []string{"packagist.org", "repo.packagist.org"}, | |
| }, | |
| { | |
| name: "swift runtime adds swift ecosystem domains", | |
| runtimes: map[string]any{ | |
| "swift": map[string]any{"version": "5.9"}, | |
| }, | |
| expectContains: []string{"swift.org", "swiftpackageindex.com"}, | |
| }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New
clojureecosystem entry looks good! Consider also addingclojars.orgmirrors or CDN domains if Clojure projects commonly fetch from them.