Get LVSP secret fron config.py

This commit is contained in:
Evie Viau 2022-02-17 22:52:45 -05:00
parent 70a0379615
commit 21e9b782a4
No known key found for this signature in database
GPG Key ID: DBCFB51C41FF87FF
1 changed files with 6 additions and 8 deletions

View File

@ -103,17 +103,15 @@ class LVSPConnection:
"""Handle HELLO message."""
data = msg["d"]
nonce = data['nonce']
self._hb_interval = data["heartbeat_interval"]
# actually do this
shared_secret = "deez nutz"
deez = hmac.new(shared_secret.encode(), nonce.encode(), hashlib.sha256).hexdigest()
token = hmac.new(
self.app.config.get("LVSP_SECRET").encode(),
data["nonce"].encode(),
hashlib.sha256,
).hexdigest()
await self.send_op(OP.identify, {
"token": deez
})
await self.send_op(OP.identify, {"token": token})
async def _update_health(self, new_health: float):
"""Update the health value of a given voice server."""