Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

broken dependencies #20

Open
MacCruiskeen opened this issue May 26, 2018 · 2 comments
Open

broken dependencies #20

MacCruiskeen opened this issue May 26, 2018 · 2 comments

Comments

@MacCruiskeen
Copy link

MacCruiskeen commented May 26, 2018

I've been trying to get this working and I think you have some issues with breaking changes in your dependencies. Right now I am stuck with the CBOR serializer not working. When Yosai is passing the session object to the serializer, I get

TypeError: init() got an unexpected keyword argument 'encoders'

What seems to be happening is that your serializer is creating encoders from the session object, and passing them to CBOR2, but CBOR2 no longer wants them, it will pull the encoders from its own default list. This is described in the CBOR2 docs as a backward incompatible change in the library.

@Dowwie
Copy link
Contributor

Dowwie commented Jun 6, 2018

@MacCruiskeen Please submit a pull request to remediate this so that others may benefit

@Tejaswini-Akula
Copy link

@Dowwie

I was facing the similar issue can u please help me in resolving it
Redis configuration:
CACHE_HANDLER:
init_config:
backend: 'yosai_dpcache.redis'
region_name: 'yosai_dpcache'
server_config:
redis:
url: 'redis://'
host: 'localhost'
port: 6379

error:

C:\Python_scripts\ldap_intigration\venv\Scripts\python.exe C:/Python_scripts/ldap_intigration/ldap_app/yosai_demo.py
C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\conf\yosaisettings.py:100: YAMLLoadWarning: calling yaml.load() without Loader=... is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
config = yaml.load(stream)
UsernamePasswordToken - walter, remember_me=False, (127.0.0.1)
Traceback (most recent call last):
File "C:/Python_scripts/ldap_intigration/ldap_app/yosai_demo.py", line 14, in
print(subject.login(authc_token))
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\subject\subject.py", line 397, in login
authc_token=authc_token)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\mgt\mgt.py", line 663, in login
authc_token)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\authc\authc.py", line 205, in authenticate_account
account = self.do_authenticate_account(authc_token)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\authc\authc.py", line 256, in do_authenticate_account
account = self.authenticate_single_realm_account(realms[0], authc_token)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\authc\authc.py", line 177, in authenticate_single_realm_account
return realm.authenticate_account(authc_token)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\realm\realm.py", line 216, in authenticate_account
account = self.get_authentication_info(identifier)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\realm\realm.py", line 183, in get_authentication_info
creator=self)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai_dpcache\cache\cachehandler.py", line 126, in get_or_create
expiration=ttl)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai_dpcache\cache\region.py", line 435, in get_or_create
with Lock(self._mutex(key), gen_value, get_value) as value:
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai_dpcache\dogpile\core\dogpile.py", line 121, in enter
return self._enter()
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai_dpcache\dogpile\core\dogpile.py", line 75, in _enter
generated = self._enter_create(createdtime)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai_dpcache\dogpile\core\dogpile.py", line 114, in _enter_create
created = self.creator()
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai_dpcache\cache\region.py", line 432, in gen_value
self.backend.set(key, created_value, expiration)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai_dpcache\cache\proxybackend.py", line 18, in set
serialized = self.serialize(value)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\serialize\serialize.py", line 66, in serialize
return self.serializer.serialize(obj)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\yosai\core\serialize\serializers\cbor.py", line 74, in serialize
return cbor2.dumps(obj, **self.encoder_options)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\cbor2\encoder.py", line 420, in dumps
dump(obj, fp, **kwargs)
File "C:\Python_scripts\ldap_intigration\venv\lib\site-packages\cbor2\encoder.py", line 434, in dump
CBOREncoder(fp, **kwargs).encode(obj)
TypeError: init() got an unexpected keyword argument 'encoders'

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants