Skip to content

Commit

Permalink
fix: fix for mypy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lepture committed Sep 6, 2023
1 parent c83166b commit 5528d7d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/joserfc/jwk.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def guess_key(key: KeyFlexible, obj: GuestProtocol, use_random: bool = False) ->
if rv_key is None:
raise ValueError("Invalid key")
rv_key.ensure_kid()
assert rv_key.kid is not None # for mypy
obj.set_kid(rv_key.kid)
else:
rv_key = key.get_by_kid(kid)
Expand Down
4 changes: 2 additions & 2 deletions src/joserfc/rfc7517/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def import_from_bytes(cls, value: bytes, password: t.Optional[t.Any] = None) ->
@staticmethod
def as_bytes(
key: GenericKey,
encoding: t.Optional[str] = None,
encoding: t.Optional[t.Literal["PEM", "DER"]] = None,
private: t.Optional[bool] = None,
password: t.Optional[str] = None) -> bytes:
raise NotImplementedError()
Expand Down Expand Up @@ -287,7 +287,7 @@ def raw_value(self) -> t.Union[NativePublicKey, NativePrivateKey]:

def as_bytes(
self,
encoding: t.Optional[str] = None,
encoding: t.Optional[t.Literal["PEM", "DER"]] = None,
private: t.Optional[bool] = None,
password: t.Optional[str] = None) -> bytes:
return self.binding.as_bytes(self, encoding, private, password)
Expand Down

0 comments on commit 5528d7d

Please sign in to comment.