clone

a desktop tv and program guide for over-the-air broadcasts: what's on air, what your tuner gets, live tv, recordings

Refuse cross-site changes, and let the antenna server have an admin password

FelineStateMachine committed 4b85bfc
A page on another site opened on a tailnet device could have a browser
restore a backup, schedule a recording or start a tune here: the API
and the admin API took cross-site POSTs, and the JSON handlers don't
check the content type. Every unsafe request a browser marks as
cross-site is now refused; the app's own page, the desktop app and
other non-browser clients are unaffected.

The antenna deployment's compose file passes AIRWAVES_ADMIN_PASSWORD
through, as the standalone one already did, so the admin page and
/admin/mcp can be locked there too.
commit
4b85bfca5a23026c1979eb07e95295d4831ee50d
parent
90921085bc61369075eeae7b429435e8ec53b788
author
FelineStateMachine <226808055+FelineStateMachine@users.noreply.github.com>
kind
fix risk score 1.8 of 3, Jev's estimate
4 files changed, +41 -2
MREADME.md3++-
Mdeploy/compose.yml3+++
Minternal/api/api.go5++++-
Minternal/api/auth_test.go32++++++++++++++++++++++++++++++
M README.md +2 -1
M deploy/compose.yml +3 -0
M internal/api/api.go +4 -1
M internal/api/auth_test.go +32 -0