Skip to content

Saleor Core: the high performance, composable, headless commerce API.

types

Tomasz Magulski6111ba7ef8fd
diff --git a/saleor/core/jwt_manager.py b/saleor/core/jwt_manager.py
index f79fd1e643..cf30a3568f 100644
--- a/saleor/core/jwt_manager.py
+++ b/saleor/core/jwt_manager.py
@@ -33,6 +33,10 @@ class JWTManagerBase:
def encode(cls, payload: dict) -> str:
return NotImplemented
+ @classmethod
+ def jws_encode(cls, payload: bytes, is_payload_detached: bool = True) -> str:
+ return NotImplemented
+
@classmethod
def decode(cls, token: str, verify_expiration: bool = True) -> dict:
return NotImplemented
@@ -121,10 +125,10 @@ class JWTManager(JWTManagerBase):
)
@classmethod
- def jws_encode(cls, payload: bytes, is_payload_detached: bool = True) -> bytes:
+ def jws_encode(cls, payload: bytes, is_payload_detached: bool = True) -> str:
return api_jws.encode(
payload,
- key=cls.get_private_key(),
+ key=cls.get_private_key(), # type: ignore
algorithm="RS256",
headers={"kid": KID},
is_payload_detached=is_payload_detached,