jpadilla / pyjwt

JSON Web Token implementation in Python
https://pyjwt.readthedocs.io
MIT License
5.05k stars 676 forks source link

Make `Algorithm` an abstract base class #845

Closed Viicos closed 1 year ago

Viicos commented 1 year ago

Related: https://github.com/jpadilla/pyjwt/pull/843

Viicos commented 1 year ago

Failing because NoneAlgorithm isn't implementing to_jwk and from_jwk. One easy fix (but maybe not the best) would be to explicitly raise NotImplementedError for this algorithm in particular.

jpadilla commented 1 year ago

One easy fix (but maybe not the best) would be to explicitly raise NotImplementedError for this algorithm in particular.

@Viicos thanks! fwiw I'm not opposed to this.

Viicos commented 1 year ago

@jpadilla Do you think this could be merged? Then I'll probably work on fixing the known typing issues (hopefully will be doable without too much hassle)