New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New high level fetcher function retrieve_remote_content #104

Merged
merged 2 commits into from Oct 22, 2017

Conversation

1 participant
@jaywink
Owner

jaywink commented Oct 21, 2017

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

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

@jaywink jaywink added the in progress label Oct 21, 2017

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Oct 21, 2017

Codecov Report

Merging #104 into master will increase coverage by 0.91%.
The diff coverage is 95.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   91.83%   92.75%   +0.91%     
==========================================
  Files          17       17              
  Lines        1102     1200      +98     
==========================================
+ Hits         1012     1113     +101     
+ Misses         90       87       -3
Impacted Files Coverage Δ
federation/protocols/diaspora/magic_envelope.py 100% <100%> (ø) ⬆️
federation/protocols/diaspora/protocol.py 74.44% <100%> (+3.45%) ⬆️
federation/fetchers.py 100% <100%> (ø) ⬆️
federation/entities/diaspora/mappers.py 98.66% <100%> (-0.67%) ⬇️
federation/entities/diaspora/entities.py 98.29% <100%> (+0.39%) ⬆️
federation/entities/base.py 96.51% <100%> (+0.07%) ⬆️
federation/utils/diaspora.py 92% <84.37%> (-3.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcc779e...a65b040. Read the comment docs.

codecov bot commented Oct 21, 2017

Codecov Report

Merging #104 into master will increase coverage by 0.91%.
The diff coverage is 95.93%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #104      +/-   ##
==========================================
+ Coverage   91.83%   92.75%   +0.91%     
==========================================
  Files          17       17              
  Lines        1102     1200      +98     
==========================================
+ Hits         1012     1113     +101     
+ Misses         90       87       -3
Impacted Files Coverage Δ
federation/protocols/diaspora/magic_envelope.py 100% <100%> (ø) ⬆️
federation/protocols/diaspora/protocol.py 74.44% <100%> (+3.45%) ⬆️
federation/fetchers.py 100% <100%> (ø) ⬆️
federation/entities/diaspora/mappers.py 98.66% <100%> (-0.67%) ⬇️
federation/entities/diaspora/entities.py 98.29% <100%> (+0.39%) ⬆️
federation/entities/base.py 96.51% <100%> (+0.07%) ⬆️
federation/utils/diaspora.py 92% <84.37%> (-3.59%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bcc779e...a65b040. Read the comment docs.

Support Diaspora URI scheme
Add 'id' and 'target_id' to Diaspora entities. Refactor retrieve content fetcher to use the Diaspora URI scheme based ID.

@jaywink jaywink merged commit 3157290 into master Oct 22, 2017

4 checks passed

codecov/patch 95.93% of diff hit (target 91.83%)
Details
codecov/project 92.75% (+0.91%) compared to bcc779e
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@jaywink jaywink deleted the fetch-entities branch Oct 22, 2017

@jaywink jaywink removed the in progress label Oct 22, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment