Skip to content

♻️ Trim the public-ports protocol and share one fake share socket - #34

Merged
bdsoha merged 3 commits into
mainfrom
feature/public-ports-hardening
Dec 1, 2026
Merged

bdsoha merged 3 commits into
mainfrom
feature/public-ports-hardening

Conversation

@bdsoha

@bdsoha bdsoha commented Dec 1, 2026

Copy link
Copy Markdown
Member

Story 6.28: the ws-cli side of hardening public ports before their first release.

  • The share request no longer sends access or a content-type header; ws-server never read either. since and Listing.Revision are gone from the decoded types.
  • List, Tab and Clear share one decode helper, which returns the zero value on a JSON error.
  • port list builds its rows through one add().
  • One fake share socket in internals/testutil (POST /ports/share only) replaces the per-package fakes.

Wire-compatible both ways with older and newer ws-server.

Verified locally: go test ./..., -race on the port and serve packages, prek.

Drop the share request's access field, the unread since and revision
fields and the session request's content type; ws-server ignores them.
The response keeps access, which port list prints. List, Tab and Clear
decode through one helper, and the share, port and serve tests use one
fake share socket from testutil.
json.Unmarshal fills the fields it reads before a type error, so List,
Tab and Clear could hand back a half-filled value with the error, and
port list no longer resets it. decode now returns the zero value.
Any other method or path gets the not-found answer an old ws-server
gives, so a client calling the wrong route fails its test.
@bdsoha
bdsoha merged commit a74f896 into main Dec 1, 2026
3 checks passed
@bdsoha
bdsoha deleted the feature/public-ports-hardening branch December 1, 2026 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant