Wykres commitów

292 Commity (fe762d383ddb68704d2d5dfcb7d27720f536c518)

Autor SHA1 Wiadomość Data
Jason Robinson fe762d383d
Merge pull request #116 from jaywink/add-more-to-json-webfinger
Add more things to JSON webfinger
2018-02-21 22:42:45 +02:00
Jason Robinson d74aa5290c Add search path to JSON webfinger 2018-02-21 22:21:55 +02:00
Jason Robinson 85e0b90ebf Add salmon receive url to JSON webfinger 2018-02-21 22:02:30 +02:00
Jason Robinson 0466931d05 Add atom feed support to JSON webfinger 2018-02-21 21:58:10 +02:00
Jason Robinson 3730a3d9b8 Make JSON webfinger support webfinger profile url 2018-02-21 19:20:46 +02:00
Jason Robinson 065d9e4d2b
Merge pull request #114 from jaywink/send-payloads-with-correct-content-type
Send Diaspora payloads with correct content type
2018-02-19 23:22:29 +02:00
Jason Robinson 72a72873cd Send Diaspora payloads with correct content type
Refs: #82
2018-02-19 23:14:42 +02:00
Jason Robinson ea0bd811df Add some extra logging to handle_send 2018-02-18 23:01:48 +02:00
Jason Robinson 0170a12a95 Allow guid to be empty when parsing or generating diaspora ID
Sometimes we just want a URI format Diaspora ID but don't have
a guid.
2018-02-17 20:54:18 +02:00
Jason Robinson 511ef6676c
Merge pull request #113 from jaywink/rfc3033-webfinger
Add RFC3033 webfinger generator
2018-02-17 01:45:33 +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 456d8344d8
Merge pull request #112 from jaywink/encrypted-json-payload
Enable delivery of new style private messages using Diaspora protocol
2018-02-13 23:19:31 +02:00
Jason Robinson 47f79205f1 Changelog entries for last commits 2018-02-13 23:11:53 +02:00
Jason Robinson 77fb555a52 Refactor handle_send function
Now handle_send high level outbound helper function also allows delivering
private payloads using the Diaspora protocol.

Refs: #82
2018-02-13 23:06:19 +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 02d110caa9
Merge pull request #111 from jaywink/send-out-in-new-way
Send outbound Diaspora payloads in new format
2018-02-12 23:08:17 +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
Jason Robinson 90f6270401 Add pytest cache to gitignore 2018-02-02 17:16:16 +02:00
Jason Robinson 9c132df16e
Ensure handle is always lower cased when fetching remote profile (#109)
Using `retrieve_remote_profile`. Warning will be logged if an upper case handle is passed in.
2018-01-20 15:29:56 +02:00
Jason Robinson 1da5a05cd5
Changelog for #107 2018-01-04 23:17:26 +02:00
Mykhailo Kushchenko 10e923008b Add exception to catch maxretryerror (#107) 2018-01-04 23:12:51 +02:00
Jason Robinson d0a816d7ff
Merge pull request #105 from jaywink/diaspora-reshare-public
Ensure DiasporaReshare.public is set
2017-11-01 22:30:21 +02:00
Jason Robinson 8068d79980 Ensure DiasporaReshare.public is set
Diaspora removed 'public' from reshare in protocol version 0.2.2. Since we do support it, when parsing incoming payloads, set it to True if it is missing. Our Share base entity defaults to False.
2017-11-01 22:18:49 +02:00
Jason Robinson 3157290093 Merge pull request #104 from jaywink/fetch-entities
New high level fetcher function retrieve_remote_content
2017-10-22 22:36:14 +03:00
Jason Robinson a65b040969 Support Diaspora URI scheme
Add 'id' and 'target_id' to Diaspora entities. Refactor retrieve content fetcher to use the Diaspora URI scheme based ID.
2017-10-22 14:40:12 +03:00
Jason Robinson e343369f5b New high level fetcher function retrieve_remote_content
The given ID will be fetched using the correct entity class specific remote endpoint, validated to be from the correct author against their public key and then an instance of the entity class will be constructed and returned.

Also related changes and refactoring:

* New Diaspora protocol helper `federation.utils.diaspora.retrieve_and_parse_content`. See notes regarding the high level fetcher above.
* New Diaspora protocol helper `federation.utils.fetch_public_key`. Given a `handle` as a parameter, will fetch the remote profile and return the `public_key` from it.
* Refactoring for Diaspora `MagicEnvelope` class.
* Diaspora procotol receive flow now uses the `MagicEnvelope` class to verify payloads.
* Diaspora protocol receive flow now fetches the sender public key over the network if a `sender_key_fetcher` function is not passed in. Previously an error would be raised.

Closes #103
2017-10-21 22:04:05 +03:00
Jason Robinson bcc779e006 Merge pull request #100 from jaywink/share-entity
Added base entity Share
2017-08-22 12:21:54 +03:00
Jason Robinson fb2f9d091d Added base entity Share
Maps to a `DiasporaReshare` for the Diaspora protocol.

The `Share` entity supports all the properties that a Diaspora reshare does. Additionally two other properties are supported: `raw_content` and `entity_type`. The former can be used for a "quoted share" case where the sharer adds their own note to the share. The latter can be used to reference the type of object that was shared, to help the receiver, if it is not sharing a `Post` entity. The value must be a base entity class name.

Closes #94
2017-08-22 12:12:47 +03:00
Jason Robinson ebacea83b0 Merge pull request #97 from jaywink/fix-diasporaprofile
Fix DiasporaProfile.from_base
2017-08-09 00:20:46 +03:00
Jason Robinson b3c4ac76a6 Fix DiasporaProfile.from_base
Converting base entity `Profile` to `DiasporaProfile` for outbound sending missed two attributes, `image_urls` and `tag_list`. Those are now included so that the values transfer into the built payload.
2017-08-09 00:02:49 +03:00
Jason Robinson 5d3db57e65 Release 0.14.1... 2017-08-06 16:20:30 +03:00
Jason Robinson e684b2aca4 Merge pull request #96 from jaywink/fix-relayables-regression
Fix regression in handling Diaspora relayables
2017-08-06 16:19:29 +03:00
Jason Robinson c6343bbd74 Fix regression in handling Diaspora relayables
Due to security fix in 0.14.0. Payload and entity handle need to be allowed to be different when handling relayables.
2017-08-06 16:06:45 +03:00
Jason Robinson 36da89e0bb Release 0.14.0 2017-08-06 15:35:54 +03:00
Jason Robinson 54365b3856 Merge pull request #95 from jaywink/verify-handles
Verify payload and entity handle are the same
2017-08-06 15:33:58 +03:00
Jason Robinson 934bd69bba Verify payload and entity handle are the same
Add proper checks to make sure Diaspora protocol payload handle and entity handle are the same. Even though we already verified the signature of the sender, we didn't ensure that the sender isn't trying to fake an entity authored by someone else.

The Diaspora protocol functions `message_to_objects` and `element_to_objects` now require a new parameter, the payload sender handle. These functions should normally not be needed to be used directly.
2017-08-06 14:04:50 +03:00
Jason Robinson 6ba6f905f3 Fix travis python 3.6 build pip failure 2017-08-02 11:09:27 +03:00
Jason Robinson b0742e7baf Merge pull request #93 from jaywink/add-parent-user-handle-send
Refactor handle_send and handle_create_payload signatures
2017-07-29 13:58:13 +03:00
Jason Robinson 977c584d96 Refactor handle_send and handle_create_payload signatur
**Breaking change.** The high level `federation.outbound` functions `handle_send` and `handle_create_payload` signatures have been changed. This has been done to better represent the objects that are actually sent in and to add an optional `parent_user` object.

For both functions the `from_user` parameter has been renamed to `author_user`. Optionally a `parent_user` object can also be passed in. Both the user objects must have `private_key` and `handle` attributes. In the case that `parent_user` is given, that user will be used to sign the payload and for Diaspora relayables an extra `parent_author_signature` in the payload itself.
2017-07-29 13:43:35 +03:00
Jason Robinson f0eba0e3d1 Release 0.13.0 2017-07-22 00:03:49 +03:00
Jason Robinson b5b05444d7 Add missing 'Follow' entity to docs 2017-07-22 00:02:33 +03:00
Jason Robinson a054ebee29 Merge pull request #92 from jaywink/add-created-at-to-diaspora-comment
Add created_at to Diaspora Comment entity XML creator + fix relayable support
2017-07-21 23:53:17 +03:00
Jason Robinson 77c307d302 Improve test coverage for relayable fixes 2017-07-21 23:46:19 +03:00
Jason Robinson 10fa2cf846 Enable correct Diaspora relayable behaviour
Store the original object when signing with parent, then use that for sending, not serializing our entity object.

This fixes relayable support broken with the new Diaspora protocol.
2017-07-21 23:21:30 +03:00
Jason Robinson 5b04e5ea84 Add created_at to Diaspora Comment entity XML creator
This is required in renewed Diaspora protocol.

Refs: #59
2017-07-21 22:51:16 +03:00
Jason Robinson 8c5f52c0a9 Improve changelog for #91 closure
Closes: #91
2017-07-19 00:58:34 +03:00
Jason Robinson 9876153cd4 Ensure Diaspora store_magic_envelope_doc survives bytes 2017-07-19 00:52:10 +03:00
Jason Robinson 109e97cbd9 Fix identifying Diaspora payload if it is passed to handle_receive as a bytes object 2017-07-19 00:39:47 +03:00