1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-04-25 19:07:57 +01:00

Improve /auth API request sanitation (#5843)

* Add basic test coverage for /auth API

* Check /auth API is called from an add-on

Currently the /auth API is only available for add-ons. Return 403
for calls not originating from an add-on.

* Handle bad json in auth API

Use the API specific JSON load helper which raises an APIError. This
causes the API to return a 400 error instead of a 500 error when the
JSON is invalid.

* Avoid redefining name 'mock_check_login'

* Update tests/api/test_auth.py
This commit is contained in:
Stefan Agner
2025-04-25 15:17:25 +02:00
committed by GitHub
parent 0e55e6e67b
commit 9470f44840
3 changed files with 134 additions and 3 deletions

View File

@@ -18,6 +18,7 @@ panel_title: Terminal
hassio_api: true
hassio_role: manager
homeassistant_api: true
auth_api: true
audio: true
uart: true
ports: