Add HMAC-SHA256 API authentication to board drivers and edit UI

- Both olimex_esp32_c6_evb and olimex_esp32_c6_evb_pn532 drivers now
  sign every API request with X-Request-Time / X-Request-Sig headers
  using HMAC-SHA256(api_secret, METHOD:path:unix_timestamp)
- Board model gains api_secret column (nullable, default None)
- boards.py edit route saves api_secret from form
- edit.html adds API Secret input with cryptographic Generate button
- If api_secret is empty/None, headers are omitted (backward compat)
This commit is contained in:
2026-03-15 12:33:45 +02:00
parent 1152f93a00
commit 36de1623c2
5 changed files with 117 additions and 35 deletions

View File

@@ -129,6 +129,7 @@ def edit_board(board_id: int):
if lbl:
labels[f"input_{n}"] = lbl
board.labels = labels
board.api_secret = request.form.get("api_secret", "").strip() or None
db.session.commit()
flash("Board updated.", "success")