class CryptographyManagerType(Protocol):
"""Abstract cryptography manager"""
def encrypt(self, data: str) -> bytes: ...
def decrypt(self, data: bytes) -> str: ...
is incompatible with FileSystemTokenBackend write and read operations. These operations expect text (strings) not bytes.
Cryptography manager with
def encrypt(self, data: str) -> str: ...
def decrypt(self, data: str) -> str: ...
works fine.