Stefan AgnerandClaude Fable 5.1 f91ca71d40 Raise HomeAssistantAuthError when Core rejects Supervisor credentials
Core answers 401 on the hassio_auth views when the caller is not the
Supervisor user it knows about (its _check_access), which happens when
the hassio config entry references a different Supervisor user than the
one the socket auth middleware resolves. Supervisor so far treated that
401 like any other non-200: change_password reported "Username '...'
does not exist. Check list of users using 'ha auth list'", and
_backend_login logged "Unauthorized login" for the app's user and evicted
the cached credentials. Both blame the wrong party: the user's
credentials were never checked, and the cache eviction also breaks the
offline login fallback for that user.

Handle the 401 where it originates. make_request now raises the existing
HomeAssistantAuthError when Core answers 401 over the Unix socket, or
still answers 401 over TCP after the one token refresh it already
performs. Previously the TCP case fell out of the retry loop without
yielding, which asynccontextmanager turns into "generator didn't yield".

HomeAssistantAuthError additionally becomes an APIError with status 500
and a stable error key, so it propagates through api_process with a
message that points at Supervisor's own authentication instead of the
requested username. The auth module re-raises it ahead of its generic
HomeAssistantAPIError handling and leaves the cache untouched.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-07 10:55:50 +02:00
2021-03-16 15:47:40 +01:00
2025-10-08 10:44:49 +02:00
2020-07-29 14:45:37 +02:00
2024-09-30 18:42:08 +02:00

Home Assistant Supervisor

First private cloud solution for home automation

Home Assistant (former Hass.io) is a container-based system for managing your Home Assistant Core installation and related applications. The system is controlled via Home Assistant which communicates with the Supervisor. The Supervisor provides an API to manage the installation. This includes changing network settings or installing and updating software.

Installation

Installation instructions can be found at https://home-assistant.io/getting-started.

Development

For small changes and bugfixes you can just follow this, but for significant changes open a RFC first. Development instructions can be found here.

Release

Releases are done in 3 stages (channels) with this structure:

  1. Pull requests are merged to the main branch.
  2. A new build is pushed to the dev stage.
  3. Releases are published.
  4. A new build is pushed to the beta stage.
  5. The stable.json file is updated.
  6. The build that was pushed to beta will now be pushed to stable.

Home Assistant - A project from the Open Home Foundation

Languages
Python 96.3%
JavaScript 3.6%