mirror of
https://github.com/rstrouse/ESPSomfy-RTS.git
synced 2026-10-31 13:52:15 +01:00
feat!: the token on every route, Secure Config Only goes (step 4b)
Under Secured every HTTP route but the public ones needs the token (docs/adr/0006-two-security-modes-eleven-http-routes.md): - isPublicRoute, isWebAsset and originMatchesHost in src/HttpAccess.h, with native tests. - One middleware checks the token. It runs once the body is in, so /restore, /updateFirmware and /updateApplication check it on their first chunk and drop a refused upload. - Static serving answers the web UI's files only: shades.cfg and shades.tmp are no longer served. - The wildcard CORS headers go; WEB_CORS turns them back on for UI work from file://. - The socket refuses a handshake whose Origin doesn't name its Host. - "Secure Config Only" goes: a device set to it is Secured, and /loginContext drops permissions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
13ec38823b
commit
ecb0260f61
16 changed files with 392 additions and 54 deletions
|
|
@ -136,6 +136,9 @@ The device's description of the protocol it speaks: what each message type, fiel
|
|||
Whether the device asks for login: *None* (everything open) or *Secured* (a PIN or password).
|
||||
_Avoid_: Secure Config Only (removed)
|
||||
|
||||
**Public route**
|
||||
What anyone may reach under Secured without a token: the web UI's files, `/loginContext`, `/login`, `/upnp.xml` and preflight requests. Static serving answers the web UI's files alone, so `shades.cfg` isn't one.
|
||||
|
||||
**Token**
|
||||
What logging in returns. It stands for the PIN or password, on one client address, and every request under Secured carries it.
|
||||
_Avoid_: session, API key (the name of the field it travels in)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue