Speedup HA core auth (#2144)

* Speedup HA core auth

* Add reset API call

* use delete

* Add complexe cache logic

* Allow manage api to handle auth reset/cache

* revert to only cache

* add tests

* ignore protected-access for this tests

* fix comment
This commit is contained in:
Pascal Vizeli
2020-10-19 16:38:28 +02:00
committed by GitHub
parent 7a1d85ca2b
commit 9c53caae80
6 changed files with 131 additions and 5 deletions

View File

@@ -86,3 +86,8 @@ class APIAuth(CoreSysAttributes):
await asyncio.shield(
self.sys_auth.change_password(body[ATTR_USERNAME], body[ATTR_PASSWORD])
)
@api_process
async def cache(self, request: web.Request) -> None:
"""Process cache reset request."""
self.sys_auth.reset_data()