Skip to content

feat(api): documented LAN automation API with optional token auth#73

Open
iceice400 wants to merge 1 commit into
KMX415:mainfrom
iceice400:feat/lan-rest-api
Open

feat(api): documented LAN automation API with optional token auth#73
iceice400 wants to merge 1 commit into
KMX415:mainfrom
iceice400:feat/lan-rest-api

Conversation

@iceice400
Copy link
Copy Markdown
Contributor

Summary

  • Add optional automation config (enabled + token) for LAN scripting clients; disabled by default.
  • Expose /api/automation/* thin aliases for nodes, packets, status, and send, gated by X-Meshpoint-Token or Authorization: Bearer (API token or existing dashboard JWT).
  • Document setup and Home Assistant examples in docs/API-AUTOMATION.md; token never returned from GET /api/config.

Why

Operators want Home Assistant / Node-RED integration without browser cookies. The dashboard already had the underlying endpoints; this PR formalizes a token-auth surface for non-browser clients on the LAN.

Testing

  • python -m unittest tests.test_automation_api -v (config + enrichment tests pass; FastAPI auth tests run when PyJWT is installed)
  • Manual: enable automation in local.yaml, curl -H X-Meshpoint-Token: ... /api/automation/status

Impact

  • Zero behaviour change when automation.enabled is false (default): automation routes return 403.
  • TX send reuses existing message pipeline and rate limits.

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