Wykres commitów

525 Commity (e5dd3db0dc4687e46a796ec0d47ab820583a4d43)

Autor SHA1 Wiadomość Data
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
Jason Robinson fcc38fc850 Minor documentation update 2017-07-05 20:08:24 +03:00
Jason Robinson c30ec8ee95 Merge pull request #90 from jaywink/diaspora-encrypted-json
Support receiving new style Diaspora encrypted payloads
2017-07-05 16:49:19 +03:00
Jason Robinson eed5e42f06 Add tests for encrypted Diaspora JSON payload receive
Refs: #83
2017-07-05 16:37:51 +03:00
Jason Robinson 670ec79fd5 Ensure JSON payloads are decoded from bytes when needed
Refs: #83
2017-07-05 00:56:28 +03:00
Jason Robinson 92e7a95700 Catch ValueError instead of JSONDecodeError
Seems the latter was only added in Python 3.5 and we support 3.4 still.

Refs: #83
2017-07-04 23:43:17 +03:00
Jason Robinson b19facc7af Remove an unused import 2017-07-04 23:32:06 +03:00
Jason Robinson 2e8d608256 Support receiving Diaspora new style encrypted JSON payloads
Decrypt the JSON and extract the Magic Envelope inside.

Closes #83
2017-07-04 23:24:39 +03:00
Jason Robinson ccf161a5d3 Remove deprecated 'user.key' lookup for private key 2017-07-04 23:16:56 +03:00
Jason Robinson 64b1c8c02e Minor code style cleanup 2017-07-04 23:14:02 +03:00
Jason Robinson 5580b5143f Fix parsing Diaspora profile with empty tag_string
Closes #88
2017-07-03 22:53:08 +03:00
Jason Robinson 0363260374 Correctly extend entity _children
Certain payloads caused _children for an entity to be written over by an empty list. Correctly do an extend on it.

Closes #89
2017-07-03 22:30:24 +03:00
Jason Robinson 659ba5643d Remove Post.photos attribute which was never used
It was replaced by the _children attribute.
2017-07-03 22:27:18 +03:00
Jason Robinson bbd85571a1 Move mutable entity attribute defaults to __init__
Got bitten by defining mutable type defaults as class attributes. Moved them to class __init__ to ensure attributes are not shared across instances.
2017-07-03 22:22:42 +03:00
Jason Robinson 78d344d6a8 Fix getting sender from a combination of legacy Diaspora encrypted payload and new entity names
For example `author`. This combination probably only existed in this library.
2017-06-08 23:37:59 +03:00
Jason Robinson e28e3fd587 Release 0.12.0 2017-05-22 23:25:54 +03:00
Jason Robinson 2773405f09 Merge pull request #86 from jaywink/receiving-guid-on-private-diaspora-payload
Add receiving user guid to entity for private Diaspora payloads
2017-05-21 22:54:58 +03:00
Jason Robinson d64a2c27a2 Add receiving user guid to entity for private Diaspora payloads
Required for example to actually use (legacy) relationship retraction.
2017-05-21 22:46:23 +03:00