benchling_sdk.apps.config.decryption_provider module

class BaseDecryptionProvider

Bases: abc.ABC

Provides a way to decrypt encrypted messages.

Various implementations might use AWS KMS, Azure, etc.

abstract decrypt(ciphertext: str) str

Decrypt secrets.

Receives encrypted cipher text and returns the decrypted plain text.

class BaseKeyUnwrappingDecryptionProvider

Bases: benchling_sdk.apps.config.decryption_provider.BaseDecryptionProvider

A decryption provider that will unwrap the key received from Benchling.

Generally prefer extending this to BaseDecryptionProvider, unless you need to unwrap the key received from Benchling yourself.

__init__(charset: str = 'utf-8')

Init BaseKeyUnwrappingDecryptionProvider.

decrypt(ciphertext: str) str

Decrypt.

Implement BaseDecryptionProvider’s decrypt. Unwraps the encrypted payload from Benchling and will delegate to unwrap_key() to fetch the key decrypting key to then decrypt the secret.

abstract unwrap_key(wrapped_key: bytes) bytes

Unwrap Key.

Accepts the wrapped key and decrypts the unwrapped key to use for data decryption from a provider such as AWS KMS, Azure, etc.