Signed get for inbox url

merge-requests/26/head
Bob Mottram 2021-09-15 15:05:08 +01:00
parent eec6e0c049
commit bb59ef07de
15 changed files with 70 additions and 6 deletions

View File

@ -261,9 +261,11 @@ def sendAnnounceViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey, fromPersonId,
sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -344,9 +346,11 @@ def sendUndoAnnounceViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = domain
(inboxUrl, pubKeyId, pubKey, fromPersonId,
sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,

View File

@ -122,9 +122,11 @@ def sendAvailabilityViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = domain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, nickname,

View File

@ -398,8 +398,10 @@ def sendBookmarkViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = domain
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -486,8 +488,10 @@ def sendUndoBookmarkViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = domain
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,

View File

@ -72,9 +72,10 @@ def sendDeleteViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
displayName) = getPersonBox(signingPrivateKeyPem, originDomain,
baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox, 53036)

View File

@ -739,10 +739,15 @@ if args.postDomains:
if not args.language:
args.language = 'en'
signingPrivateKeyPem = None
if not args.domain:
originDomain = getConfigParam(baseDir, 'domain')
else:
originDomain = args.domain
if args.secureMode:
signingPrivateKeyPem = getInstanceActorKey(baseDir, domain)
signingPrivateKeyPem = getInstanceActorKey(baseDir, originDomain)
domainList = getPublicPostDomains(None,
baseDir, nickname, domain,
originDomain,
proxyType, args.port,
httpPrefix, debug,
__version__,

View File

@ -1088,9 +1088,10 @@ def sendFollowRequestViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
displayName) = getPersonBox(signingPrivateKeyPem, originDomain,
baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox, 52025)
@ -1181,9 +1182,11 @@ def sendUnfollowRequestViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session,
wfRequest, personCache,
projectVersion, httpPrefix,

View File

@ -201,8 +201,10 @@ def sendLikeViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -287,8 +289,10 @@ def sendUndoLikeViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey, fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,

3
pgp.py
View File

@ -574,9 +574,10 @@ def pgpPublicKeyUpload(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = domain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
displayName) = getPersonBox(signingPrivateKeyPem, originDomain,
baseDir, session, wfRequest, personCache,
__version__, httpPrefix, nickname,
domain, postToBox, 52025)

View File

@ -320,7 +320,7 @@ def _getPersonBoxActor(session, baseDir: str, actor: str,
return None
def getPersonBox(signingPrivateKeyPem: str,
def getPersonBox(signingPrivateKeyPem: str, originDomain: str,
baseDir: str, session, wfRequest: {}, personCache: {},
projectVersion: str, httpPrefix: str,
nickname: str, domain: str,
@ -358,7 +358,7 @@ def getPersonBox(signingPrivateKeyPem: str,
_getPersonBoxActor(session, baseDir, personUrl,
profileStr, asHeader,
debug, projectVersion,
httpPrefix, domain,
httpPrefix, originDomain,
personCache, signingPrivateKeyPem)
if not personJson:
return None, None, None, None, None, None, None
@ -2190,9 +2190,11 @@ def sendPost(signingPrivateKeyPem: str, projectVersion: str,
postToBox = 'tlblogs'
# get the actor inbox for the To handle
originDomain = toDomain
(inboxUrl, pubKeyId, pubKey,
toPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -2335,9 +2337,11 @@ def sendPostViaServer(signingPrivateKeyPem: str, projectVersion: str,
postToBox = 'tlblogs'
# get the actor inbox for the To handle
originDomain = toDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -2541,8 +2545,10 @@ def sendSignedJson(postJsonObject: {}, session, baseDir: str,
postToBox = 'outbox'
# get the actor inbox/outbox for the To handle
originDomain = toDomain
(inboxUrl, pubKeyId, pubKey, toPersonId, sharedInboxUrl, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -3917,6 +3923,7 @@ def getPublicPostsOfPerson(baseDir: str, nickname: str, domain: str,
(personUrl, pubKeyId, pubKey,
personId, shaedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -3938,6 +3945,7 @@ def getPublicPostsOfPerson(baseDir: str, nickname: str, domain: str,
def getPublicPostDomains(session, baseDir: str, nickname: str, domain: str,
originDomain: str,
proxyType: str, port: int, httpPrefix: str,
debug: bool, projectVersion: str,
wordFrequency: {}, domainList: [],
@ -3969,6 +3977,7 @@ def getPublicPostDomains(session, baseDir: str, nickname: str, domain: str,
(personUrl, pubKeyId, pubKey,
personId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -4034,6 +4043,7 @@ def downloadFollowCollection(signingPrivateKeyPem: str,
def getPublicPostInfo(session, baseDir: str, nickname: str, domain: str,
originDomain: str,
proxyType: str, port: int, httpPrefix: str,
debug: bool, projectVersion: str,
wordFrequency: {}, systemLanguage: str,
@ -4064,6 +4074,7 @@ def getPublicPostInfo(session, baseDir: str, nickname: str, domain: str,
(personUrl, pubKeyId, pubKey,
personId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,
@ -4110,8 +4121,10 @@ def getPublicPostDomainsBlocked(session, baseDir: str,
""" Returns a list of domains referenced within public posts which
are globally blocked on this instance
"""
originDomain = domain
postDomains = \
getPublicPostDomains(session, baseDir, nickname, domain,
originDomain,
proxyType, port, httpPrefix,
debug, projectVersion,
wordFrequency, domainList, systemLanguage,
@ -4592,9 +4605,11 @@ def sendBlockViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix, fromNickname,
@ -4671,9 +4686,11 @@ def sendMuteViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix, fromNickname,
@ -4755,9 +4772,11 @@ def sendUndoMuteViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix, fromNickname,
@ -4843,9 +4862,11 @@ def sendUndoBlockViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox, avatarUrl,
displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest, personCache,
projectVersion, httpPrefix, fromNickname,
fromDomain, postToBox, 53892)

View File

@ -617,9 +617,11 @@ def sendShareViaServer(baseDir, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,
@ -720,9 +722,11 @@ def sendUndoShareViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,
@ -835,9 +839,11 @@ def sendWantedViaServer(baseDir, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,
@ -938,9 +944,11 @@ def sendUndoWantedViaServer(baseDir: str, session,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = fromDomain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, fromNickname,

View File

@ -224,9 +224,11 @@ def sendSkillViaServer(baseDir: str, session, nickname: str, password: str,
postToBox = 'outbox'
# get the actor inbox for the To handle
originDomain = domain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache, projectVersion,
httpPrefix, nickname, domain,

View File

@ -63,9 +63,11 @@ def instancesGraph(baseDir: str, handles: str,
str(wfRequest))
return dotGraphStr + '}\n'
originDomain = None
(personUrl, pubKeyId, pubKey,
personId, shaedInbox,
avatarUrl, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session, wfRequest,
personCache,
projectVersion, httpPrefix,

View File

@ -81,6 +81,7 @@ def htmlAccountInfo(cssCache: {}, translate: {},
This screen is shown if a moderator enters a handle and selects info
on the moderation screen
"""
signingPrivateKeyPem = None
msgStr1 = 'This account interacts with the following instances'
infoForm = ''
@ -114,8 +115,10 @@ def htmlAccountInfo(cssCache: {}, translate: {},
session = createSession(proxyType)
wordFrequency = {}
originDomain = None
domainDict = getPublicPostInfo(session,
baseDir, searchNickname, searchDomain,
originDomain,
proxyType, searchPort,
httpPrefix, debug,
__version__, wordFrequency, systemLanguage,

View File

@ -1273,9 +1273,11 @@ def individualPostAsHtml(signingPrivateKeyPem: str,
avatarUrl2 = None
displayName = None
if postActorWf:
originDomain = domain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl2, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session,
postActorWf,
personCache,

View File

@ -2137,9 +2137,11 @@ def _individualFollowAsHtml(signingPrivateKeyPem: str,
domain, __version__, debug, False,
signingPrivateKeyPem)
originDomain = domain
(inboxUrl, pubKeyId, pubKey,
fromPersonId, sharedInbox,
avatarUrl2, displayName) = getPersonBox(signingPrivateKeyPem,
originDomain,
baseDir, session,
followUrlWf,
personCache, projectVersion,