mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 20:35:55 +00:00
Validate secrets on options/validate UI check (#2854)
* Validate secrets on options/validate UI check * Allow schema as payload * Update supervisor/api/addons.py Co-authored-by: Franck Nijhof <git@frenck.dev> * Offload into a module * using new function * disable check * fix options value * generated return value * add debug logging Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
@@ -14,26 +14,17 @@ async def test_evaluation(coresys: CoreSys):
|
||||
coresys.core.state = CoreState.RUNNING
|
||||
|
||||
assert sourcemods.reason not in coresys.resolution.unsupported
|
||||
with patch(
|
||||
"supervisor.resolution.evaluations.source_mods.EvaluateSourceMods.sys_verify_content",
|
||||
AsyncMock(side_effect=CodeNotaryUntrusted),
|
||||
):
|
||||
await sourcemods()
|
||||
assert sourcemods.reason in coresys.resolution.unsupported
|
||||
coresys.security.verify_own_content = AsyncMock(side_effect=CodeNotaryUntrusted)
|
||||
await sourcemods()
|
||||
assert sourcemods.reason in coresys.resolution.unsupported
|
||||
|
||||
with patch(
|
||||
"supervisor.resolution.evaluations.source_mods.EvaluateSourceMods.sys_verify_content",
|
||||
AsyncMock(side_effect=CodeNotaryError),
|
||||
):
|
||||
await sourcemods()
|
||||
assert sourcemods.reason not in coresys.resolution.unsupported
|
||||
coresys.security.verify_own_content = AsyncMock(side_effect=CodeNotaryError)
|
||||
await sourcemods()
|
||||
assert sourcemods.reason not in coresys.resolution.unsupported
|
||||
|
||||
with patch(
|
||||
"supervisor.resolution.evaluations.source_mods.EvaluateSourceMods.sys_verify_content",
|
||||
AsyncMock(),
|
||||
):
|
||||
await sourcemods()
|
||||
assert sourcemods.reason not in coresys.resolution.unsupported
|
||||
coresys.security.verify_own_content = AsyncMock()
|
||||
await sourcemods()
|
||||
assert sourcemods.reason not in coresys.resolution.unsupported
|
||||
|
||||
|
||||
async def test_did_run(coresys: CoreSys):
|
||||
|
||||
Reference in New Issue
Block a user