Add PGP keys and XMPP handle to the WebFinger output
This commit is contained in:
parent
85d95fb5d7
commit
a518d72a7d
1 changed files with 8 additions and 1 deletions
|
@ -29,15 +29,22 @@ def webfinger(request):
|
||||||
def link(rel, href, type):
|
def link(rel, href, type):
|
||||||
return {'rel': rel, 'href': urljoin(base, href), 'type': 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 = {
|
info = {
|
||||||
'subject': 'acct:' + user.email,
|
'subject': 'acct:' + user.email,
|
||||||
'aliases': (
|
'aliases': (
|
||||||
urljoin(base, user.url),
|
urljoin(base, user.url),
|
||||||
'mailto:' + user.email,
|
'mailto:' + user.email,
|
||||||
|
'xmpp:' + user.xmpp,
|
||||||
),
|
),
|
||||||
'links': (
|
'links': (
|
||||||
link(rel=AVATAR, href=user.avatar.url, type='image/png'),
|
link(rel=AVATAR, href=user.avatar.url, type='image/png'),
|
||||||
link(rel=PROFILE_PAGE, href=user.url, type='text/html'),
|
link(rel=PROFILE_PAGE, href=user.url, type='text/html'),
|
||||||
),
|
) + key_links,
|
||||||
}
|
}
|
||||||
return JsonResponse(info, content_type='application/jrd+json')
|
return JsonResponse(info, content_type='application/jrd+json')
|
||||||
|
|
Loading…
Reference in a new issue