Commit 641e363
Handle invalid source control URLs in registry identity lookup
Add validation for source control URLs in `lookupIdentities`:
1. Client-side validation before making HTTP requests:
- URL must be parseable
- URL must have a valid host
- URL must not contain whitespace (indicates malformed URL with
concatenated error messages)
2. Server-side validation via HTTP 400 response:
- When the server returns 400 Bad Request, throw
`RegistryError.invalidSourceControlURL`
This handles cases where malformed URLs (e.g., containing git credential
error messages like "'URL': failed looking up identity...") are passed
to the registry.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 5547e32 commit 641e363
File tree
2 files changed
+73
-1
lines changed- Sources/PackageRegistry
- Tests/PackageRegistryTests
2 files changed
+73
-1
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 | + | |
1020 | 1029 | | |
1021 | 1030 | | |
1022 | 1031 | | |
| |||
1066 | 1075 | | |
1067 | 1076 | | |
1068 | 1077 | | |
| 1078 | + | |
| 1079 | + | |
| 1080 | + | |
| 1081 | + | |
| 1082 | + | |
1069 | 1083 | | |
1070 | 1084 | | |
1071 | 1085 | | |
1072 | 1086 | | |
1073 | 1087 | | |
1074 | 1088 | | |
1075 | 1089 | | |
1076 | | - | |
| 1090 | + | |
1077 | 1091 | | |
1078 | 1092 | | |
1079 | 1093 | | |
| |||
1503 | 1517 | | |
1504 | 1518 | | |
1505 | 1519 | | |
| 1520 | + | |
1506 | 1521 | | |
1507 | 1522 | | |
1508 | 1523 | | |
| |||
1580 | 1595 | | |
1581 | 1596 | | |
1582 | 1597 | | |
| 1598 | + | |
| 1599 | + | |
1583 | 1600 | | |
1584 | 1601 | | |
1585 | 1602 | | |
| |||
| 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 | + | |
| 3172 | + | |
| 3173 | + | |
| 3174 | + | |
| 3175 | + | |
| 3176 | + | |
| 3177 | + | |
| 3178 | + | |
| 3179 | + | |
| 3180 | + | |
| 3181 | + | |
| 3182 | + | |
| 3183 | + | |
| 3184 | + | |
| 3185 | + | |
| 3186 | + | |
| 3187 | + | |
| 3188 | + | |
| 3189 | + | |
| 3190 | + | |
| 3191 | + | |
| 3192 | + | |
| 3193 | + | |
| 3194 | + | |
| 3195 | + | |
| 3196 | + | |
| 3197 | + | |
| 3198 | + | |
| 3199 | + | |
| 3200 | + | |
| 3201 | + | |
| 3202 | + | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
3151 | 3206 | | |
3152 | 3207 | | |
3153 | 3208 | | |
| |||
0 commit comments