Fix some types

This commit is contained in:
Adrien Ferrand 2021-11-18 12:50:23 +01:00
parent 14f1f99352
commit 195c1957cb
2 changed files with 3 additions and 3 deletions

View file

@ -56,8 +56,8 @@ class Resource(jose.Field):
def __init__(self, resource_type: str, *args: Any, **kwargs: Any) -> None:
self.resource_type = resource_type
super().__init__(
'resource', default=resource_type, *args, **kwargs) # type: ignore[misc]
kwargs['default'] = resource_type
super().__init__('resource', *args, **kwargs)
def decode(self, value: Any) -> Any:
if value != self.resource_type:

View file

@ -14,7 +14,7 @@ class Header(jose.Header):
"""
nonce: bytes = jose.field('nonce', omitempty=True, encoder=jose.encode_b64jose)
kid: bytes = jose.field('kid', omitempty=True)
url: str = jose.field('url', omitempty=True)
url: bytes = jose.field('url', omitempty=True)
# Mypy does not understand the josepy magic happening here, and falsely claims
# that nonce is redefined. Let's ignore the type check here.