Serializers

Serializers for the django-e2ee-framework app.

Classes:

BulkCreateListSerializer(*args, **kwargs)

EncryptionKeySecretSerializer(*args, **kwargs)

A serialializer for e2ee.EncryptionKeySecret.

EncryptionKeySerializer(*args, **kwargs)

A serialializer for e2ee.EncryptionKey.

MasterKeySecretSerializer(*args, **kwargs)

A serialializer for e2ee.MasterKeySecret.

MasterKeySerializer(*args, **kwargs)

A serialializer for e2ee.MasterKey.

SessionKeySerializer(*args, **kwargs)

A serialializer for e2ee.SessionKey.

class django_e2ee.serializers.BulkCreateListSerializer(*args, **kwargs)

Bases: ListSerializer

Methods:

create(validated_data)

create(validated_data)
class django_e2ee.serializers.EncryptionKeySecretSerializer(*args, **kwargs)

Bases: ModelSerializer

A serialializer for e2ee.EncryptionKeySecret.

Classes:

Meta()

Methods:

create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

class Meta

Bases: object

Attributes:

fields

read_only_fields

Classes:

list_serializer_class

alias of BulkCreateListSerializer

Models:

model

alias of EncryptionKeySecret

fields = ['encryption_key', 'encrypted_with', 'secret', 'signature', 'signed_by']
list_serializer_class

alias of BulkCreateListSerializer Methods:

create(validated_data)

model

alias of EncryptionKeySecret Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Model Fields:

encrypted_with

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

encryption_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

id

A wrapper for a deferred-loading field.

secret

A wrapper for a deferred-loading field.

signature

A wrapper for a deferred-loading field.

signed_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

Attributes:

encrypted_with_id

encryption_key_id

objects

signed_by_id

read_only_fields = ['encryption_key', 'signed_by']
create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class django_e2ee.serializers.EncryptionKeySerializer(*args, **kwargs)

Bases: ModelSerializer

A serialializer for e2ee.EncryptionKey.

Classes:

Meta()

Methods:

create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

class Meta

Bases: object

Attributes:

fields

Models:

model

alias of EncryptionKey

fields = ['uuid']
model

alias of EncryptionKey Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Model Fields:

created_by

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

uuid

A wrapper for a deferred-loading field.

Attributes:

created_by_id

encryptionkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

master_keys

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

objects

create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class django_e2ee.serializers.MasterKeySecretSerializer(*args, **kwargs)

Bases: ModelSerializer

A serialializer for e2ee.MasterKeySecret.

Classes:

Meta()

Methods:

create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

class Meta

Bases: object

Attributes:

fields

Models:

model

alias of MasterKeySecret

fields = ['identifier', 'secret', 'signing_secret', 'salt', 'iv', 'uuid']
model

alias of MasterKeySecret Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Model Fields:

identifier

A wrapper for a deferred-loading field.

iv

A wrapper for a deferred-loading field.

master_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

salt

A wrapper for a deferred-loading field.

secret

A wrapper for a deferred-loading field.

signing_secret

A wrapper for a deferred-loading field.

uuid

A wrapper for a deferred-loading field.

Attributes:

master_key_id

objects

create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class django_e2ee.serializers.MasterKeySerializer(*args, **kwargs)

Bases: ModelSerializer

A serialializer for e2ee.MasterKey.

Classes:

Meta()

Methods:

create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

class Meta

Bases: object

Attributes:

fields

read_only_fields

Models:

model

alias of MasterKey

fields = ['pubkey', 'signing_pubkey', 'user']
model

alias of MasterKey Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Attributes:

encryptionkey_set

Accessor to the related objects manager on the forward and reverse sides of a many-to-many relation.

encryptionkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

masterkeysecret_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

objects

pubkey_loaded

The pubkey loaded via cryptography

sessionkey_set

Accessor to the related objects manager on the reverse side of a many-to-one relation.

signed_secrets

Accessor to the related objects manager on the reverse side of a many-to-one relation.

signing_pubkey_loaded

The pubkey loaded via cryptography

user_id

Model Fields:

pubkey

A wrapper for a deferred-loading field.

signing_pubkey

A wrapper for a deferred-loading field.

user

Accessor to the related object on the forward side of a one-to-one relation.

read_only_fields = ['user']
create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.

class django_e2ee.serializers.SessionKeySerializer(*args, **kwargs)

Bases: ModelSerializer

A serialializer for e2ee.SessionKey.

Classes:

Meta()

Methods:

create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

class Meta

Bases: object

Attributes:

fields

read_only_fields

Models:

model

alias of SessionKey

fields = ['session', 'session_secret', 'secret', 'signing_secret', 'iv', 'ignore']
model

alias of SessionKey Miscellaneous:

DoesNotExist

MultipleObjectsReturned

Methods:

get_absolute_url()

Model Fields:

ignore

A wrapper for a deferred-loading field.

iv

A wrapper for a deferred-loading field.

master_key

Accessor to the related object on the forward side of a many-to-one or one-to-one (via ForwardOneToOneDescriptor subclass) relation.

secret

A wrapper for a deferred-loading field.

session

Accessor to the related object on the forward side of a one-to-one relation.

session_secret

A wrapper for a deferred-loading field.

signing_secret

A wrapper for a deferred-loading field.

Attributes:

master_key_id

objects

session_id

read_only_fields = ['session']
create(validated_data)

We have a bit of extra checking around this in order to provide descriptive messages when something goes wrong, but this method is essentially just:

return ExampleModel.objects.create(**validated_data)

If there are many to many fields present on the instance then they cannot be set until the model is instantiated, in which case the implementation is like so:

example_relationship = validated_data.pop(‘example_relationship’) instance = ExampleModel.objects.create(**validated_data) instance.example_relationship = example_relationship return instance

The default implementation also does not handle nested relationships. If you want to support writable nested relationships you’ll need to write an explicit .create() method.