The secret life of .well-known

3 years ago by ishanpage to c/programming

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

ragnarokonline 13 points 3 years ago

Love these little compsci investigation articles. Thanks for sharing!

path: 0 785027, hotness: undefined, score: 13, children: 1
ishanpage 6 points 3 years ago

Glad you liked it! Thanks for reading ❤️

path: 0 785027 785139, hotness: undefined, score: 6, children: 0
u_tamtam 8 points 3 years ago path: 0 791402, hotness: undefined, score: 8, children: 0
pe1uca 6 points 3 years ago

It's a really nice anecdote where I see myself reflected haha, I'm just in the middle of something similar with RSA and Ed25519, and also the post-quantum cryptography scene.
But usually once I'm done investigating and I think I understood something well enough I simply bookmark the links, write some bullet points in my notes and that's it.

Do you also have this issue? Do you finish the investigation and start writing for a blog post right away? Or do you just come back to it after some time?

path: 0 788158, hotness: undefined, score: 6, children: 4
ishanpage 5 points 3 years ago

Haha this is exactly me. That habit of losing the knowledge rapidly post investigation is something I'm trying to break, and that's part of the reason I banged out this blog post immediately after my itch was satisfied.

The "I have to tell people about this NOW" vibe also carried me through completing my website (just so I could publish this blog post)

path: 0 788158 788321, hotness: undefined, score: 5, children: 0
silver 2 points 3 years ago

Out of curiosity are ye planning to do a post about RSA and ED25519?

path: 0 788158 975260, hotness: undefined, score: 2, children: 2
pe1uca 3 points 3 years ago

I do want to, not sure when, but I'll find the time since OP gave me a bit of a boost in confidence I can do it :)

path: 0 788158 975260 1004927, hotness: undefined, score: 3, children: 1
ishanpage 3 points 3 years ago

I'll be sure to read it when you do :)

path: 0 788158 975260 1004927 1017829, hotness: undefined, score: 3, children: 0
snowe 6 points 3 years ago

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.

path: 0 785512, hotness: undefined, score: 6, children: 3
ishanpage 5 points 3 years ago

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:snowe@programming.dev | jq
{
  "subject": "acct:snowe@programming.dev",
  "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"
      }
    }
  ]
}
path: 0 785512 785681, hotness: undefined, score: 5, children: 2
snowe 3 points 3 years ago

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.

path: 0 785512 785681 789305, hotness: undefined, score: 3, children: 1
ishanpage 2 points 3 years 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, user@lemmy.instance 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.

path: 0 785512 785681 789305 789530, hotness: undefined, score: 2, children: 0
programming
programming

@programming.dev

login for more options
28840
3727
3325

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 !webdev@programming.dev


go to feed...