Extend auth/providers
endpoint and add /api/person/list
endpoint for local ip requests (#103906)
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
512902fc59
commit
852fb58ca8
14 changed files with 370 additions and 75 deletions
|
@ -17,7 +17,7 @@ from homeassistant.components import websocket_api
|
|||
from homeassistant.components.http.view import HomeAssistantView
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.network import get_url
|
||||
from homeassistant.helpers.network import get_url, is_cloud_connection
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
from homeassistant.loader import bind_hass
|
||||
from homeassistant.util import network
|
||||
|
@ -145,13 +145,8 @@ async def async_handle_webhook(
|
|||
return Response(status=HTTPStatus.METHOD_NOT_ALLOWED)
|
||||
|
||||
if webhook["local_only"] in (True, None) and not isinstance(request, MockRequest):
|
||||
if has_cloud := "cloud" in hass.config.components:
|
||||
from hass_nabucasa import remote # pylint: disable=import-outside-toplevel
|
||||
|
||||
is_local = True
|
||||
if has_cloud and remote.is_cloud_request.get():
|
||||
is_local = False
|
||||
else:
|
||||
is_local = not is_cloud_connection(hass)
|
||||
if is_local:
|
||||
if TYPE_CHECKING:
|
||||
assert isinstance(request, Request)
|
||||
assert request.remote is not None
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue