Wykres commitów

28 Commity (e5dd3db0dc4687e46a796ec0d47ab820583a4d43)

Autor SHA1 Wiadomość Data
Jason Robinson da2d436fdf Allow UserType.private_key to be passed in as a string
This allows the UserType object to be serialized to for example
redis based background workers.

To get the real RsaKey object, use the UserType.rsa_private_key
property.
2019-08-29 22:50:57 +03:00
Jason Robinson 9ef0fd4547 Fix calling pre_send 2019-08-18 03:20:35 +03:00
Jason Robinson 2547a4d38c Don't fail whole send process on failure to sign diaspora public payload
In the case that the root content is from ActivityPub world, sending
a reply for it wont currently work due to the problem of signing
the reply by the author, as there is no target guid to refer to.

We should fix this with various compatibility layers but for now
just raise an error in the log and continue to send to the activitypub
receivers.
2019-08-11 23:21:47 +03:00
Jason Robinson b3b592385c Make AP 'to' always a list 2019-08-11 01:29:30 +03:00
Jason Robinson 579a9e7bf7 Add cc "fid" to outbound activitypub payloads 2019-06-22 02:15:24 +03:00
Jason Robinson 36ad691ccd Add "to" to "object" in outbound AP payloads, if object is a dict 2019-06-22 01:31:50 +03:00
Jason Robinson d4cbbc5e77 Add endpoint to handle_send recipients dictionary 2019-06-21 01:33:16 +03:00
Jason Robinson f0c96b86f3 Make AP public delivery "to" a list 2019-06-21 00:34:26 +03:00
Jason Robinson b5d739f00a Mark ActivityPub entity as public if public namespace in receivers 2019-06-21 00:34:26 +03:00
Jason Robinson dc8edbc7e6 Refactor handle_send function recipients and delivery code
The outbound function `outbound.handle_send` parameter `recipients`
structure has changed. It must now be a list of dictionaries,
containing at minimum the following: `fid` for the recipient endpoint,
`protocol` for the protocol to use and `public` as a boolean whether
the payload should be treated as visible to anyone.

For Diaspora private deliveries, also a `public_key` is required
containing the receiver public key. Note that passing in handles as
recipients is not any more possible - always pass in a url for `fid`.
2019-03-17 19:39:55 +02:00
Jason Robinson 9df3fe5c1a Use correct content type when sending ActivityPub payloads 2019-03-17 04:36:27 +02:00
Jason Robinson dc3412d358 Try fix delivery via AP by encoding payload 2019-03-17 04:09:15 +02:00
Jason Robinson 72bca93215 Tweak handle_send to send AP payloads for now for each recipient
Need to refactor code a bit to deliver shared inbox + add the
public receiver in a sane way.
2019-03-17 03:23:41 +02:00
Jason Robinson 31ae219426 Add authentication to outbound payloads for ActivityPub targets 2019-03-17 03:18:07 +02:00
Jason Robinson 2fb2da6955 Work on ActivityPub HTTP signatures and payload delivery
Also removes some legacy cruft for the failed Diaspora URI's as ID's experiment.

Refs: #7
2019-03-06 22:42:33 +02:00
Jason Robinson 6bd0a1a3ae Refactoring to not use diaspora URL's as ID's
Instead use handle or guid, whichever is relevant. Fill all attributes
on receive, expect necessary attributes on send (if supporting
diaspora).
2018-09-02 23:59:53 +03:00
Jason Robinson f744c6635d Fix type hinting problems due to pycryptodome move 2018-08-11 23:56:46 +03:00
Jason Robinson db049c6638 Fix RSA object usage in type hints
It seems little-boxes replaced our crypto library which caused
a bit of a mayhem since some of the internal objects don't match.
If we need that library after all, will need to drop these type
hints.
2018-08-11 23:41:15 +03:00
Jason Robinson 493ee7bf22 Refactoring of diaspora protocol support to use ID's everywhere
Entities no longer have `handle` or `guid`, `target_guid` or
`target_handle` attributes. These are
now properties on the Diaspora entities only. For working with
entities, the new URI based attributes should be used. These are
`id`, `target_id` and `actor_id`. Depending on entity type, some
of these will be required while some not (just like with handle,
guid, target_guid and target_handle before).

All high level methods now expect ID's and return ID's for everything.
Internally the diaspora protocol still works with handle's and guid's.

This opens adding ActivityPub which works with URI ID's everywhere.
2018-08-11 23:41:15 +03:00
Jason Robinson 72a72873cd Send Diaspora payloads with correct content type
Refs: #82
2018-02-19 23:14:42 +02:00
Jason Robinson ea0bd811df Add some extra logging to handle_send 2018-02-18 23:01:48 +02:00
Jason Robinson 77fb555a52 Refactor handle_send function
Now handle_send high level outbound helper function also allows delivering
private payloads using the Diaspora protocol.

Refs: #82
2018-02-13 23:06:19 +02:00
Jason Robinson 977c584d96 Refactor handle_send and handle_create_payload signatur
**Breaking change.** The high level `federation.outbound` functions `handle_send` and `handle_create_payload` signatures have been changed. This has been done to better represent the objects that are actually sent in and to add an optional `parent_user` object.

For both functions the `from_user` parameter has been renamed to `author_user`. Optionally a `parent_user` object can also be passed in. Both the user objects must have `private_key` and `handle` attributes. In the case that `parent_user` is given, that user will be used to sign the payload and for Diaspora relayables an extra `parent_author_signature` in the payload itself.
2017-07-29 13:43:35 +03:00
Jason Robinson 8478d3b90c Add handle_send outbound helper
Allows sending a single entity to multiple receivers. Currently public Diaspora entities supported.
2017-05-07 21:28:56 +03:00
Jason Robinson ce9c3c7ba4 Add create relayable signature method
Includes backwards incompatible changes when creating outbound entities.
2017-05-01 00:42:45 +03:00
Jason Robinson 4edca37168 Init documentation
Closes #34
2016-10-02 23:07:39 +03:00
Jason Robinson c8f436cd4e Make to_user optional in handle_create_payload
Public content does not require a recipient.
2016-09-05 22:09:08 +03:00
Jason Robinson 7b458b7fc7 Split federation.controllers to inbound and outbound 2016-07-23 13:37:56 +03:00