crossbario / crossbario/autobahn-python
Examples: auth/backend.py is calling add_authenticator incorrectly
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
Looks like the API has changed and it needs to call add_authenticator(...) with a IAuthenticator instance and not (u"wampcra", authid="xxxx", secret="xxxx").
python examples/twisted/wamp/auth/backend.py
2019-11-08T21:10:47+0800 ApplicationSession could not be instantiated: add_authenticator() got an unexpected keyword argument 'authid'
2019-11-08T21:10:47+0800 Traceback (most recent call last):
File "/home/Projects/venv11/lib64/python3.7/site-packages/autobahn/wamp/websocket.py", line 60, in onOpen
self._session = self.factory._factory()
File "/home/Projects/venv11/lib64/python3.7/site-packages/autobahn/twisted/wamp.py", line 244, in create
session = make(cfg)
File "examples/twisted/wamp/auth/backend.py", line 53, in make
u"wampcra", authid=u'username', secret=u'p4ssw0rd'
TypeError: add_authenticator() got an unexpected keyword argument 'authid'
2019-11-08T21:10:47+0800 failing WebSocket connection (code=1011): "WAMP Internal Error (add_authenticator() got an unexpected keyword argument 'authid')"
2019-11-08T21:10:47+0800 Main loop terminated.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in examples/twisted/wamp/auth/backend.py at make, where add_authenticator is called, and compare that call with the current add_authenticator API and IAuthenticator usage. Update the example so it no longer passes authid and secret as keyword arguments, then run the example and confirm the reported TypeError is gone.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- authentication
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100