Browse Source

Add PGP keys and XMPP handle to the WebFinger output

pull/1/head
Danielle McLean 5 years ago
parent
commit
a518d72a7d
Signed by: 00dani
GPG Key ID: 5A5D2D1AFF12EEC5
  1. 9
      wellknowns/views/webfinger.py

9
wellknowns/views/webfinger.py

@ -29,15 +29,22 @@ def webfinger(request):
def link(rel, href, type):
return {'rel': rel, 'href': urljoin(base, href), 'type': type}
key_links = tuple(link(
rel='pgpkey',
href=key.file.url,
type='application/pgp-keys',
) for key in user.keys.all())
info = {
'subject': 'acct:' + user.email,
'aliases': (
urljoin(base, user.url),
'mailto:' + user.email,
'xmpp:' + user.xmpp,
),
'links': (
link(rel=AVATAR, href=user.avatar.url, type='image/png'),
link(rel=PROFILE_PAGE, href=user.url, type='text/html'),
),
) + key_links,
}
return JsonResponse(info, content_type='application/jrd+json')

Loading…
Cancel
Save