Wykres commitów

162 Commity (52eb8fc6cdf4c1a94268b26486fedf002cb8bba1)

Autor SHA1 Wiadomość Data
Jason Robinson 52eb8fc6cd Linkify URL's in outgoing ActivityPub payloads
Refs: #572
2020-01-26 01:21:41 +02:00
Jason Robinson 47d3d53a18 Add `process_text_links` text utility to linkify URL's in text
Moved from Socialhome.
2020-01-26 01:08:54 +02:00
Jason Robinson c479a42d47 Entities with a `raw_content` field now have URL syntax mentions rendered into a link
If Django is configured, a profile will be retrieved using the configured profile
getter function and the profile name or username will be used for the link.

Refs: https://git.feneas.org/socialhome/socialhome/issues/572
2020-01-18 01:39:44 +02:00
Jason Robinson 4c665e8743 Fix some edge case crashes of `handle_send` when there are Diaspora protocol receivers 2020-01-12 23:33:49 +02:00
Jason Robinson 6bc85a3bfa Loosen validation of `TargetIDMixin`
It now requires one of the target attributes
to be set, not just `target_id`. This fixes
follows over the Diaspora protocol which broke
with stricter send validation added in 0.19.0.
2020-01-12 00:56:46 +02:00
Jason Robinson dd55916978 Fix changelog 2019-12-29 23:46:37 +02:00
Jason Robinson 557146055c Matrix and NodeInfo2 hostmeta parsers now clean the port out of the host name 2019-12-29 23:08:05 +02:00
Jason Robinson 8c4e4a2197 Correctly identify some platforms that emulate the Mastodon API
Ensure Pixelfed, Kroeg and Kibou instances that emulate the Mastodon API don't get identified as Mastodon instances.
2019-12-29 22:57:02 +02:00
Jason Robinson 9700af7bee Don't crash on malformed NodeInfo doc
Don't crash when parsing an invalid NodeInfo document where the
usage dictionary is not following specification. Some Pleroma
instances have started writing an object there.
2019-12-29 22:28:25 +02:00
Jason Robinson 91dc3ca312 Add missing `response.raise_for_status()` call to the `fetch_document` network helper
when fetching with given URL. Error status was already being raised correctly when
fetching by domain and path.
2019-12-29 20:44:32 +02:00
Jason Robinson f6b2bb6d05 Don't crash loudly when fetching webfinger for Diaspora that does not contain XML 2019-12-15 22:55:21 +02:00
Jason Robinson 1f2fdf3459 Start new development cycle 2019-12-15 22:42:10 +02:00
Jason Robinson 3b31668a4d Release v0.19.0 2019-12-15 01:46:25 +02:00
Jason Robinson d84a990510 Fail early in outbound `handle_send` if a payload cannot be generated
For a payload which doesn't depend on recipient attributes, no point
in looping all recipients trying.
2019-11-28 21:11:12 +02:00
Jason Robinson 0f7b22bb04 Improve performance of generating ActivityPub payloads
For a large number of receivers in `handle_send`.

Only generate payload once and then just copy and attach receivers.
2019-11-28 21:02:13 +02:00
Jason Robinson e0d818f724 Allow HTTP Signature verification to pass if signature is 24 hours old
Previously requirement was 30 seconds, which caused loss of messages
where signature validation didn't happen immediately, but in
a background worker which didn't immediately process the job.

Refs: https://git.feneas.org/socialhome/socialhome/issues/563
2019-11-27 23:21:31 +02:00
Jason Robinson 55a3d7c3fc Implement fetching of ActivityPub profiles by handle
Using webfinger.

Refs: https://git.feneas.org/socialhome/socialhome/issues/522
2019-11-03 01:03:45 +02:00
Jason Robinson 30694eafd2 Forgot changelog for the outgoing entity validation 2019-10-11 00:45:49 +03:00
Jason Robinson 91b074118b Start dev development cycle 0.19.0-dev 2019-10-10 22:37:03 +03:00
Jason Robinson e39896b958 Forgot to ensure ActivityPub support is always on. Release 0.18.1. 2019-10-06 15:03:52 +03:00
Jason Robinson a5373347fe Release 0.18.0 2019-10-06 01:58:54 +03:00
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