Wykres commitów

141 Commity (c90d8a72e0fae85e83b49a4e66de7f7ad5b35d8c)

Autor SHA1 Wiadomość Data
Jason Robinson c90d8a72e0 Some clarifications for the docs and readme 2019-10-06 01:57:24 +03:00
Jason Robinson c997a1a2b4 Ensure diaspora mention is extracted even without display name part 2019-09-08 02:03:06 +03:00
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 b17f5b5823 Host meta fetchers now support NodeInfo 2.1
This seems unreleased, and doesn't really add anything useful,
but just seen it in the wild.
2019-08-25 23:13:57 +03:00
Jason Robinson 61a0fc442b Add media type and rendered content to entities with raw_content
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.
2019-08-18 22:37:18 +03:00
Jason Robinson e670f882f8 Fix and document the pyfed namespace 2019-08-18 19:56:08 +03:00
Jason Robinson 9e536c8f2b Changelog for Image entity refactor 2019-08-17 18:21:23 +03:00
Jason Robinson f41b2fb9d8 Add ActivityPub support for retrieve_remote_content fetcher 2019-08-06 00:53:27 +03:00
Jason Robinson 41637e7688 Add receivers in mappers to inbound entities
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
2019-08-04 17:41:08 +03:00
Jason Robinson 80cce66734 Add support for Retraction to/from ActivityPub
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.
2019-07-21 01:35:35 +03:00
Jason Robinson 1e757ca43b Add support for root parent for Comment entity
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.
2019-07-15 00:09:53 +03:00
Jason Robinson a2c2d55a03 Changelog change for outbound handle_send parameters change 2019-06-26 00:01:12 +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 80c4e433d7 Entities of type `Profile` now have a dictionary of `inboxes`
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.
2019-03-17 16:09:34 +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 2fa8271af7 Refactor handle_receive to require a RequestType
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
2019-03-03 03:04:08 +02:00
Jason Robinson dbaae4842b Changelog for the various changes 2019-03-02 23:52:09 +02:00
Jason Robinson 5baa0b5fe6 Added network utility `network.fetch_host_ip` to fetch IP by hostname 2019-02-13 23:05:10 +02:00
Jason Robinson c3f59e832e Change activitypub_object_view get_object_function call signature
Pass now full request object instead of the object ID. This allows
the app to check permissions for the object.
2018-10-10 22:43:17 +03:00
Jason Robinson 6dd20c3521 Simplify process_payload call by passing in just request 2018-10-09 22:53:54 +03:00
Jason Robinson aff1a8e59e Tweak activitypub_object_view process_payload call signature
Now passes `response.content` as is and also passes in the request
object.
2018-10-09 22:46:23 +03:00
Jason Robinson 17c23b3be8 Django activitypub_object_view now processes POST to /inbox/ 2018-10-09 22:24:46 +03:00
Jason Robinson cae76b3da8 Add changelog entries for recent changes 2018-09-30 20:50:32 +03:00
Jason Robinson ceb5d0446e Add support for AS2 document webfinger rel used by Mastodon et al
Also fix reference to RFC by renaming RFC3033 to RFC7033 :P
2018-09-30 16:20:03 +03:00
Jason Robinson 2be12c356d Changelogs for changes 2018-09-24 23:13:39 +03:00
Jason Robinson 258a067412 Merge branch 'master' into patch-017 2018-08-11 21:50:35 +03:00
Jason Robinson bc38ac990b Switch crypto library `pycrypto` to `pycryptodome`
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
2018-08-11 21:47:16 +03:00
Jason Robinson 454dc8ccbc Drop compatibility for Python <= 3.5 2018-07-23 18:33:47 +03:00
Jason Robinson 6cbe9cee9d Start new development cycle 2018-07-23 18:32:54 +03:00
Jason Robinson afee56cac6 Release 0.16.0 2018-07-23 16:28:08 +03:00
Jason Robinson bfb4792f16 Fix Diaspora `Profile` mapping regarding `last_name` property
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.
2018-06-24 22:12:43 +03:00
Jason Robinson af920604a2 Extract mentions from Diaspora payloads that have text content
The mentions will be available in the entity as `_mentions` which is
a set of Diaspora ID's in URI format.
2018-06-23 23:09:18 +03:00
Jason Robinson a2c8d1c061 Switch to ipdata.co service for country lookups 2018-05-27 20:34:47 +03:00
Jason Robinson 6353e47a85 Add parser for Mastodon server info and activity documents 2018-05-27 01:46:55 +03:00
Jason Robinson 7590e65f79 Don't automatically fetch ip and country when parsing meta docs
Otherwise we spam the country providing service too much.
2018-05-10 11:48:55 +03:00
Jason Robinson 33c6ed817a Add fetching of IP and country
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.
2018-05-07 22:58:25 +03:00
Jason Robinson 435c3d6d43 Add NodeInfo2 generator and Django view
See https://github.com/jaywink/nodeinfo2
2018-04-08 15:02:18 +03:00
Jason Robinson a798b1d4b5
Merge pull request #122 from jaywink/server-meta-parsers
Add fetchers for nodeinfo, nodeinfo2 and statisticsjson
2018-04-08 13:30:35 +03:00
Jason Robinson eef1f7d820 Add fetchers for nodeinfo, nodeinfo2 and statisticsjson 2018-04-08 12:57:08 +03:00
Jason Robinson 2a02f866aa Allow port in Diaspora handles as per the protocol specification
Previously handles were validated like emails.
2018-03-09 22:17:08 +02:00
Jason Robinson 4c2a42dfb9 Fix validation of `Retraction` with entity type `Share` 2018-03-09 21:50:54 +02:00
Jason Robinson ab3e2451b8 Ensure when processing payload empty payload tags don't create None values 2018-02-27 23:03:23 +02:00
Jason Robinson c15aa14e8e Switch Diaspora protocol to send new style entities
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
2018-02-24 15:04:07 +02:00
Jason Robinson aa8e8a7960 Use unquote instead of unquote_plus when preparing XML payload
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
2018-02-24 14:02:06 +02:00
Jason Robinson f80211b178 Add RFC3033 webfinger generator
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
2018-02-17 01:38:37 +02:00
Jason Robinson 47f79205f1 Changelog entries for last commits 2018-02-13 23:11:53 +02:00
Jason Robinson c1efc1add1 Enable generating encrypted JSON payloads with the Diaspora protocol
This adds possibility for private message support.

JSON encrypted payload encryption and decryption is handled by the Diaspora `EncryptedPayload` class.

Refs: #82
2018-02-12 23:14:27 +02:00
Jason Robinson c6bbd3ac4b Send outbound Diaspora payloads in new format
Remove possibility to generate legacy MagicEnvelope payloads.

Refs: #82
2018-02-12 23:00:22 +02:00
Jason Robinson f6091d270a Release 0.15.0 2018-02-12 22:37:11 +02:00
Jason Robinson 29b6f79705 Support fetching new style Diaspora protocol Webfinger (RFC 3033) (#110)
The legaxy Webfinger is still used as fallback if the new Webfinger is not found.

Refs: #108
2018-02-02 18:28:36 +02:00