registry/internal/validators
Repository files (latest commit first)
Filename Latest commit message Latest commit date
adam jones e67997c177
Validate server registry urls are allowlisted for that registry type (#348)
## Summary
Closes a validation gap that allowed servers to be published with
unsupported registry types and base URLs.

## Changes
- **Registry Type Validation**: Only allow `npm`, `pypi`, `oci`,
`nuget`, `mcpb`
- **Registry Base URL Validation**: Enforce strict allowlist of official
registry URLs
- **Required Fields**: Registry type and base URL required when package
identifier provided
- **Comprehensive Tests**: Clear test structure showing valid vs invalid
cases side-by-side

## Validation Rules
- `npm` → `https://registry.npmjs.org`
- `pypi` → `https://pypi.org`
- `oci` → `https://docker.io` 
- `nuget` → `https://api.nuget.org`
- `mcpb` → `https://github.com` or `https://gitlab.com`

All other combinations are rejected with clear error messages.
2025-09-03 16:01:56 +01:00
..
constants.go Validate server registry urls are allowlisted for that registry type (#348) 2025-09-03 16:01:56 +01:00
utils.go Add more validation for free-form server fields (#272) 2025-08-27 01:58:41 +01:00
validators.go Validate server registry urls are allowlisted for that registry type (#348) 2025-09-03 16:01:56 +01:00
validators_test.go Validate server registry urls are allowlisted for that registry type (#348) 2025-09-03 16:01:56 +01:00