Skip to content

Commit

Permalink
Comparable keys
Browse files Browse the repository at this point in the history
  • Loading branch information
mosquito committed Jan 6, 2025
1 parent 207dd0f commit 49b1847
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions jwt_rsa/token.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 49b1847

Please sign in to comment.