diaspora / diaspora_federation

A library that provides functionalities needed for the diaspora* federation protocol.
GNU Affero General Public License v3.0
101 stars 29 forks source link

Allow to receive non-public profiles without private data #79

Closed SuperTux88 closed 7 years ago

SuperTux88 commented 7 years ago

This is needed to send non-public profiles to a public endpoint when not sharing with a person on the target pod. This is needed to fix diaspora/diaspora#2884.

I already described that more in this comment where this PR is needed for these two scenarios:

  • private details + searchable:
    • send to all contacts the person shares with privately
    • send public profile (without private parts) to all other known pods publicly
  • private details + not searchable:
    • send to all contacts the person shares with privately
    • send public profile to all other contacts publicly
SuperTux88 commented 7 years ago

I updated the documentation to explain the public flag and the base and extended profile.

cmrd-senya commented 7 years ago

private details + searchable:

  • send public profile (without private parts) to all other known pods publicly

private details + not searchable:

  • send public profile to all other contacts publicly

Given a user changes their profile from searchable to non-searchable. Given there is a remote pod which had fetched this user's profile before but at this pod this user doesn't have any contacts. In this case does it mean that the remote pod will "forever" display the last version of user's public profile that was pushed there? Or at least until the user changes it back to searchable? Does it mean, that users in this case won't have any control on public data which such remote pods will display for their profile (which can be accessed by their guid)? So they can't delete their information that they don't want to be displayed there anymore?

If I got it right, then I guess we need some way to inform the remote pod about the fact that we will not send updates anymore. Possible way could be a Retraction message with Profile type. For the recepient pod the meaning of this message is "Stop showing this profile's public and private details because they are outdated". So basically we need to clear people's profile if they go "non-searchable" at the pods where they don't have contacts. And since there is no way to know if the remote pod will share public profile updates to us we need it to report the Retraction explicitly.

What do you think, @SuperTux88?

P.S. Maybe my comment fits better to diaspora/diaspora#2884?

SuperTux88 commented 7 years ago

In this case does it mean that the remote pod will "forever" display the last version of user's public profile that was pushed there?

Yes, for non-searchable profiles it is still the same as it already is today, but with this change we will improve it for searchable profiles, while keeping it the same as now for non-searchable profiles.

which can be accessed by their guid

The profile can only be accessed for users on that pod, it's not public there. However the name and avatar is displayed at posts which are publicly accessible.

If I got it right, then I guess we need some way to inform the remote pod about the fact that we will not send updates anymore.

And then? What should the pod do? Delete the profile? That's not possible if there are already posts/comments with this profile. Or remove name and avatar and use diaspora ID and default avatar instead? Then we should change WebFinger to never include a name or an avatar, because when a pod fetches a profile with WebFinger the profile will never be updated too and the pod will never receive a Retraction.

There is simply no solution for that, when a pod fetched the profile but doesn't receive any updates for a profile he doesn't receive any updates ... it's the same as now ... The only reason for this is to improve it for searchable profiles by pushing more updates than now.

Because profiles are currently searchable by default I wanted to add a setting for that to the getting started page, so new users can decide that after registration, before the profile is fetched/federated. But that is out of scope here and can be discussed when this is added to diaspora.

SuperTux88 commented 7 years ago

The pod could fetch the profile every time (which would make everything slow), or cache it only for limited time and then WebFinger it again for updates ... but that's everything out of scope here ...

SuperTux88 commented 7 years ago

PR updated.

cmrd-senya commented 7 years ago

Merged, thanks!