Skip to content

Commit

Permalink
Rename jObj to align with style
Browse files Browse the repository at this point in the history
Co-authored-by: Sawood Alam <ibnesayeed@gmail.com>
  • Loading branch information
machawk1 and ibnesayeed committed Aug 26, 2020
1 parent e10fe94 commit a975ca3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ipwb/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -633,10 +633,10 @@ def show_uri(path, datetime=None):
return generate_no_mementos_interface(path, datetime)

cdxj_parts = cdxj_line.split(" ", 2)
jObj = json.loads(cdxj_parts[2])
json_object = json.loads(cdxj_parts[2])
datetime = cdxj_parts[1]

digests = jObj['locator'].split('/')
digests = json_object['locator'].split('/')

class HashNotFoundError(Exception):
pass
Expand Down Expand Up @@ -684,11 +684,11 @@ def handler(signum, frame):
print(e)
return "An unknown exception occurred", 500

if 'encryption_method' in jObj:
if 'encryption_method' in json_object:
key_string = None
while key_string is None:
if 'encryption_key' in jObj:
key_string = jObj['encryption_key']
if 'encryption_key' in json_object:
key_string = json_object['encryption_key']
else:
ask_for_key = ('Enter a path for file',
' containing decryption key: \n> ')
Expand All @@ -697,7 +697,7 @@ def handler(signum, frame):
padded_encryption_key = pad(key_string, AES.block_size)
key = base64.b64encode(padded_encryption_key)

nonce = b64decode(jObj['encryption_nonce'])
nonce = b64decode(json_object['encryption_nonce'])
cipher = AES.new(key, AES.MODE_CTR, nonce=nonce)
header = cipher.decrypt(base64.b64decode(header))
payload = cipher.decrypt(base64.b64decode(payload))
Expand All @@ -710,8 +710,8 @@ def handler(signum, frame):
h_lines.pop(0)

status = 200
if 'status_code' in jObj:
status = jObj['status_code']
if 'status_code' in json_object:
status = json_object['status_code']

resp = Response(payload, status=status)

Expand Down

0 comments on commit a975ca3

Please sign in to comment.