Allow access to shared inbox

master
Bob Mottram 2019-08-05 17:05:08 +01:00
parent b3d597ae06
commit 6821a4ba31
2 changed files with 12 additions and 6 deletions

View File

@ -1125,12 +1125,14 @@ class PubServer(BaseHTTPRequestHandler):
nickname=self.path.replace('/users/','').replace('/inbox','') nickname=self.path.replace('/users/','').replace('/inbox','')
print('DEBUG: '+nickname+ \ print('DEBUG: '+nickname+ \
' was not authorized to access '+self.path) ' was not authorized to access '+self.path)
if self.server.debug: if self.path!='/inbox':
print('DEBUG: GET access to inbox is unauthorized') # not the shared inbox
self.send_response(405) if self.server.debug:
self.end_headers() print('DEBUG: GET access to inbox is unauthorized')
self.server.POSTbusy=False self.send_response(405)
return self.end_headers()
self.server.POSTbusy=False
return
# get outbox feed for a person # get outbox feed for a person
outboxFeed=personBoxJson(self.server.baseDir,self.server.domain, \ outboxFeed=personBoxJson(self.server.baseDir,self.server.domain, \

View File

@ -86,6 +86,10 @@ def getPersonPubKey(session,personUrl: str,personCache: {},debug: bool) -> str:
if not personUrl: if not personUrl:
return None return None
personUrl=personUrl.replace('#main-key','') personUrl=personUrl.replace('#main-key','')
if personUrl.endswith('/users/inbox'):
if debug:
print('DEBUG: Obtaining public key for shared inbox')
personUrl=personUrl.replace('/users/inbox','/inbox')
personJson = getPersonFromCache(personUrl,personCache) personJson = getPersonFromCache(personUrl,personCache)
if not personJson: if not personJson:
if debug: if debug: