pyauthorizer.encryptor.builtin package

Submodules

pyauthorizer.encryptor.builtin.multiple module

class pyauthorizer.encryptor.builtin.multiple.MultiEncryptor[source]

Bases: BaseEncryptor

decrypt(token)[source]

Decrypts a token and returns the token data as a dictionary.

Parameters:

token (Token) – The token to be decrypted.

Returns:

The decrypted token data.

Return type:

dict

encrypt(data)[source]

Encrypts the given data using a set of secret keys.

Parameters:

data (dict) – The data to be encrypted.

Returns:

A tuple containing the secret key and the encrypted token.

Return type:

Tuple[str, str]

pyauthorizer.encryptor.builtin.simple module

class pyauthorizer.encryptor.builtin.simple.SimpleEncryptor[source]

Bases: BaseEncryptor

decrypt(token)[source]

Decrypts the given token and returns the token data as a dictionary.

Parameters:

token (Token) – The token to be decrypted.

Returns:

The decrypted token data as a dictionary.

Return type:

dict

encrypt(data)[source]

Encrypts the provided data.

Parameters:

data (dict) – The data to be encrypted.

Returns:

A tuple containing the secret key and the encrypted token.

Return type:

Tuple[str, str]