mirror of
https://github.com/home-assistant/core.git
synced 2025-11-09 19:09:32 +00:00
Deprecate http.api_password (#21884)
* Deprecated http.api_password * Deprecated ApiConfig.api_password GitHub Drafted PR would trigger CI after changed it to normal PR. I have to commit a comment change to trigger it * Trigger CI * Adjust if- elif chain in auth middleware
This commit is contained in:
committed by
Paulus Schoutsen
parent
7ec7e51f70
commit
fe1840f901
@@ -428,7 +428,7 @@ def _format_config_error(ex: vol.Invalid, domain: str, config: Dict) -> str:
|
||||
|
||||
async def async_process_ha_core_config(
|
||||
hass: HomeAssistant, config: Dict,
|
||||
has_api_password: bool = False,
|
||||
api_password: Optional[str] = None,
|
||||
trusted_networks: Optional[Any] = None) -> None:
|
||||
"""Process the [homeassistant] section from the configuration.
|
||||
|
||||
@@ -444,8 +444,11 @@ async def async_process_ha_core_config(
|
||||
auth_conf = [
|
||||
{'type': 'homeassistant'}
|
||||
]
|
||||
if has_api_password:
|
||||
auth_conf.append({'type': 'legacy_api_password'})
|
||||
if api_password:
|
||||
auth_conf.append({
|
||||
'type': 'legacy_api_password',
|
||||
'api_password': api_password,
|
||||
})
|
||||
if trusted_networks:
|
||||
auth_conf.append({
|
||||
'type': 'trusted_networks',
|
||||
|
||||
Reference in New Issue
Block a user