Wykres commitów

661 Commity (ca521d4a03f6f4daa21dd8a13e5e10be0becf826)

Autor SHA1 Wiadomość Data
Jason Robinson 5a5042a97d Don't crash meta fetchers if no JSON returned 2018-05-13 22:57:33 +03:00
Jason Robinson 07fa3e8f19 More support for old buggy Hubzilla nodeinfo docs 2018-05-13 22:36:00 +03:00
Jason Robinson 2762fb5f3e Guard against 'null' values in NodeInfo2 documents 2018-05-13 22:14:33 +03:00
Jason Robinson 1066502591 Add workaround for parsing a buggy older Hubzilla version nodeinfo
This has been fixed in later versions but there are quite a few
versions out with the bug so add a workaround to not crash on those.
2018-05-13 20:47:55 +03:00
Jason Robinson 7590e65f79 Don't automatically fetch ip and country when parsing meta docs
Otherwise we spam the country providing service too much.
2018-05-10 11:48:55 +03:00
Jason Robinson af86d9a9a4
Merge pull request #124 from jaywink/wip
Add fetching of IP and country
2018-05-07 23:08:06 +03:00
Jason Robinson 33c6ed817a Add fetching of IP and country
Network utils has a method `fetch_host_ip_and_country` which will
fetch both. The country fetching uses the `ip-api.com` free service
to resolve country information.
2018-05-07 22:58:25 +03:00
Jason Robinson 0da0e58693 Make statisticsjson hostmeta parser more resilient
Some servers use strings for number values.
2018-04-26 22:30:28 +03:00
Jason Robinson 2c255a68f7 Change hostmeta fetchers relay default to empty string 2018-04-08 20:20:24 +03:00
Jason Robinson 3bf19d2a8b
Merge pull request #123 from jaywink/nodeinfo2
Add NodeInfo2 generator and Django view
2018-04-08 15:15:58 +03:00
Jason Robinson 435c3d6d43 Add NodeInfo2 generator and Django view
See https://github.com/jaywink/nodeinfo2
2018-04-08 15:02:18 +03:00
Jason Robinson a798b1d4b5
Merge pull request #122 from jaywink/server-meta-parsers
Add fetchers for nodeinfo, nodeinfo2 and statisticsjson
2018-04-08 13:30:35 +03:00
Jason Robinson eef1f7d820 Add fetchers for nodeinfo, nodeinfo2 and statisticsjson 2018-04-08 12:57:08 +03:00
Jason Robinson 2a02f866aa Allow port in Diaspora handles as per the protocol specification
Previously handles were validated like emails.
2018-03-09 22:17:08 +02:00
Jason Robinson 4c2a42dfb9 Fix validation of `Retraction` with entity type `Share` 2018-03-09 21:50:54 +02:00
Jason Robinson ab3e2451b8 Ensure when processing payload empty payload tags don't create None values 2018-02-27 23:03:23 +02:00
Jason Robinson 233d191ff8
Merge pull request #117 from jaywink/new-entity-properties
Switch Diaspora protocol to send new style entities
2018-02-24 15:30:50 +02:00
Jason Robinson c15aa14e8e Switch Diaspora protocol to send new style entities
We've already accepted these on incoming payloads for a long time and so do all the other platforms now, so now we always send out entities with the new property names. This can break federation with really old servers that don't understand these keys yet.

Closes #59
2018-02-24 15:04:07 +02:00
Jason Robinson aa8e8a7960 Use unquote instead of unquote_plus when preparing XML payload
Change unquote method used when preparing Diaspora XML payloads for verification.

Some platforms deliver payloads not using the urlsafe base64 standard which caused problems when validating the unquoted signature. Ensure maximum compatibility by allowing non-standard urlsafe quoted payloads.

Closes #115
2018-02-24 14:02:06 +02:00
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