actinia-core icon indicating copy to clipboard operation
actinia-core copied to clipboard

replace deprecated (Timed)JSONWebSignatureSerializer

Open metzm opened this issue 1 year ago • 2 comments

Fixes #345

This PR proposes to use jwt instead of itsdangerous to 1) no longer use a deprecated component, 2) solve python lib conflicts with the actinia-stac plugin. (Timed)JSONWebSignatureSerializer uses by default HS512 as hash algorithm, therefore this PR also uses this algorithm with jwt, in the hope that existing API keys are still recognized as valid keys.

metzm avatar Oct 14 '22 16:10 metzm

Test failure: /src/actinia_core/tests/test_login.py:307: AssertionError: 400 != 200 : HTML status code is wrong 400

metzm avatar Oct 14 '22 17:10 metzm

The AttributeError: module 'jwt' has no attribute 'decode' is strange because of https://pyjwt.readthedocs.io/en/stable/api.html#jwt.decode Same for AttributeError: module 'jwt.exceptions' has no attribute 'DecodeError' Which version of PyJWT are you using?

This is even more strange because all PR tests are passed.

metzm avatar Oct 25 '22 17:10 metzm

Sorry, I installed the wrong module :see_no_evil: With the correct one, everything works fine, so sorry for the noise.

mmacata avatar Oct 26 '22 08:10 mmacata

Really cool, that we can keep this funtionality. @anikaweinmann does this interfere in any way with the keycloak implementation? And I am not sure if it is backwards-compatible. Therefore it might make sense to make a major version update? What do you think?

I moved maybe some parts in a base class, but does not change things in the functions. I am also not sure if it is backwards-compatible.

anikaweinmann avatar Oct 26 '22 13:10 anikaweinmann