Skip to content

Commit c76d05a

Browse files
mssosterman
andauthored
fix(vendor): Remove excessive URL validation (#1024)
* fix(vendor): Remove excessive URL validation Fixes #1019 * feat(vendor): Add component to error message --------- Co-authored-by: Erik Osterman (CEO @ Cloud Posse) <[email protected]>
1 parent 6272c53 commit c76d05a

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

internal/exec/go_getter_utils.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,13 @@ func ValidateURI(uri string) error {
2727
if len(uri) > 2048 {
2828
return fmt.Errorf("URI exceeds maximum length of 2048 characters")
2929
}
30-
// Add more validation as needed
3130
// Validate URI format
3231
if strings.Contains(uri, "..") {
3332
return fmt.Errorf("URI cannot contain path traversal sequences")
3433
}
3534
if strings.Contains(uri, " ") {
3635
return fmt.Errorf("URI cannot contain spaces")
3736
}
38-
// Validate characters
39-
if strings.ContainsAny(uri, "<>|&;$") {
40-
return fmt.Errorf("URI contains invalid characters")
41-
}
4237
// Validate scheme-specific format
4338
if strings.HasPrefix(uri, "oci://") {
4439
if !strings.Contains(uri[6:], "/") {

internal/exec/vendor_utils.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,9 +370,9 @@ func ExecuteAtmosVendorInternal(
370370
err = ValidateURI(uri)
371371
if err != nil {
372372
if strings.Contains(uri, "..") {
373-
return fmt.Errorf("Invalid URI '%s': %w. Please ensure the source is a valid local path or a properly formatted URI.", uri, err)
373+
return fmt.Errorf("invalid URI for component %s: %w: Please ensure the source is a valid local path", s.Component, err)
374374
}
375-
return err
375+
return fmt.Errorf("invalid URI for component %s: %w", s.Component, err)
376376
}
377377
}
378378

0 commit comments

Comments
 (0)