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:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user