Bring back some webfinger settings

master
Bob Mottram 2019-08-26 15:30:09 +01:00
parent 3358155330
commit 641c1fabe5
1 changed files with 22 additions and 4 deletions

View File

@ -123,10 +123,15 @@ def createWebfingerEndpoint(nickname: str,domain: str,port: int, \
],
"links": [
{
"href": httpPrefix+"://"+domain+"/@"+personName,
"href": httpPrefix+"://"+domain+"/@"+nickname,
"rel": "http://webfinger.net/rel/profile-page",
"type": "text/html"
},
{
"href": httpPrefix+"://"+domain+"/users/"+nickname+".atom",
"rel": "http://schemas.google.com/g/2010#updates-from",
"type": "application/atom+xml"
},
{
"href": personId,
"rel": "self",
@ -144,10 +149,23 @@ def createWebfingerEndpoint(nickname: str,domain: str,port: int, \
def webfingerMeta(httpPrefix: str,domainFull: str) -> str:
"""Return /.well-known/host-meta
"""
#return \
# "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
# "<XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\">" \
# "<Link rel=\"lrdd\" type=\"application/xrd+xml\" template=\""+httpPrefix+"://"+domainFull+"/.well-known/webfinger?resource={uri}\"/>" \
# "</XRD>"
return \
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" \
"<XRD xmlns=\"http://docs.oasis-open.org/ns/xri/xrd-1.0\">" \
"<Link rel=\"lrdd\" type=\"application/xrd+xml\" template=\""+httpPrefix+"://"+domainFull+"/.well-known/webfinger?resource={uri}\"/>" \
"<?xml version=1.0' encoding=UTF-8'?>" \
"<XRD xmlns=http://docs.oasis-open.org/ns/xri/xrd-1.0'" \
" xmlns:hm=http://host-meta.net/xrd/1.0'>" \
"" \
"<hm:Host>"+domainFull+"</hm:Host>" \
"" \
"<Link rel=lrdd" \
" template="+httpPrefix+"://"+domainFull+"/describe?uri={uri}'>" \
" <Title>Resource Descriptor</Title>" \
" </Link>" \
"</XRD>"
def webfingerLookup(path: str,baseDir: str,port: int,debug: bool) -> {}: