Skip to content
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

✨ Add WebFinger / ActivityPub avatar provider #140

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Commits on Jul 6, 2023

  1. 🗃️ Add avatar provider to use and rename email

    This patch updates the database schema in preparation for supporting
    more avatar providers.
    
    It adds a new per user avatar_provider column and renames the email
    column to avatar to allow more generic input which will be interpreted
    depending on the provider.
    networkException committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    4084990 View commit details
    Browse the repository at this point in the history
  2. 🚧 Use avatar and avatar_provider in various places

    This patch starts preparing the user interface for supporting multiple
    avatar providers by adding the ability to edit these values in the edit
    form and updating the user overview page.
    
    It also introduces an avatar provider enum currently only containing
    gravatar.
    networkException committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    b16f7cd View commit details
    Browse the repository at this point in the history
  3. ✨ Add WebFinger / ActivityPub avatar provider

    This patch introduces a new avatar provider based on the changes from
    the previous two commits.
    
    The WebFinger / ActivityPub provider ("webfinger" internally)
    interprets the avatar field in a user either as an RFC 7565 acct URI
    or, if it does not contain an "@" symbol, a RFC 3986 host string.
    
    Based on this it will contact the host and query the WebFinger endpoint.
    
    If the WebFinger response contains an avatar relation, the link contained
    in that relation will used.
    
    In most cases howeve, for example when querying a Mastodon, Akkoma or
    Calckey user, the WebFinger response will not contain such a link.
    Then, the provider will look for an ActivityPub actor using an
    "application/activity+json" link in the WebFinger response.
    
    This patch implements two strategies for obtaining an URL for the
    avatar image of an ActivityPub actor:
    
    With no additional information given, mete will try to contact the
    hosting server directly. This might fail for various reasons such
    as missing request authentication or signature.
    
    Given a Mastodon client access token, mete will contact the according
    Mastodon server and ask it for the profile picture of the actor.
    Note that depending on the server's settings, this might cause the
    profile picture to be fetched from the server's cache instead of the
    actor's server directly.
    
    The results of these lookups will be cached for one day and can be
    invalidated by updating the user from the UI.
    networkException committed Jul 6, 2023
    Configuration menu
    Copy the full SHA
    20a2112 View commit details
    Browse the repository at this point in the history