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.
Entities with `raw_content` now also contain a `_media_type` and
`rendered_content`.
The default `_media_type` is `text/markdown` except for ActivityPub
originating posts it defaults to `text/html`. If the ActivityPub
payload contains a `source`, that mediaType will be used instead.
Entities processed by inbound mappers will now have a list of
receivers in `_receivers`. This replaces the
`_receiving_actor_id` which was previously set for Diaspora entities.
UserType now has a `receiver_variant` which is one of `ReceiverVariant`
enum. `ACTOR` means this receiver is a single actor ID.
`FOLLOWERS` means this is the followers of the ID in the receiver.
Contains terrible hack to figure out if ActivityPub to/cc contains
a reference to the followers collection of the sender 🙈 . Will replace
"later" with proper fetch+cache solution, once we have a cache.
Refs: https://git.feneas.org/socialhome/socialhome/issues/522
Retraction produces a { Delete { Tombstone }} and receiving
one produces a Retraction. Retraction.entity_type is set as
"Object" since we don't know it just by looking at the payload.
Added support for Diaspora `Comment` entity `thread_parent_guid`
attribute.
Added `root_target_id` and `root_target_guid` to `Comment` base entity.
This allows referring to a parent object up the hierarchy chain for
threaded comments.
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`.
With two elements, `private` and `public`. These should be URL's
indicating where to send payloads for the recipient.
ActivityPub profiles will parse these values from incoming profile
documents. Diaspora entities will default to the inboxes in the
specification.
The ActivityPub protocol handlers require access to HTTP headers,
method and url from the incoming request. Thus require passing in
a RequestType object, which has the same structure as a Django
HttpRequest for compatibility.
This is a breaking backwards compatible change requiring Diaspora
payloads be wrapped in a RequestType object.
Refs: #7
This is a more up to date fork of the former. This fixes CVE-2018-6594 found in the former.
**Deployment note.** When updating an application, you *must* uninstall `pycrypto` first, otherwise there will be a conflict if both the versions are installed at the same time. To uninstall, do `pip uninstall pycrypto`.
Release 0.17.0
Previously only `first_name` was used when creating the `Profile.name`
value. Now both `first_name` and `last_name` are used.
When creating outgoing payloads, the `Profile.name` will still be placed
in `first_name` to avoid trying to artificially split it.
Network utils has a method `fetch_host_ip_and_country` which will
fetch both. The country fetching uses the `ip-api.com` free service
to resolve country information.
We've already accepted these on incoming payloads for a long time and so do all the other platforms now, so now we always send out entities with the new property names. This can break federation with really old servers that don't understand these keys yet.
Closes#59
Change unquote method used when preparing Diaspora XML payloads for verification.
Some platforms deliver payloads not using the urlsafe base64 standard which caused problems when validating the unquoted signature. Ensure maximum compatibility by allowing non-standard urlsafe quoted payloads.
Closes#115
Also provided is a Django view and url configuration for easy addition into Django projects. Django is not a hard dependency of this library, usage of the Django view obviously requires installing Django itself. For configuration details see documentation.
Closes#108
This adds possibility for private message support.
JSON encrypted payload encryption and decryption is handled by the Diaspora `EncryptedPayload` class.
Refs: #82