-
Notifications
You must be signed in to change notification settings - Fork 0
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
Defining the Retrieval Source for Webmentions #2
Comments
There's some discussion on a similar concept for OAuth2: https://mailarchive.ietf.org/arch/msg/oauth/6lfqd3n8O196a3Om9HxVfCFLLQk/ |
I'm in the favor of making this something that lives in the same endpoint following the concept of |
I wonder if |
Some people use the GET behavior to display a webmention form. |
Interesting, I hadn't seen that. @dshanske: Does the WordPress plugin do anything for GET? |
We do that. If you do a GET, no parameters on the endpoint you get a webmention form. But that's with no query parameters, so this could still work. |
I like that flow @manton, definitely more backcompat! |
From what's proposed so far:
Does that sound good so far? |
That sounds good to me! |
One reason I'm not super excited about the idea of using the same endpoint for retrieving webmentions is it will likely be very common to require authentication to retrieve the webmentions, whereas the webmention endpoint has to not require authentication to accept webmentions. It's usually harder to make a single endpoint do different things depending on whether a request is authenticated. |
If we don't use the same endpoint, I assume we'll want either another |
Hm, I figure that optional authorization for an endpoint could be done similarly to the presence of a parameter in a query or in a header. And to get more Webmentions that are potentially gated (for moderation reasons) that providing a token would allow those entries to be added into the list. |
@aaronpk What ideas for fetching webmentions do you have? I remember you mentioning from the IETF? |
So currently, I'm toying with my local setup having a tag like the following on pages that accept Webmentions: ...
<link rel="webmention" href="https://webmention.service/endpoint" />
<link rel="webmention feed" href="https://webmention.service/endpoint/feed.html" type="text/html" title="Mentions on this Page" />
<link rel="webmention feed" href="https://webmention.service/endpoint/feed.jf2" type="application/json+jf2" />
... After seeing how Wordpress sites tend to explicitly expose a feed for subscribing to comments on a particular page, this felt like a good form of prior art to follow and something that works with existing implementations (because it can simply fail with a 400 if one attempts to send a Webmention using the Webmention feed's URL and because we can specify the usable mime types for it in there) |
I opted for the above because this would allow my endpoint to just focus on handling CRUD'ing Webmentions as they come in and allowing another dedicated endpoint to handle rendering and do conditional authorization if needed. |
That's an interesting approach. I think I'd still prefer something like |
I've been thinking more about Aaron's earlier comment, to keep it simpler for existing implementations, perhaps using the rel "webmention-endpoint" that does what Manton suggests? That way, I can keep having my implementation use a singular endpoint for both but if another implementation chooses to have a different endpoint, it could be specific accordingly. The biggest win with this approach is that if it's all dependent on changing a |
@jalcine Not sure I'm understanding this suggestion… So, keep the existing rel="webmention" the same, but add "webmention-endpoint" which returns JSON to describe the different feeds? I think I'm confused. 🙂 |
Close! I'm proposing something like this: Single Endpoint Setups<link rel="webmention webmention-endpoint" href="https://my.webmention.endpoint/the-url" /> This would allow for people like me who'd want to use a singular endpoint to both do the existing work of receiving Webmentions and sending them as well as any kind of query work we could put with a Micropub-esque query (or something else - Micropub comes to mind but it could be something else). Multiple Endpoint Setups<link rel="webmention-endpoint" href="https://my.webmention.endpoint/the-url" />
<link rel="webmention" href="https://my.webmention.endpoint/the-other-url" /> This allows for the case that @aaronpk advocates and keeps those concerns separately. It's up to the one handling fetching, sending, etc to discern the difference of these endpoints and that's already done by the spec. |
If we go with something like this, I think we need a rel name other than "webmention-endpoint"… Something more specific so it won't be confused with regular "webmention". I also think the default behavior (if there is only a single |
Coming back to this while working on Lighthouse, I've decided to work to maintain as much of the existing functionality of Webmention while making it extensible. Here's what I have (and have planned): Existing FunctionalitySending a Webmention from the standard (at the time of writing):
New FunctionalityFetching Webmentions for a particular URL (using a Micropub-styled query):
In this example, I put the expected format in both the Fetching Webmention counts for a particular URL (using a Micropub-styled query):
The Sending a Webmention (this follows the Micropub flow for updating posts and is implicitly how the act of creation of entries are represented in Koype):
This approach still works with existing formats (if the server is capable of either defaulting to the classic approach or defaulting the Pros and Cons
I think Con 1 can be fixed by clients by attempting to query for configuration. If it fails, they can that it's operating with an older version of Webmention that doesn't support queries. The failure case would be if it doesn't return a JSON body, that is, some places might return HTML on a GET request and that's OK. |
Ah, other things I wanted to add into a querying endpoint was the ability to look up URLs that can be sent a Webmention (similar to what https://webmention.app/ does). That request would look like:
|
I know that authentication was a potential issue here. In my implementation, having conditional authentication isn't too difficult, so I'm curious about the case here where it would be (like is the authentication token checked before anything occurs in a request?). |
Cool. I'm going to add support for |
I also wonder about consistency with Webmention.io's JSON output. It has a |
I only used
It's probably because it returns a top-level item (an |
I think it'd be okay to do |
An upside of this approach with the |
I've added an initial version of this GET to Micro.blog. I support "jf2", "mf2+json" (same thing), or "jsonfeed" in the format for now. I also have a few "wm-" fields that Webmention.io uses. Here's what it looks like.
{
"type": "feed",
"name": "Conversation",
"children": [
{
"type": "entry",
"author": {
"type": "card",
"name": "Pete Moore",
"url": "https://pimoore.ca",
"photo": "https://micro.blog/pimoore/avatar.jpg"
},
"url": "https://micro.blog/pimoore/12577850",
"published": "2022-03-12T17:00:16+00:00",
"wm-received": "2022-03-12T17:00:16+00:00",
"wm-id": 12577850,
"content": {
"text": "@manton wow, Utah really is gorgeous.",
"html": "<p><a href=\"https://micro.blog/manton\">@manton</a> wow, Utah really is gorgeous.</p>\n"
},
"mention-of": "https://www.manton.org/2022/03/12/speaking-of-cold.html",
"wm-property": "mention-of",
"wm-private": false
}
]
}
{
"version": "https://jsonfeed.org/version/1.1",
"title": "Conversation",
"home_page_url": "https://micro.blog/manton/12577803",
"feed_url": "https://micro.blog/webmention?target=https%3A%2F%2Fwww.manton.org%2F2022%2F03%2F12%2Fspeaking-of-cold.html&format=jsonfeed",
"items": [
{
"id": "12577850",
"content_html": "<p><a href=\"https://micro.blog/manton\">@manton</a> wow, Utah really is gorgeous.</p>\n",
"url": "https://micro.blog/pimoore/12577850",
"date_published": "2022-03-12T17:00:16+00:00",
"authors": [
{
"name": "Pete Moore",
"url": "https://pimoore.ca",
"avatar": "https://micro.blog/pimoore/avatar.jpg",
"_microblog": {
"username": "pimoore"
}
}
]
}
]
} |
Amazing! I can imagine this will be great for those who want to show mentions on their sites now. I'm still working to utilize these feeds on my site, but this is a great first step! |
Because I'm reusing some logic from my Micropub server for these endpoints, it'll have all of the querying options as well in Micropub (filtering, sorting, range fields, etc). Hoping to have a public alpha of this by end of the month (if not 10 Apr) |
The Webmention spec provides a means of resolving the receiver. This issue is meant to define where said Webmentions can be requested from for the later rendering and presentation of them by a party.
The text was updated successfully, but these errors were encountered: