Add Notify MFA module (#16314)

* Add Notify MFA

* Fix unit test

* Address review comment, change storage implementation

* Add retry limit to mfa module

* Fix loading

* Fix invalaid login log processing

* Typing

* Change default message template

* Change one-time password to 8 digit

* Refactoring to not save secret

* Bug fixing

* Change async_initialize method name to aysnc_initialize_login_mfa_step

* Address some simple fix code review comment
This commit is contained in:
Jason Hu authored and Paulus Schoutsen committed 2018-09-24 11:06:50 +02:00
1 parent ad47ece5c6
commit 7a77951bb4
16 files changed
+799 -24

No files matched your search

+3 -3
View File
@@ -17,7 +17,7 @@ async def test_validating_mfa(hass):
await totp_auth_module.async_setup_user('test-user', {})
with patch('pyotp.TOTP.verify', return_value=True):
assert await totp_auth_module.async_validation(
assert await totp_auth_module.async_validate(
'test-user', {'code': MOCK_CODE})
@@ -29,7 +29,7 @@ async def test_validating_mfa_invalid_code(hass):
await totp_auth_module.async_setup_user('test-user', {})
with patch('pyotp.TOTP.verify', return_value=False):
assert await totp_auth_module.async_validation(
assert await totp_auth_module.async_validate(
'test-user', {'code': MOCK_CODE}) is False
@@ -40,7 +40,7 @@ async def test_validating_mfa_invalid_user(hass):
})
await totp_auth_module.async_setup_user('test-user', {})
assert await totp_auth_module.async_validation(
assert await totp_auth_module.async_validate(
'invalid-user', {'code': MOCK_CODE}) is False