From 49b1847d5e3a1ec81bd733b72cfbcbb4e15d82d3 Mon Sep 17 00:00:00 2001 From: Dmitry Orlov Date: Mon, 6 Jan 2025 09:23:41 +0100 Subject: [PATCH] Comparable keys --- jwt_rsa/token.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jwt_rsa/token.py b/jwt_rsa/token.py index 4db49a0..a0ae2d1 100644 --- a/jwt_rsa/token.py +++ b/jwt_rsa/token.py @@ -45,7 +45,7 @@ def date_to_timestamp( @dataclass(frozen=True, init=False) class JWTDecoder: jwt: PyJWT = field(repr=False, compare=False) - public_key: RSAPublicKey = field(repr=False, compare=False) + public_key: RSAPublicKey = field(repr=False, compare=True) expires: Union[int, float] nbf_delta: Union[int, float] algorithm: AlgorithmType @@ -73,7 +73,7 @@ def decode(self, token: str, verify: bool = True, **kwargs: Any) -> Dict[str, An @dataclass(frozen=True, init=False) class JWTSigner(JWTDecoder): - private_key: RSAPrivateKey = field(repr=False, compare=False) + private_key: RSAPrivateKey = field(repr=False, compare=True) def __init__(self, key: RSAPrivateKey, *, options: Optional[Dict[str, Any]] = None, **kwargs: Any): super(JWTDecoder, self).__setattr__('private_key', key)