quieten some debug

master
Bob Mottram 2019-08-23 11:57:27 +01:00
parent 9c137b0560
commit d05a416998
3 changed files with 20 additions and 24 deletions

View File

@ -821,22 +821,18 @@ if args.actor:
domain,__version__)
else:
wfRequest={
"aliases": [
httpPrefix+'://'+domain+'/users/inbox'
],
"links": [
{
"href": httpPrefix+'://'+domain+'/users/inbox',
"rel": "self",
"type": "application/activity+json"
}
],
"subject": 'acct:inbox@'+domain
}
'aliases': [httpPrefix+'://'+domain+'/@inbox',
httpPrefix+'://'+domain+'/users/inbox'],
'links': [{'href': httpPrefix+'://'+domain+'/users/inbox',
'rel': 'self',
'type': 'application/activity+json'}],
'subject': 'acct:inbox@'+domain
}
if not wfRequest:
print('Unable to webfinger '+nickname+'@'+domain)
sys.exit()
asHeader = {'Accept': 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'}
personUrl = getUserUrl(wfRequest)
personJson = getJson(session,personUrl,asHeader,None,__version__,httpPrefix,domain)

View File

@ -142,8 +142,8 @@ def verifyPostHeaders(httpPrefix: str,publicKeyPem: str,headers: dict, \
k: v[1:-1]
for k, v in [i.split('=', 1) for i in signatureHeader.split(',')]
}
print('********************signatureHeader: '+str(signatureHeader))
print('********************signatureDict: '+str(signatureDict))
#print('********************signatureHeader: '+str(signatureHeader))
#print('********************signatureDict: '+str(signatureDict))
# Unpack the signed headers and set values based on current headers and
# body (if a digest was included)
@ -152,32 +152,32 @@ def verifyPostHeaders(httpPrefix: str,publicKeyPem: str,headers: dict, \
if signedHeader == '(request-target)':
signedHeaderList.append(
f'(request-target): {method.lower()} {path}')
print('***************************Verify (request-target): '+method.lower()+' '+path)
#print('***************************Verify (request-target): '+method.lower()+' '+path)
elif signedHeader == 'digest':
if messageBodyDigest:
bodyDigest=messageBodyDigest
else:
bodyDigest = messageContentDigest(messageBodyJsonStr)
signedHeaderList.append(f'digest: SHA-256={bodyDigest}')
print('***************************Verify digest: SHA-256='+bodyDigest)
print('***************************Verify messageBodyJsonStr: '+messageBodyJsonStr)
#print('***************************Verify digest: SHA-256='+bodyDigest)
#print('***************************Verify messageBodyJsonStr: '+messageBodyJsonStr)
else:
if headers.get(signedHeader):
print('***************************Verify '+signedHeader+': '+headers[signedHeader])
#print('***************************Verify '+signedHeader+': '+headers[signedHeader])
signedHeaderList.append(
f'{signedHeader}: {headers[signedHeader]}')
else:
signedHeaderCap=signedHeader.capitalize()
print('***************************Verify '+signedHeaderCap+': '+headers[signedHeaderCap])
#print('***************************Verify '+signedHeaderCap+': '+headers[signedHeaderCap])
if headers.get(signedHeaderCap):
signedHeaderList.append(
f'{signedHeader}: {headers[signedHeaderCap]}')
print('***********************signedHeaderList: ')
pprint(signedHeaderList)
#print('***********************signedHeaderList: ')
#pprint(signedHeaderList)
# Now we have our header data digest
signedHeaderText = '\n'.join(signedHeaderList)
print('***********************Verify: signedHeaderText: '+signedHeaderText)
#print('***********************Verify: signedHeaderText: '+signedHeaderText)
headerDigest = SHA256.new(signedHeaderText.encode('ascii'))
# Get the signature, verify with public key, return result

View File

@ -1194,11 +1194,11 @@ def sendSignedJson(postJsonObject: {},session,baseDir: str, \
else:
wfRequest={
"aliases": [
httpPrefix+'://'+toDomain+'/inbox'
httpPrefix+'://'+toDomain+'/users/inbox'
],
"links": [
{
"href": httpPrefix+'://'+toDomain+'/inbox',
"href": httpPrefix+'://'+toDomain+'/users/inbox',
"rel": "self",
"type": "application/activity+json"
}