lpcmanager

Fix ThirdPartyPath
py2compat
20 months ago, Edouard Tisserant
85eef159a829
Fix ThirdPartyPath
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# XXX remove that crap, seriously
from connectors import WAMP
from autobahn.wamp import auth
class WampSession(WAMP.WampSession):
def onConnect(self):
self.join(u"Automation", [u"wampcra"], u"smarteh")
print("CRA checking ...")
def onChallenge(self, challenge):
if challenge.method == "wampcra":
key = auth.derive_key("smarteh", "salt123", 100, 16)
return auth.compute_wcs(key, challenge.extra['challenge'])
else:
raise Exception("don't know how to handle authmethod {}".format(challenge.method))