fix(commands): sign drive notes and calendar entries - #8
Merged
Conversation
…through unsigned Both were inherited from VehicleSpecific and dispatched over the plaintext /command/... REST endpoint, silently bypassing /signed_command on vehicles that require the vehicle-command protocol. Override them as signed Infotainment VehicleActions (takeDrivenoteAction / uiSetUpcomingCalendarEntries), matching python-tesla-fleet-api, with a regression test asserting each goes out over the signed _send path carrying the right protobuf field.
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.
Intent
Security follow-up on the merged signed-command layer (PR #5) of this published Tesla Fleet API library. Codex left findings on PR #5; the goal was to validate EACH against the Tesla vehicle-command protocol (teslamotors/vehicle-command protocol.md) and the merged code, then fix the genuinely-real ones with regression tests. Validation result: four findings (authenticate session-info tag before committing session state; accept VCSEC replies with an empty request_uuid; keep monotonic anti-replay counters on same-epoch resync; hold the VCSEC session lock across the whole dispatch) were confirmed real but ALREADY fixed in merged main (commits b8ae6d8/f756aa1) with existing regression tests, and verified protocol-correct - so no code change for those. The one still-open finding, fixed here: take_drivenote and upcoming_calendar_entries were inherited from VehicleSpecific and dispatched over the plaintext /command/... REST endpoint, silently bypassing /signed_command on vehicles that require the vehicle-command protocol. They are now overridden in Commands as signed Infotainment VehicleActions (takeDrivenoteAction / uiSetUpcomingCalendarEntries), matching python-tesla-fleet-api which now signs both. Added two regression tests (CapturingCommands) asserting each command goes out over the signed _send path carrying the correct protobuf field, updated the now-stale AGENTS.md note, and removed the stale 'intentionally not overridden' comment. A sixth Codex finding posted AFTER merge (undetailed VCSEC OPERATIONSTATUS_ERROR reported as success) was deliberately left unchanged: node matches the python reference there and the protocol's discard-and-wait guidance targets multi-message BLE, not one-shot cloud - flagged for a maintainer call rather than changed unilaterally. Full vitest suite (58 tests) passes and tsc --noEmit is clean.
What Changed
take_drivenoteandupcoming_calendar_entriesthrough signed InfotainmentVehicleActionmessages instead of the plaintext REST command path._sendpath with the correct protobuf fields.Risk Assessment
✅ Low: The changes are narrowly scoped, preserve the existing public method signatures, route both commands through the correct signed Infotainment action path, and include focused regression coverage with no material issues identified.
Testing
The author-reported baseline included 58 passing tests and a clean typecheck; I independently ran the focused end-to-end HMAC/simulator regressions and the complete 58-test runtime suite, captured the signed-transport transcript, and found no failures. This is a non-UI library transport change, so no visual screenshot applies.
Evidence: Signed-command regression transcript
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
Inspectedgit diff --unified=80 bae070e915d547a9f7ce09ae8e779b9e3d1c5be8..0cd6d15524faf05b3f254bfabda5b32cf9194eb6 -- src test package.jsonpnpm install --ignore-scripts --frozen-lockfilepnpm exec vitest run test/commands.test.ts -t 'Commands: drivenote and calendar entries are signed, not sent unsigned' --reporter=verbosepnpm testRepeated the focused command with output recorded viatee /tmp/no-mistakes-evidence/01KY7CDK3EA70XWKVX1EH0HKBY/signed-command-regressions.txtRemoved the transientnode_modulesinstallation and confirmed the worktree remained clean✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.