Wykres commitów

366 Commity (251f558428f785669b8cd694058175b2e2855df1)

Autor SHA1 Wiadomość Data
Jason Robinson 251f558428 Move test settings and utils for Django to tests root
Fix first AS2 view decorator test.
2018-09-29 12:12:34 +03:00
Jason Robinson 2db416c38d Make activitypub_object_view into a view decorator 2018-09-29 02:39:14 +03:00
Jason Robinson 97c0d79b50 Add ActivityPub object view
The AP object view takes in a request and either fetches the object
and renders an AS2 document or calls the fallback view, which normally
would for example be a HTML document.

The fetch function is used to get the object by ID from the application.
2018-09-26 23:31:03 +03:00
Jason Robinson 7b8f399468 Add with_slash text utility
Ensures the given text has a slash at the end.
2018-09-26 23:28:22 +03:00
Jason Robinson 837f463848 Add BaseEntity.username property
Returns username from handle or None.
2018-09-26 23:27:47 +03:00
Jason Robinson a72153e9b4 Protocol entities should inherit base entity
Se some additional required in AcitivitypubEntityMixin
2018-09-25 23:51:39 +03:00
Jason Robinson c4484d61c3 Add ActivityType enum 2018-09-25 23:50:34 +03:00
Jason Robinson 3b2aff13a1 Merge branch 'activepubs' into 'master'
Bring in latest refactoring related to ActivityPub work

See merge request jaywink/federation!131
2018-09-24 20:21:02 +00:00
Jason Robinson 2be12c356d Changelogs for changes 2018-09-24 23:13:39 +03:00
Jason Robinson cf790f8b92 No point in trying to retrieve remote diaspora content if no handle 2018-09-22 13:39:13 +03:00
Jason Robinson 979b43636d Refactor away remaining diaspora URL generator usages :/ 2018-09-03 23:14:28 +03: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 7687bdd69e Fix missing handle and guids in Diaspora mappers 2018-08-26 22:23:23 +03:00
Jason Robinson 89ba3f345b Ensure sender_key_fetcher is called with id, not handle 2018-08-26 21:02:40 +03:00
Jason Robinson 946e40c0bb Fix webfinger view 2018-08-26 19:53:48 +03:00
Jason Robinson 939dbf15d7 Return also guid to profile
But make Diaspora entities figure handle and guid from the ID's
if necessary. If ID's are not in diaspora format, they must be
passed in separately.
2018-08-26 16:46:24 +03:00
Jason Robinson 07e637a832 Return handle to Profile
This is required to send out profiles to the diaspora network.
The profile ID will not always be in Diaspora format and thus those
wanting to support Diaspora must supply a handle.
2018-08-22 23:00:15 +03:00
Jason Robinson e049b7be97 Add optional handle and guid to UserType
Handle is required if delivering to Diaspora platforms.
2018-08-19 22:51:11 +03:00
Jason Robinson 890e2c940b Make UserType an attrs class 2018-08-19 22:02:09 +03:00
Jason Robinson 7d78122cbc Call get contact key with sender id, not handle 2018-08-19 20:05:03 +03:00
Jason Robinson fd6f24ad34 Correct attribute _receiving_actor_id on BaseEntity 2018-08-12 19:42:22 +03:00
Jason Robinson 4c24e57bff Make retrieve_remote_profile accept an ID 2018-08-12 17:58:59 +03:00
Jason Robinson d2cba74a9d Revert: WIP 2018-08-12 00:31:20 +03:00
Jason Robinson f744c6635d Fix type hinting problems due to pycryptodome move 2018-08-11 23:56:46 +03:00
Jason Robinson cbf2e1f99c WIP 2018-08-11 23:41:15 +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 dc988add94 Add pytest-blockage 2018-08-11 23:41:15 +03:00
Jason Robinson 16e1b69061 Create top level Django url config and utilities 2018-08-11 23:41:15 +03:00
Jason Robinson 570f7c6007 Create first ActivityPub entity version, ActivitypubProfile
Corresponds to 'Person' Actor.
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 a464383c63 Move get_base_utils helper to entity base utils 2018-08-11 23:41:15 +03:00
Jason Robinson 3bf4f01575 Remove support for legacy Diaspora protocol
Support for Request and the old structure of Diaspora protocol
elements and delivery has been removed. A near 100% majority of
known users using the Diaspora protocol have upgraded past versions
where the new entities came into use.
2018-08-11 23:41:15 +03:00
Jason Robinson 55985ae076 Merge branch 'patch-017' into 'master'
Switch crypto library `pycrypto` to `pycryptodome`

See merge request jaywink/federation!130
2018-08-11 20:40:53 +00:00
Jason Robinson 5a01616df1 Fix references to code to point to Feneas gitlab 2018-08-11 22:32:44 +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 674e242519 Remove travis config 2018-07-23 23:21:33 +03:00
Jason Robinson 065c8594b6 Merge branch 'python36' into 'master'
Drop support for Python <= 3.5, add tox and Gitlab CI

See merge request jaywink/federation!128
2018-07-23 16:27:15 +00:00
Jason Robinson a2e08d42f5 One more place to bump Python version in docs 2018-07-23 19:21:58 +03:00
Jason Robinson bb3281d489 Add tox and gitlab CI 2018-07-23 19:15:34 +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 690e8872d8
Merge pull request #127 from jaywink/extract-mentions
Extract mentions from Diaspora payloads that have text content
2018-06-24 00:13:49 +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 8c7b1206c6 Monthly and halfyear active users from weekly should not be more than total user count 2018-06-05 23:03:33 +03:00
Jason Robinson b28661b86a Revert previous attempt for Mastodon weekly stats stabilizing
Instead, take a stable number from previous week stats for now.
2018-06-04 23:52:40 +03:00
Jason Robinson 907d1d60db Try stabilizing Mastodon weekly counts with more guessing
Mastodon has a tricky way of reporting weekly logins according to the
going week. Multiply the count depending on the weekday to see if we
can stabilize the stats a bit.
2018-06-04 22:59:49 +03:00
Jason Robinson 8111f2d4e4 Fix Mastodon parser if version has non-numbers 2018-06-04 20:43:46 +03:00