If registration supports encryption then return encrypted payloads (#21853)
This commit is contained in:
parent
c401f35a43
commit
785fd273e3
7 changed files with 91 additions and 24 deletions
|
@ -56,4 +56,10 @@ async def test_registration(hass_client, authed_api_client): # noqa: F811
|
|||
assert resp.status == 200
|
||||
|
||||
webhook_json = await resp.json()
|
||||
assert webhook_json == {'rendered': 'Hello world'}
|
||||
assert 'encrypted_data' in webhook_json
|
||||
|
||||
decrypted_data = SecretBox(key).decrypt(webhook_json['encrypted_data'],
|
||||
encoder=Base64Encoder)
|
||||
decrypted_data = decrypted_data.decode("utf-8")
|
||||
|
||||
assert json.loads(decrypted_data) == {'rendered': 'Hello world'}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue