mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-11-12 20:40:21 +00:00
Add check for pwned secrets to resolution center (#2614)
* Add check for pwned secrets to resolution center * restructure check * add checks * Add test * Add test * reload secrets before check * simplify * create notification * Use own exceptions * Check on startup * Apply suggestions from code review Co-authored-by: Franck Nijhof <git@frenck.dev> * Add job decorator * Update supervisor/resolution/notify.py Co-authored-by: Franck Nijhof <git@frenck.dev> * Update supervisor/utils/pwned.py Co-authored-by: Franck Nijhof <git@frenck.dev> Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
@@ -166,6 +166,22 @@ def test_simple_device_schema(coresys):
|
||||
)({"name": "Pascal", "password": "1234", "input": "/dev/video1"})
|
||||
|
||||
|
||||
def test_simple_schema_password(coresys):
|
||||
"""Test with simple schema password pwned."""
|
||||
validate = AddonOptions(
|
||||
coresys,
|
||||
{"name": "str", "password": "password", "fires": "bool", "alias": "str?"},
|
||||
MOCK_ADDON_NAME,
|
||||
MOCK_ADDON_SLUG,
|
||||
)
|
||||
|
||||
assert validate(
|
||||
{"name": "Pascal", "password": "1234", "fires": True, "alias": "test"}
|
||||
)
|
||||
|
||||
assert validate.pwned == {"7110eda4d09e062aa5e4a390b0a572ac0d2c0220"}
|
||||
|
||||
|
||||
def test_ui_simple_schema(coresys):
|
||||
"""Test with simple schema."""
|
||||
assert UiOptions(coresys)(
|
||||
|
||||
Reference in New Issue
Block a user