#author("2023-07-30T09:29:52+00:00","default:mogamin","mogamin")
#author("2023-08-21T17:34:47+00:00","default:mogamin","mogamin")
* webfinger [#z0ccfdfd]

URI で指定したエンティティに関する情報を照会するプロトコル。
http を使用してやりとりされる。

URI は、たとえば ActivityPub でユーザ名として扱われる `acct:` や、web ページのアドレスとして広く使われている `https:` など。%%ほかに知らない。%%

WebFinger
https://webfinger.net/

RFC 7033 - WebFinger
https://datatracker.ietf.org/doc/html/rfc7033

webfinger - ActivityPubまとめwiki
https://scrapbox.io/activitypub/webfinger

** ActivityPub 実装 [#xc61ca64]

webfinger を使って、ユーザ名 acct:user@​example.com と http エンドポイント((いわゆる URL)) h​ttps://example.com/user を相互に照会できる。

webfinger エンドポイントは下記のような URL をもち、`resource=` に任意の URI を与えることで該当するエンティティの情報を返す。
https://kumarin.co/.well-known/webfinger?resource=acct:mg@kumarin.co
https://kumarin.co/.well-known/webfinger?resource=https://don.kumarin.co/@mg

上記2つの応答内容は同じ。

応答の例
 {
   "subject": "acct:mg@kumarin.co",
   "aliases": [
     "https://don.kumarin.co/@mg",
     "https://don.kumarin.co/users/mg"
   ],
   "links": [
     {
       "rel": "http://webfinger.net/rel/profile-page",
       "type": "text/html",
       "href": "https://don.kumarin.co/@mg"
     },
     {
       "rel": "self",
       "type": "application/activity+json",
       "href": "https://don.kumarin.co/users/mg"
     },
     {
       "rel": "http://ostatus.org/schema/1.0/subscribe",
       "template": "https://don.kumarin.co/authorize_interaction?uri={uri}"
     }
   ]
 }

** rel: h​ttp://ostatus.org/schema/1.0/subscribe [#h5befe2c]

webfinger が示すユーザが任意の URI を購読するためのエンドポイントを、この rel をもつひな形で取得できる。

11.  Discovery - Draft: OStatus 1.0 Draft 2
https://ostatus.github.io/spec/OStatus%201.0%20Draft%202.html#anchor10

たとえば acct:Mogami@​example.com について照会した webfinger 応答に
 {
   "rel": "http://ostatus.org/schema/1.0/subscribe",
   "template": "https://example.com/authorize_interaction?uri={uri}"
 }
が含まれるとき、`{uri}` に `acct:Oyodo@​example.social` を与えると、Mogami@​example.com が Oyodo@​example.social をフォロー (購読) するためのエンドポイント
 https://example.com/authorize_interaction?uri=acct:Oyodo@​example.social
を導くことができ、これに @Mogami がアクセスすることで @Oyodo をフォローできる。という感じ。

*** 利用 [#w735374b]

[[Mastodon]]/mastodon#26075 において導入された interaction modal ((未ログインユーザがフォロー、お気に入り、ブーストなどを行おうとしたときの誘導画面)) には、訪問者が自分のアカウントがあるサーバー (home) の URL などを入力することで訪問者が home サーバー上でフォローや投稿のお気に入り登録ができる UI が搭載された。

Change interaction modal in web UI
https://github.com/mastodon/mastodon/pull/26075

この仕組みのなかで[[当 API で転送先となるひな形を取得しているようすがみえる>https://github.com/mastodon/mastodon/blob/3554c527954441fd924586a49c7d99a89101ac7e/app/javascript/packs/remote_interaction_helper.ts#L44]]。

[[Misskey]] フォークの めいすきー ([[commit 259385f>https://github.com/mei23/misskey/commit/259385f8fec9194c300591cef6f9249bea9667e5#diff-7091493db9d7dd5c72b9634069b19fa2f5fd372382e27a5442961c495ff5f38a]])((めいすきーのほうは現在は削除されてしまったみたいだ))、Areionskey ([[commit 5080208>https://github.com/sakura-tel/areionskey/commit/5080208b7a9a919842ca3650e0102b30833d79d3#diff-7091493db9d7dd5c72b9634069b19fa2f5fd372382e27a5442961c495ff5f38a]]) もこの API を用いて同様の機能を実装している。


トップ   編集 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS