registry/cmd/publisher/commands
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Yufeng He c36b521bf1
fix: reject mangled publisher metadata (#1310)
## Summary
- add a publisher preflight that rejects non-UTF-8 `server.json` bytes
before parsing
- reject unpaired UTF-16 surrogate escapes inside JSON string fields
before publish/validate requests are sent
- keep valid non-ASCII descriptions, including em dashes, round-tripping
through the publish path
- make the publisher test token helper set `USERPROFILE` as well as
`HOME` so Windows tests use the temp home directory

Closes #1306.

## To verify
- `go test ./cmd/publisher/commands -run
"TestPublishCommand_(Success|PreservesNonASCIIDescription|RejectsInvalidUTF8ServerJSON|RejectsUnpairedSurrogateEscape)$"
-count=1`
- `go test ./cmd/publisher/commands -run TestPublishCommand -count=1`
- `go test ./cmd/publisher/commands -run TestValidateCommand -count=1`
- `git diff --check`

Co-authored-by: Radoslav Dimitrov <radoslav@stacklok.com>
2026-07-12 12:57:45 -04:00
..
init.go fix(publisher): honor mcpName as the authoritative server name in init (#1195) 2026-04-25 07:14:11 -07:00
init_test.go fix(publisher): honor mcpName as the authoritative server name in init (#1195) 2026-04-25 07:14:11 -07:00
login.go fix: store tokens in ~/.config/mcp-publisher/ instead of cwd (#1166) 2026-04-15 03:23:07 -04:00
login_test.go fix: store tokens in ~/.config/mcp-publisher/ instead of cwd (#1166) 2026-04-15 03:23:07 -04:00
logout.go fix: store tokens in ~/.config/mcp-publisher/ instead of cwd (#1166) 2026-04-15 03:23:07 -04:00
logout_test.go fix: store tokens in ~/.config/mcp-publisher/ instead of cwd (#1166) 2026-04-15 03:23:07 -04:00
publish.go fix: reject mangled publisher metadata (#1310) 2026-07-12 12:57:45 -04:00
publish_test.go fix: reject mangled publisher metadata (#1310) 2026-07-12 12:57:45 -04:00
status.go fix: store tokens in ~/.config/mcp-publisher/ instead of cwd (#1166) 2026-04-15 03:23:07 -04:00
status_test.go Publisher-managed "deleted" support (#893) 2026-02-27 09:00:07 -08:00
testutil_test.go fix: reject mangled publisher metadata (#1310) 2026-07-12 12:57:45 -04:00
unicode.go fix: reject mangled publisher metadata (#1310) 2026-07-12 12:57:45 -04:00
validate.go fix: reject mangled publisher metadata (#1310) 2026-07-12 12:57:45 -04:00
validate_test.go Added /validate endpoint and modified mcp-publish so that all validation happens there (#896) 2026-02-04 15:52:07 +02:00