If registration supports encryption then return encrypted payloads (#21853)

This commit is contained in:
Robbie Trencheny authored and Charles Garwood committed 2019-03-11 08:34:58 -04:00
1 parent c401f35a43
commit 785fd273e3
7 files changed
+91 -24

No files matched your search

@@ -53,9 +53,9 @@ class RegistrationsView(HomeAssistantView):
data[CONF_WEBHOOK_ID] = webhook_id
if data[ATTR_SUPPORTS_ENCRYPTION] and supports_encryption():
secret = generate_secret(16)
from nacl.secret import SecretBox
data[CONF_SECRET] = secret
data[CONF_SECRET] = generate_secret(SecretBox.KEY_SIZE)
data[CONF_USER_ID] = request['hass_user'].id