Wykres commitów

127 Commity (42fce2493f3e3ba3861e04f9e0cc25b756e1555d)

Autor SHA1 Wiadomość Data
Jason Robinson 42fce2493f Release 0.7.0 2016-09-15 23:54:42 +03:00
Jason Robinson 4f0771819b Merge pull request #53 from jaywink/better-validation
Various improvements to entity validation
2016-09-15 23:08:26 +03:00
Jason Robinson 0f2c97adf8 Validate entities that are created through message_to_objects
To safeguard invalid entities being passed on to library users, validate entities that are created in the message_to_objects calls. Any failures are logged as errors.

This means for Diaspora Profile messages we must fetch the remote GUID from the hcard. Diaspora Profile XML message does not contain the guid but our data structure enforces GUID as a required attribute. This ensures library users will get a full profile back always. Implement in the Diaspora entities a hook fill_extra_attributes that is called in message_to_objects.
2016-09-15 23:02:55 +03:00
Jason Robinson b135d9b8a4 Improve test coverage of entities 2016-09-15 21:55:08 +03:00
Jason Robinson 432b42d0d5 Remove useless __all__ declaration in base entities
We're not importing all in __init__ for example.
2016-09-15 21:42:18 +03:00
Jason Robinson 53e5572f6c Make guid mandatory for Profile
Not sure why it wasn't mandatory..
2016-09-15 19:48:40 +03:00
Jason Robinson feb1f30cfa Ensure CreatedAtMixin.created_at gets set in __init__ not in class 2016-09-15 19:48:08 +03:00
Jason Robinson c2331a3e38 Add bool validation for PublicMixin 2016-09-15 19:47:28 +03:00
Jason Robinson 110751b810 Clarify GuidMixin.validate_guid if 2016-09-15 19:46:45 +03:00
Jason Robinson 52d667a17f Also validate None or empty string values for required entity attributes
Also refactor validation to be a little clearer.
2016-09-15 19:46:07 +03:00
Jason Robinson 8a1d2203a0 Raise warning if passing unknown parameters to entities 2016-09-15 19:44:27 +03:00
Jason Robinson c5ae5b9954 Merge pull request #52 from jaywink/fix-hcard-parse
Fix parsing profile from hCard
2016-09-15 15:45:32 +03:00
Jason Robinson dea861db18 Fix parsing profile from hCard
In the future diaspora hCard is not guaranteed to contain pod url or username. Don't rely on these in the parser, instead pass handle to the hCard parser directly.

Closes #50
2016-09-15 15:39:41 +03:00
Jason Robinson efccbab823 Release 0.6.1 2016-09-14 22:08:44 +03:00
Jason Robinson 07ec0382ef Merge pull request #51 from jaywink/fix-me
Fix new style Diaspora Magic Envelope payload data
2016-09-14 22:07:49 +03:00
Jason Robinson c1a37a7a91 Fix new style Diaspora Magic Envelope payload data
New style Diaspora Magic Envelope didn't require or like payload data to be cut to 60 char lines, as the legacy protocol does. Fixed to not cut lines.
2016-09-14 22:04:02 +03:00
Jason Robinson 054f2b60e0 Release 0.6.0 2016-09-13 12:07:20 +03:00
Jason Robinson 9617a6e56b Merge pull request #49 from jaywink/fix-hcard-selectors
Fix hcard selectors in parse_profile_from_hcard
2016-09-13 12:02:46 +03:00
Jason Robinson 476c6114ec Fix hcard selectors in parse_profile_from_hcard
Closes #39
2016-09-13 11:55:42 +03:00
Jason Robinson 8e29497e91 Merge pull request #48 from jaywink/new-magic-envelope
New style Diaspora Magic Envelope support
2016-09-13 11:35:22 +03:00
Jason Robinson 0b91e828d4 New style Diaspora Magic Envelope support
Not used in actual federation yet. Offers a class to build the envelope separately.

Closes #47
2016-09-13 11:29:13 +03:00
Jason Robinson 1c1bab1277 Always install test reqs with -U flag 2016-09-12 22:02:27 +03:00
Jason Robinson 4b01542fd4 Add changelog for user.private_key change 2016-09-12 21:58:28 +03:00
Jason Robinson ddc14cfab1 Deprecate receiving user 'key' attribute for Diaspora protocol
Instead correct attribute should be 'private_key'. We already use 'private_key' in the message creation code so this is just to unify the user related required attributes.

There is a fallback with 'key' for user objects in the receiving payload part of the Diaspora protocol until 0.8.0.
2016-09-12 21:53:25 +03:00
Jason Robinson 157423efe3 Add pytest-warnings to test reqs 2016-09-12 21:51:00 +03:00
Jason Robinson 8d62831ae9 Release 0.5.0 2016-09-05 23:38:33 +03:00
Jason Robinson c58d717b78 Merge pull request #46 from jaywink/full-xml-repr
Add Diaspora entity utility get_full_xml_representation
2016-09-05 23:38:08 +03:00
Jason Robinson 6cf06e915e Add Diaspora entity utility get_full_xml_representation 2016-09-05 23:33:35 +03:00
Jason Robinson 66965697b1 Merge pull request #45 from jaywink/send-document
Add send_document network utility
2016-09-05 23:04:37 +03:00
Jason Robinson ee5b16415e Add send_document network utility
It's a wrapper around requests.post that adds the correct user agent and silently captures common requests exceptions and returns them instead.
2016-09-05 22:58:08 +03:00
Jason Robinson c46114c6be Merge pull request #44 from jaywink/provider-display-name
Add mappings for Post.provider_display_name
2016-09-05 22:35:56 +03:00
Jason Robinson f979b8e91e Add mappings for Post.provider_display_name 2016-09-05 22:22:49 +03:00
Jason Robinson 0172690137 Merge pull request #43 from jaywink/to-user-optional
Make to_user optional in handle_create_payload
2016-09-05 22:15:36 +03:00
Jason Robinson c8f436cd4e Make to_user optional in handle_create_payload
Public content does not require a recipient.
2016-09-05 22:09:08 +03:00
Jason Robinson b2011b3fac Release 0.4.1 2016-09-04 23:15:39 +03:00
Jason Robinson 5e5ed49967 Merge pull request #41 from jaywink/drop-urlencoding
Fixes to Diaspora protocol handling
2016-09-04 23:11:44 +03:00
Jason Robinson 71ff2e7943 Changelog for #41 2016-09-04 23:06:25 +03:00
Jason Robinson 95cf91fcbc Fix identification of Diaspora protocol message
Socialhome was generating correct XML but attributes in different order than it seems other implementations.
2016-09-04 23:06:04 +03:00
Jason Robinson ebe5a71c26 No need to quote/encode the payload posted out 2016-09-04 22:57:58 +03:00
Jason Robinson 163e93b19c Add factories.entities.ProfileFactory 2016-08-01 01:49:16 +03:00
Jason Robinson 1b991a4555 Release 0.4.0 2016-07-24 22:06:18 +03:00
Jason Robinson 2423b8f5df Merge pull request #37 from jaywink/payload-logging
Add handle receive payload logging
2016-07-24 22:00:08 +03:00
Jason Robinson cf62f6fcf1 Add handle receive payload logging
Closes #29
2016-07-24 21:54:54 +03:00
Jason Robinson bcb9647eba Merge pull request #36 from jaywink/get-user-method
Get remote profile method
2016-07-24 20:29:34 +03:00
Jason Robinson b64031ef29 Add remote profile fetcher
High level method to fetch a remote profile. Currently falls back to Diaspora protocol as no others are supported.

Returns a Profile entity.

Closes #15
2016-07-24 20:25:16 +03:00
Jason Robinson 3e73658d65 Add 'guid' and 'public_key' as required for DiasporaHCard generator
Leaving these out was a mistake in the initial implementation. Diaspora has these in at least 0.6 development branch.
2016-07-24 14:51:29 +03:00
Jason Robinson 4c1c4d5e53 Merge pull request #35 from jaywink/get-user-method
Split federation.controllers to inbound and outbound
2016-07-23 13:42:37 +03:00
Jason Robinson 7b458b7fc7 Split federation.controllers to inbound and outbound 2016-07-23 13:37:56 +03:00
Jason Robinson f8cc459057 Add changelog entry for #33
[ci skip]
2016-07-23 00:23:38 +03:00
Jason Robinson 43fbc4acae Merge pull request #33 from jaywink/fetch-hcard
Add utilities to fetch Diaspora user discovery documents
2016-07-23 00:11:07 +03:00