Wykres commitów

545 Commity (91b074118b0adbec9c9e20c6ce0a0c4d789049d7)

Autor SHA1 Wiadomość Data
Jason Robinson 59d31bb37e Merge branch 'activitypub' into 'master'
ActivityPub bi-directional Follow and outgoing automatic Accept support

See merge request jaywink/federation!143
2019-03-23 21:44:59 +00:00
Jason Robinson 2f056f0d58 Tests for ActivityPub utils 2019-03-23 23:43:09 +02:00
Jason Robinson afe584fa0d Add tests for Activitypub mappers new functionality 2019-03-20 23:11:22 +02:00
Jason Robinson 967f494dec Add test for ActivitypubProfile entity 2019-03-20 22:50:43 +02:00
Jason Robinson 4b778112d8 Add test for ActivityPub Follow post receive Accept sending 2019-03-20 22:38:09 +02:00
Jason Robinson 273818dc43 Add test for ActivityPub Accept entity 2019-03-20 22:04:11 +02:00
Jason Robinson 0b34b509b0 Minor tweaks to ActivityPub base entities and Accept ID requirement 2019-03-20 22:03:53 +02:00
Jason Robinson 8aaedcc635 Fix sending ActivityPub Accept in response to a Follow 2019-03-18 23:41:05 +02:00
Jason Robinson a72494240b Fix sending accept when receiving a remote AP follow 2019-03-17 23:47:51 +02:00
Jason Robinson 4b62b83908 Default AP profile public inbox to private inbox, if no sharedInbox 2019-03-17 21:33:58 +02: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 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 ced914578b Fix generating outbound entity for ActivitypubAccept 2019-03-17 03:42:42 +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 353ae9ff9d Add Accept entity and ActivityPub follow auto-Accept flow
When receiving an ActivityPub Follow, send back an Accept activity
automatically. Due to application hook needed to fetch sending
user private key (for signing), this is only available if Django
is installed since currently application hooks exist only for
Django configuration.

Django applications should include a new configuration item
"get_private_key_function" which points to a function which takes
a user identifier (fid, handle or guid) and returns a private key
in RSA object format.
2019-03-17 03:17:10 +02:00
Jason Robinson d8a067a691 Fix erronous typing of UserType.private_key
Code expects an RSA object, typing was shown as str.
2019-03-17 03:13:47 +02:00
Jason Robinson 0cf13a33a4 Fix fetching Diaspora remote entities 2019-03-16 04:21:20 +02:00
Jason Robinson fddb22facc Ensure public key passed to requests-http-signatures is bytes 2019-03-16 03:35:39 +02:00
Jason Robinson 3a44534b24 Add cryptography to dependencies
Required by requests-http-signatures. Which is a shame since
we already use pycryptodome.
2019-03-16 03:07:31 +02:00
Jason Robinson 29ba501d31 Fix mapping of image urls from ActivityPub AS2 actor 2019-03-14 23:03:24 +02:00
Jason Robinson a4db2f0beb Ensure fetch for Diaspora protocol is done with entities in lowercase
Not sure how this broke!
2019-03-14 22:31:44 +02:00
Jason Robinson ad17e2cd2f Fix document fetcher to parse correctly fetched AS2 document into profile 2019-03-14 22:06:39 +02:00
Jason Robinson 9359831ea2 Merge branch 'activitypub-signatures' into 'master'
Work on ActivityPub HTTP signatures and payload delivery

See merge request jaywink/federation!142
2019-03-06 21:06:47 +00: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 eedef11041 Merge branch 'refactor-handle-receive' into 'master'
Refactor handle_receive to require a RequestType

See merge request jaywink/federation!141
2019-03-03 01:08:07 +00: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 fe7cd7c7d1 Merge branch 'activitypub-fetcher' into 'master'
ActivityPub profile fetcher and inbound protocol routing improvements

See merge request jaywink/federation!140
2019-03-02 21:55:54 +00:00
Jason Robinson dbaae4842b Changelog for the various changes 2019-03-02 23:52:09 +02:00
Jason Robinson 871cf67cde Add username to base Profile entity 2019-03-02 01:42:08 +02:00
Jason Robinson a876d3a239 Add fetching of remote ActivityPub profile 2019-03-02 01:24:57 +02:00
Jason Robinson 7d8ae2c814 Allow passing extra headers to network util fetch_document 2019-03-02 01:24:57 +02:00
Jason Robinson c7ce799caf Add identification of protocol on fetch_remote_profile id parameter
This adds activitypub to protocols that will be fetcher for
remote profile.
2019-03-02 01:24:57 +02:00
Jason Robinson a1b3afba7f Move handle_send protocol identification to federation module root
Add also "identify by id" function.
2019-03-02 01:24:57 +02:00
Jason Robinson b30b0f5d78 Refactor away unnecessary 'handle' parameter to 'retrieve_remote_profile'
The function will guess the protocol from the format of the
ID given.
2019-03-02 01:24:57 +02:00
Jason Robinson 4af97a486b Add GitLab CI badge 2019-03-01 23:24:36 +00: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 4f2e57c579 Merge branch 'allow-disabling-ap-webfinger' into 'master'
Disable ActivityPub limited features by default when on Django

See merge request jaywink/federation!139
2019-01-29 19:53:22 +00:00
Jason Robinson e099d993a8 Disable ActivityPub limited features by default when on Django
Allow enabling by setting the FEDERATION "activitypub" key to True.
This is done to not break compatibility for new users for
platforms which prefer activitypub.
2019-01-29 21:42:57 +02:00
Jason Robinson 2a5a7b76b1 Don't try to parse a nodeinfo document which is for example 404
Refs: https://github.com/friendica/friendica/issues/6472
2019-01-19 23:30:46 +02:00
Jason Robinson 6985a49a9a Make Misskey fetcher survive bad JSON 2018-12-02 20:14:35 +02:00
Jason Robinson 402e72d488 Merge branch 'misskey-parser' into 'master'
Add Misskey fetcher and parser

See merge request jaywink/federation!138
2018-11-27 21:24:48 +00:00
Jason Robinson 6f7571a81e Add Misskey fetcher and parser 2018-11-27 23:19:58 +02:00
Jason Robinson 4bef9b6c8e Merge branch 'parse-matrix-signups-status' into 'master'
Add parsing of Matrix server signups status

See merge request jaywink/federation!137
2018-11-27 20:12:19 +00:00
Jason Robinson 4c786c3148 Add parsing of Matrix server signups status 2018-11-27 22:09:05 +02:00
Jason Robinson 1687fdb59a Do NodeInfo fetch if Mastodon API version indicates Pleroma server 2018-11-25 23:12:26 +02:00
Jason Robinson 04f3bd44d7 Use Mastodon instance count as post count 2018-11-25 22:56:30 +02:00
Jason Robinson fce0917682 Parse Mastodon signups status from the instance about page 2018-11-25 22:51:11 +02:00