fix: unify PIN hashing across CLI, FSM, and web (closes #2) #7
@@ -110,7 +110,7 @@ def test_arm_publishes_arm_request_on_mqtt(app_with_pin):
|
|||||||
json={"mode": "ARMED_AWAY", "pin": "1234"},
|
json={"mode": "ARMED_AWAY", "pin": "1234"},
|
||||||
)
|
)
|
||||||
assert rv.status_code == 202
|
assert rv.status_code == 202
|
||||||
assert rv.get_json()["accepted"] is True
|
assert rv.get_json()["ok"] is True
|
||||||
|
|
||||||
pub.assert_called_once()
|
pub.assert_called_once()
|
||||||
call_args = pub.call_args
|
call_args = pub.call_args
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ def arm_system():
|
|||||||
except Exception:
|
except Exception:
|
||||||
current_app.logger.exception("Failed to publish arm request")
|
current_app.logger.exception("Failed to publish arm request")
|
||||||
return jsonify({"error": "bus unavailable"}), 503
|
return jsonify({"error": "bus unavailable"}), 503
|
||||||
return jsonify({"accepted": True, "mode": mode}), 202
|
return jsonify({"ok": True, "mode": mode}), 202
|
||||||
|
|
||||||
|
|
||||||
@system_bp.route("/api/disarm", methods=["POST"])
|
@system_bp.route("/api/disarm", methods=["POST"])
|
||||||
@@ -91,7 +91,7 @@ def disarm_system():
|
|||||||
except Exception:
|
except Exception:
|
||||||
current_app.logger.exception("Failed to publish arm request")
|
current_app.logger.exception("Failed to publish arm request")
|
||||||
return jsonify({"error": "bus unavailable"}), 503
|
return jsonify({"error": "bus unavailable"}), 503
|
||||||
return jsonify({"accepted": True, "mode": "DISARMED"}), 202
|
return jsonify({"ok": True, "mode": "DISARMED"}), 202
|
||||||
|
|
||||||
|
|
||||||
@system_bp.route("/api/reset-pin", methods=["POST"])
|
@system_bp.route("/api/reset-pin", methods=["POST"])
|
||||||
|
|||||||
Reference in New Issue
Block a user