Validate local_only user for signed requests#169066
Conversation
|
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
This PR tightens HTTP signed-request authentication by applying the same “user allowed to authenticate” constraints (inactive users and local_only users on remote requests) that already apply to bearer-token auth.
Changes:
- Enforce
async_user_not_allowed_do_auth(...)when validating signed requests. - Add tests ensuring signed URLs fail for
local_onlyusers on external IPs. - Add tests ensuring signed URLs fail for inactive users.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
homeassistant/components/http/auth.py |
Rejects signed requests when the issuing user is inactive or not permitted to authenticate from the request origin (e.g., local_only remotely). |
tests/components/http/test_auth.py |
Adds coverage for signed URL access behavior for local_only users and inactive users. |
e053de5 to
0145027
Compare
There was a problem hiding this comment.
Pull request overview
This PR closes a security gap in the HTTP component by applying the existing “inactive/local-only user” restrictions to signed URL authentication, preventing local-only users from using signed resources from remote addresses.
Changes:
- Add
async_user_not_allowed_do_auth(...)enforcement to signed-request validation. - Add test coverage to confirm signed URLs are allowed locally but rejected remotely for
local_onlyusers. - Add test coverage to confirm signed URLs are rejected for inactive users.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
homeassistant/components/http/auth.py |
Rejects signed-request authentication when the associated user is inactive or local-only on remote/cloud connections. |
tests/components/http/test_auth.py |
Adds regression tests for signed URL access with local_only and inactive users. |
Breaking change
Proposed change
Validate local_only user for signed requests so local_only users can't use signed resources on remote requests
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: