Add repair issues for nest app auth removal and yaml deprecation (#75974)

* Add repair issues for nest app auth removal and yaml deprecation

* Apply PR feedback

* Re-apply suggestion that i force pushed over

* Update criticality level
This commit is contained in:
Allen Porter 2022-08-01 18:20:20 -07:00 committed by GitHub
parent 81e3ef03f7
commit 26e2ef8175
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 48 additions and 15 deletions

View File

@ -29,6 +29,11 @@ from homeassistant.components.application_credentials import (
from homeassistant.components.camera import Image, img_util
from homeassistant.components.http.const import KEY_HASS_USER
from homeassistant.components.http.view import HomeAssistantView
from homeassistant.components.repairs import (
IssueSeverity,
async_create_issue,
async_delete_issue,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_BINARY_SENSORS,
@ -187,6 +192,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
entry, unique_id=entry.data[CONF_PROJECT_ID]
)
async_delete_issue(hass, DOMAIN, "removed_app_auth")
subscriber = await api.new_subscriber(hass, entry)
if not subscriber:
return False
@ -255,6 +262,18 @@ async def async_import_config(hass: HomeAssistant, entry: ConfigEntry) -> None:
if entry.data["auth_implementation"] == INSTALLED_AUTH_DOMAIN:
# App Auth credentials have been deprecated and must be re-created
# by the user in the config flow
async_create_issue(
hass,
DOMAIN,
"removed_app_auth",
is_fixable=False,
severity=IssueSeverity.ERROR,
translation_key="removed_app_auth",
translation_placeholders={
"more_info_url": "https://www.home-assistant.io/more-info/nest-auth-deprecation",
"documentation_url": "https://www.home-assistant.io/integrations/nest/",
},
)
raise ConfigEntryAuthFailed(
"Google has deprecated App Auth credentials, and the integration "
"must be reconfigured in the UI to restore access to Nest Devices."
@ -271,12 +290,14 @@ async def async_import_config(hass: HomeAssistant, entry: ConfigEntry) -> None:
WEB_AUTH_DOMAIN,
)
_LOGGER.warning(
"Configuration of Nest integration in YAML is deprecated and "
"will be removed in a future release; Your existing configuration "
"(including OAuth Application Credentials) has been imported into "
"the UI automatically and can be safely removed from your "
"configuration.yaml file"
async_create_issue(
hass,
DOMAIN,
"deprecated_yaml",
breaks_in_ha_version="2022.10.0",
is_fixable=False,
severity=IssueSeverity.WARNING,
translation_key="deprecated_yaml",
)

View File

@ -2,7 +2,7 @@
"domain": "nest",
"name": "Nest",
"config_flow": true,
"dependencies": ["ffmpeg", "http", "application_credentials"],
"dependencies": ["ffmpeg", "http", "application_credentials", "repairs"],
"after_dependencies": ["media_source"],
"documentation": "https://www.home-assistant.io/integrations/nest",
"requirements": ["python-nest==4.2.0", "google-nest-sdm==2.0.0"],

View File

@ -88,5 +88,15 @@
"camera_sound": "Sound detected",
"doorbell_chime": "Doorbell pressed"
}
},
"issues": {
"deprecated_yaml": {
"title": "The Nest YAML configuration is being removed",
"description": "Configuring Nest in configuration.yaml is being removed in Home Assistant 2022.10.\n\nYour existing OAuth Application Credentials and access settings have been imported into the UI automatically. Remove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue."
},
"removed_app_auth": {
"title": "Nest Authentication Credentials must be updated",
"description": "To improve security and reduce phishing risk Google has deprecated the authentication method used by Home Assistant.\n\n**This requires action by you to resolve** ([more info]({more_info_url}))\n\n1. Visit the integrations page\n1. Click Reconfigure on the Nest integration.\n1. Home Assistant will walk you through the steps to upgrade to Web Authentication.\n\nSee the Nest [integration instructions]({documentation_url}) for troubleshooting information."
}
}
}

View File

@ -10,7 +10,6 @@
"missing_configuration": "The component is not configured. Please follow the documentation.",
"no_url_available": "No URL available. For information about this error, [check the help section]({docs_url})",
"reauth_successful": "Re-authentication was successful",
"single_instance_allowed": "Already configured. Only a single configuration possible.",
"unknown_authorize_url_generation": "Unknown error generating an authorize URL."
},
"create_entry": {
@ -26,13 +25,6 @@
"wrong_project_id": "Please enter a valid Cloud Project ID (was same as Device Access Project ID)"
},
"step": {
"auth": {
"data": {
"code": "Access Token"
},
"description": "To link your Google account, [authorize your account]({url}).\n\nAfter authorization, copy-paste the provided Auth Token code below.",
"title": "Link Google Account"
},
"auth_upgrade": {
"description": "App Auth has been deprecated by Google to improve security, and you need to take action by creating new application credentials.\n\nOpen the [documentation]({more_info_url}) to follow along as the next steps will guide you through the steps you need to take to restore access to your Nest devices.",
"title": "Nest: App Auth Deprecation"
@ -96,5 +88,15 @@
"camera_sound": "Sound detected",
"doorbell_chime": "Doorbell pressed"
}
},
"issues": {
"deprecated_yaml": {
"description": "Configuring Nest in configuration.yaml is being removed in Home Assistant 2022.10.\n\nYour existing OAuth Application Credentials and access settings have been imported into the UI automatically. Remove the YAML configuration from your configuration.yaml file and restart Home Assistant to fix this issue.",
"title": "The Nest YAML configuration is being removed"
},
"removed_app_auth": {
"description": "To improve security and reduce phishing risk Google has deprecated the authentication method used by Home Assistant.\n\n**This requires action by you to resolve** ([more info]({more_info_url}))\n\n1. Visit the integrations page\n1. Click Reconfigure on the Nest integration.\n1. Home Assistant will walk you through the steps to upgrade to Web Authentication.\n\nSee the Nest [integration instructions]({documentation_url}) for troubleshooting information.",
"title": "Nest Authentication Credentials must be updated"
}
}
}