You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returnfmt.Errorf("MCPB packages must be hosted on allowlisted providers (GitHub or GitLab). Host '%s' is not allowed", host)
93
+
}
94
+
95
+
// Validate URL path is a proper release URL with strict structure validation
96
+
path:=parsedURL.Path
97
+
switchhost {
98
+
case"github.com", "www.github.com":
99
+
// GitHub release URLs must match: /owner/repo/releases/download/tag/filename
100
+
if!isValidGitHubReleaseURL(path) {
101
+
returnfmt.Errorf("GitHub MCPB packages must be release assets following the pattern '/owner/repo/releases/download/tag/filename'")
102
+
}
103
+
case"gitlab.com", "www.gitlab.com":
104
+
// GitLab release URLs must match specific patterns
105
+
if!isValidGitLabReleaseURL(path) {
106
+
returnfmt.Errorf("GitLab MCPB packages must be release assets following patterns '/owner/repo/-/releases/tag/downloads/filename' or '/owner/repo/-/package_files/id/download'")
107
+
}
108
+
}
109
+
110
+
returnnil
111
+
}
112
+
113
+
// isValidGitHubReleaseURL validates that a path follows the GitHub release asset pattern
0 commit comments