Fixes signing Create activities

and some tests for the base_model
This commit is contained in:
Mouse Reeve
2020-12-04 11:22:08 -08:00
parent 9989641f4c
commit 2e4aff90a3
3 changed files with 51 additions and 10 deletions

View File

@ -96,7 +96,7 @@ class ActivitypubMixin:
''' returns the object wrapped in a Create activity '''
activity_object = self.to_activity()
signer = pkcs1_15.new(RSA.import_key(user.private_key))
signer = pkcs1_15.new(RSA.import_key(user.key_pair.private_key))
content = activity_object['content']
signed_message = signer.sign(SHA256.new(content.encode('utf8')))
create_id = self.remote_id + '/activity'

View File

@ -44,11 +44,6 @@ class Status(OrderedCollectionPageMixin, BookWyrmModel):
)
objects = InheritanceManager()
@property
def ap_replies(self):
''' structured replies block '''
return self.to_replies()
activity_serializer = activitypub.Note
serialize_reverse_fields = ['attachments']