我正在子类化WampCraServerProtocol
(来自autobahnpython)并重写{
def getAuthSecret(self, authKey):
deferred = Deferred()
deferred.callback("secret")
return deferred
。。。我的WampCraClientProtocol
上出现以下错误:
Authentication Error! http://api.wamp.ws/error#generic Deferred instance has no attribute '__len__' None
好吧,光是这一点就已经令人困惑了。对getAuthSecret
返回的延迟是否有特殊要求?在
好的,继续,基于这个错误,我在返回的deferred中添加了一个(普通的)len方法:
^{pr2}$。。。在这种情况下,我得到:
Authentication Error! http://api.wamp.ws/error#generic unsupported operand type(s) for +: 'instance' and 'str' None
这让我更加困惑。 我只想知道从该方法返回延迟的正确方法。 (我应该注意,如果返回一个简单的字符串,那么一切都会完美地工作)。 谢谢。在
这对我有用:
https://github.com/tavendo/AutobahnPython/blob/master/examples/wamp/authentication/server.py#L72
你用的是什么版本的AutobahnPython?在
更新:
v0.5.9在基于延迟的身份验证方面有一个bug(见下面的注释)。它被固定在v0.5.14上。Wamp-Cra基于延迟的身份验证在该版本上运行良好。在
相关问题 更多 >
编程相关推荐