test(api): freeze legacy wire contract (Phase N-0)#37
Merged
Conversation
Phase N-0 of the Native API plan: adds table-driven regression tests pinning the current REST and WebSocket wire shapes so the upcoming /api/v1/* work cannot drift the legacy surface accidentally.
REST contract tests cover: /api/call-upload (all three legacy API-key transports: X-API-Key header, ?key= query, key= form), /api/trunk-recorder-call-upload alias, test=1 connectivity check, /api/calls envelope, /api/calls/:id/audio, /api/calls/:id/transcript, /api/calls/:id/share CRUD, /api/shared/:token{,/audio}, /api/bookmarks{,/calls,POST}, /api/auth/{login,refresh,logout,password,me,tg-selection} including os_session/refresh_token cookie issuance and clearance, /api/admin/import/{talkgroups,units,groups,tags}, /api/admin/radioreference/preview/csv, /api/admin/transcriptions/status.
WS contract pins byte-exact JSON for every server-emitted legacy command constructor in internal/ws (CAL/CFG/VER/LSC/XPR/MAX/LFM/TRN, ADM_RES, ADM_RES error) plus a structural pin for ADM_EVT (volatile timestamp asserted as positive int64).
Tests-only; no production code changes. Skips CHANGELOG per project policy for pure internal refactor / regression-test additions.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Tests-only. Pins the current REST + WebSocket wire format so the upcoming /api/v1/* native-API work cannot drift the legacy surface accidentally.
REST: /api/call-upload (all 3 API-key transports), /api/trunk-recorder-call-upload alias, test=1 check, /api/calls{,/:id/audio,/:id/transcript}, share CRUD + /api/shared/:token{,/audio}, bookmarks, auth (login/refresh/logout/password/me/tg-selection — including os_session + refresh_token cookie behaviour), admin imports, admin radioreference preview, admin transcriptions status.
WebSocket: byte-exact JSON pin for every server-emitted legacy command constructor; structural pin for ADM_EVT (volatile timestamp).
No production code changed. Skip-changelog (no user-visible behaviour change).