this post was submitted on 03 Jul 2023
118 points (98.4% liked)

Programming

17406 readers
99 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities [email protected]



founded 1 year ago
MODERATORS
 

I recently went on quite a rabbit hole regarding the .well-known directory, and wrote about it.

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 6 points 1 year ago (1 children)

That is really interesting. Does anyone have an example of what a web finger might contain? It says avatar data but I’m interested in how sites use it.

[–] [email protected] 5 points 1 year ago (1 children)

Hey Thanks for reading, and I'm glad you found it interesting.

To my understanding, Webfinger provides a standard API for discovering the user profile details no matter the software running on the node.

For example,

$ curl https://programming.dev/.well-known/webfinger\?resource\=acct:[email protected] | jq
{
  "subject": "acct:[email protected]",
  "links": [
    {
      "rel": "http://webfinger.net/rel/profile-page",
      "type": "text/html",
      "href": "https://programming.dev/u/snowe"
    },
    {
      "rel": "self",
      "type": "application/activity+json",
      "href": "https://programming.dev/u/snowe",
      "properties": {
        "https://www.w3.org/ns/activitystreams#type": "Person"
      }
    }
  ]
}
[–] [email protected] 3 points 1 year ago (1 children)

lol well look at that. that's neat. seems a bit roundabout. How do you know the resource though? so you request the user information with the resource query param, but that means you already know the user, which means you likely got it from somewhere else right? if you got it from somewhere else, you likely have the ability to get the profile information from that location rather than requesting information twice. or am I thinking about this completely wrong?

for example, I completely understand the chatgpt plugin and change password ones, but this one doesn't really make sense to me, since you have to know information before hitting it.

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

You are right that it does feel a little roundabout. My understanding is that webfinger converts from the username to the user profile url and image. This is useful during federation, and for generic fedi/activitypub clients because different Fedi software maps usernames and profiles differently.

For example, [email protected] will reside at lemmy.instance/u/user, while user @mastodon.instance will reside at mastodon.instance/user.

Fom some poking around, it seems that Lemmy does not properly support sending the profile image on Webfinger because I wasn't able to do it using the rel parameters that are mentioned in the spec.