mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-20 10:28:45 +00:00
Check password early on backup restore (#5519)
Introduce a validate password method which only peaks into the archive to validate the password before starting the actual restore process. This makes sure that a wrong password returns an error even when restoring the backup in background.
This commit is contained in:
@@ -478,7 +478,7 @@ async def test_restore_immediate_errors(
|
||||
|
||||
with (
|
||||
patch.object(Backup, "protected", new=PropertyMock(return_value=True)),
|
||||
patch.object(Backup, "set_password", return_value=False),
|
||||
patch.object(Backup, "validate_password", return_value=False),
|
||||
):
|
||||
resp = await api_client.post(
|
||||
f"/backups/{mock_partial_backup.slug}/restore/partial",
|
||||
|
||||
Reference in New Issue
Block a user