Commit 943bf5f
Validate source control URL before registry identity lookup
Add validation in `lookupIdentities` to detect malformed URLs before
making HTTP requests to the registry server. This prevents sending
invalid URLs that may contain git credential error messages concatenated
to the original URL.
When macOS git-credential-osxkeychain fails to find credentials, it
outputs error messages in a format like:
'https://github.com/owner/repo.git': failed looking up identity for ...
In some edge cases, these error messages can get concatenated with the
original URL, resulting in malformed URLs being passed to the registry.
This causes server-side errors and confusing diagnostics.
The validation checks:
- URL can be parsed by Foundation
- URL has a non-empty host
- URL doesn't contain patterns indicative of concatenated error messages
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5547e32 commit 943bf5f
File tree
2 files changed
+37
-0
lines changed- Sources/PackageRegistry
- Tests/PackageRegistryTests
2 files changed
+37
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1017 | 1017 | | |
1018 | 1018 | | |
1019 | 1019 | | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
1020 | 1033 | | |
1021 | 1034 | | |
1022 | 1035 | | |
| |||
1503 | 1516 | | |
1504 | 1517 | | |
1505 | 1518 | | |
| 1519 | + | |
1506 | 1520 | | |
1507 | 1521 | | |
1508 | 1522 | | |
| |||
1580 | 1594 | | |
1581 | 1595 | | |
1582 | 1596 | | |
| 1597 | + | |
| 1598 | + | |
1583 | 1599 | | |
1584 | 1600 | | |
1585 | 1601 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3148 | 3148 | | |
3149 | 3149 | | |
3150 | 3150 | | |
| 3151 | + | |
| 3152 | + | |
| 3153 | + | |
| 3154 | + | |
| 3155 | + | |
| 3156 | + | |
| 3157 | + | |
| 3158 | + | |
| 3159 | + | |
| 3160 | + | |
| 3161 | + | |
| 3162 | + | |
| 3163 | + | |
| 3164 | + | |
| 3165 | + | |
| 3166 | + | |
| 3167 | + | |
| 3168 | + | |
| 3169 | + | |
| 3170 | + | |
| 3171 | + | |
3151 | 3172 | | |
3152 | 3173 | | |
3153 | 3174 | | |
| |||
0 commit comments