From aa962c6ee93f9e6e3bb95a64287baad665f48a3a Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Fri, 22 Apr 2022 11:10:26 -0500 Subject: [PATCH] Add actor IRI and remote interaction URL to WebFinger response --- routers/web/webfinger.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/routers/web/webfinger.go b/routers/web/webfinger.go index 3e8f40784..02cbe1af2 100644 --- a/routers/web/webfinger.go +++ b/routers/web/webfinger.go @@ -92,6 +92,7 @@ func WebfingerQuery(ctx *context.Context) { aliases := []string{ u.HTMLURL(), + appURL.String() + "api/v1/activitypub/user/" + strings.ToLower(u.Name), } if !u.KeepEmailPrivate { aliases = append(aliases, fmt.Sprintf("mailto:%s", u.Email)) @@ -107,6 +108,15 @@ func WebfingerQuery(ctx *context.Context) { Rel: "http://webfinger.net/rel/avatar", Href: u.AvatarLink(), }, + { + Rel: "self", + Type: "application/activity+json", + Href: appURL.String() + "api/v1/activitypub/user/" + strings.ToLower(u.Name), + }, + { + Rel: "http://ostatus.org/schema/1.0/subscribe", + Href: appURL.String() + "api/v1/authorize_interaction?uri={uri}", + }, } ctx.JSON(http.StatusOK, &webfingerJRD{