Skip to content

Commit

Permalink
python3.9 compat
Browse files Browse the repository at this point in the history
  • Loading branch information
byewokko committed Feb 21, 2025
1 parent 1acc913 commit 7babe13
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion asab/web/auth/providers/key_providers/abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def reload_keys(self):
raise NotImplementedError()


def _set_keys(self, keys: typing.Optional[jwcrypto.jwk.JWK | jwcrypto.jwk.JWKSet]):
def _set_keys(self, keys: typing.Optional[typing.Union[jwcrypto.jwk.JWK, jwcrypto.jwk.JWKSet]]):
"""
Update public key set and notify all auth providers that use this key provider.
Expand Down
4 changes: 2 additions & 2 deletions asab/web/auth/providers/key_providers/static.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class StaticPublicKeyProvider(PublicKeyProviderABC):

def __init__(
self, app, *,
public_key: typing.Optional[jwcrypto.jwk.JWK | jwcrypto.jwk.JWKSet] = None
public_key: typing.Optional[typing.Union[jwcrypto.jwk.JWK, jwcrypto.jwk.JWKSet]] = None
):
super().__init__(app)
if public_key is not None:
self.set_public_key(public_key)


def set_public_key(self, public_key: jwcrypto.jwk.JWK | jwcrypto.jwk.JWKSet):
def set_public_key(self, public_key: typing.Union[jwcrypto.jwk.JWK, jwcrypto.jwk.JWKSet]):
"""
Directly set key (or key set) to be used for auth validation.
Expand Down

0 comments on commit 7babe13

Please sign in to comment.