mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Update allowlisted OAuth redirect URIs for Wear OS (#77411)
This commit is contained in:
parent
79b5147b46
commit
fa0dfd812c
@ -38,9 +38,15 @@ async def verify_redirect_uri(
|
||||
|
||||
# Whitelist the iOS and Android callbacks so that people can link apps
|
||||
# without being connected to the internet.
|
||||
if redirect_uri == "homeassistant://auth-callback" and client_id in (
|
||||
"https://home-assistant.io/android",
|
||||
"https://home-assistant.io/iOS",
|
||||
if (
|
||||
client_id == "https://home-assistant.io/iOS"
|
||||
and redirect_uri == "homeassistant://auth-callback"
|
||||
):
|
||||
return True
|
||||
|
||||
if client_id == "https://home-assistant.io/android" and redirect_uri in (
|
||||
"homeassistant://auth-callback",
|
||||
"https://wear.googleapis.com/3p_auth/io.homeassistant.companion.android",
|
||||
):
|
||||
return True
|
||||
|
||||
|
@ -183,3 +183,16 @@ async def test_verify_redirect_uri_android_ios(client_id):
|
||||
assert not await indieauth.verify_redirect_uri(
|
||||
None, "https://incorrect.com", "homeassistant://auth-callback"
|
||||
)
|
||||
|
||||
if client_id == "https://home-assistant.io/android":
|
||||
assert await indieauth.verify_redirect_uri(
|
||||
None,
|
||||
client_id,
|
||||
"https://wear.googleapis.com/3p_auth/io.homeassistant.companion.android",
|
||||
)
|
||||
else:
|
||||
assert not await indieauth.verify_redirect_uri(
|
||||
None,
|
||||
client_id,
|
||||
"https://wear.googleapis.com/3p_auth/io.homeassistant.companion.android",
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user