mirror of https://gitlab.com/litecord/litecord.git
Get LVSP secret fron config.py
This commit is contained in:
parent
70a0379615
commit
21e9b782a4
|
|
@ -103,17 +103,15 @@ class LVSPConnection:
|
||||||
"""Handle HELLO message."""
|
"""Handle HELLO message."""
|
||||||
data = msg["d"]
|
data = msg["d"]
|
||||||
|
|
||||||
nonce = data['nonce']
|
|
||||||
|
|
||||||
self._hb_interval = data["heartbeat_interval"]
|
self._hb_interval = data["heartbeat_interval"]
|
||||||
|
|
||||||
# actually do this
|
token = hmac.new(
|
||||||
shared_secret = "deez nutz"
|
self.app.config.get("LVSP_SECRET").encode(),
|
||||||
deez = hmac.new(shared_secret.encode(), nonce.encode(), hashlib.sha256).hexdigest()
|
data["nonce"].encode(),
|
||||||
|
hashlib.sha256,
|
||||||
|
).hexdigest()
|
||||||
|
|
||||||
await self.send_op(OP.identify, {
|
await self.send_op(OP.identify, {"token": token})
|
||||||
"token": deez
|
|
||||||
})
|
|
||||||
|
|
||||||
async def _update_health(self, new_health: float):
|
async def _update_health(self, new_health: float):
|
||||||
"""Update the health value of a given voice server."""
|
"""Update the health value of a given voice server."""
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue