Remove no longer needed auth.util, use secrets instead (#29861)
This commit is contained in:
1 parent
c58c10ab7c
commit
130571c478
11 files changed
+24
-34
No files matched your search
@@ -1,11 +1,11 @@
|
||||
"""Authentication for HTTP component."""
|
||||
import logging
|
||||
import secrets
|
||||
|
||||
from aiohttp import hdrs
|
||||
from aiohttp.web import middleware
|
||||
import jwt
|
||||
|
||||
from homeassistant.auth.util import generate_secret
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
@@ -26,7 +26,7 @@ def async_sign_path(hass, refresh_token_id, path, expiration):
|
||||
secret = hass.data.get(DATA_SIGN_SECRET)
|
||||
|
||||
if secret is None:
|
||||
secret = hass.data[DATA_SIGN_SECRET] = generate_secret()
|
||||
secret = hass.data[DATA_SIGN_SECRET] = secrets.token_hex()
|
||||
|
||||
now = dt_util.utcnow()
|
||||
return "{}?{}={}".format(
|
||||
|
||||
Reference in new issue
Block a user