Removed a bunch of old/churned client files and updated some older clients that I haven't touched in a while. Lots of summer cleaning!
This commit is contained in:
@ -4,14 +4,20 @@ import hmac
|
||||
import json
|
||||
import uuid
|
||||
|
||||
secret_key = b'IU9BRsR7WTDWdDooX4w9DFLqweAZreLwaDDaLnVRkHZeubcSdA'
|
||||
# nTransit Shared Secret Key
|
||||
# secret_key = b'IU9BRsR7WTDWdDooX4w9DFLqweAZreLwaDDaLnVRkHZeubcSdA'
|
||||
|
||||
# Spark Shared Secret Key
|
||||
secret_key = b'DK9BRsR7WTDWdDooX4w9DFLnqjAZreLwaFFaLnVRkHZeubcKdR'
|
||||
|
||||
prod_url = "https://walmart.northpass.io/helpMenu"
|
||||
driver_auth = "https://walmart.northpass.io/driver/authenticate"
|
||||
stage_url = "https://walmart.np-mt-dev.net/helpMenu"
|
||||
random_uuid = uuid.uuid4()
|
||||
|
||||
msg_body = {
|
||||
"messageExpirationTimestamp": 14357000,
|
||||
"sessionExpiryTimeInSeconds": 3600,
|
||||
"messageExpirationTimestamp": 1758722640,
|
||||
"driver": {
|
||||
"uuid": str(random_uuid),
|
||||
"accessLevel": "BEGINNER"
|
||||
@ -20,20 +26,20 @@ msg_body = {
|
||||
"appContext": "contextAwareHelp"
|
||||
}
|
||||
|
||||
msg_body_json = json.dumps(msg_body, separators=(',', ':'), sort_keys=True)
|
||||
msg_body_json = json.dumps(msg_body, sort_keys=True)
|
||||
body_signature = hmac.new(secret_key, msg_body_json.encode('utf-8'), hashlib.sha256).hexdigest()
|
||||
|
||||
# "accept": "application/json",
|
||||
# "X-Api-Key": "6hUfJdAartHTHhHc0WIRZYPWe",
|
||||
# header = {
|
||||
# "X-Hmac-SHA256": '7731606cf88856a56450b0a767cddea002db97685646578caeac20ab09ffdab0'
|
||||
# }
|
||||
header = {
|
||||
"X-Hmac-SHA256": 'fec9bb0355b2b599d6cfc22c73b5e8df3159d0b8b275af5229c900e29e3081c8'
|
||||
}
|
||||
|
||||
# canonical_headers = '\n'.join(f'{k.lower()}:{v.strip()}' for k, v in sorted(headers.items()))
|
||||
# header_signature = hmac.new(secret_key, canonical_headers.encode('utf-8'), hashlib.sha256).hexdigest()
|
||||
headers = { 'Content-Type': 'application/json','X-Hmac-SHA256': body_signature }
|
||||
|
||||
# prod = requests.post(driver_auth, headers=headers)
|
||||
# prod = requests.post(prod_url, headers=headers, json=msg_body)
|
||||
prod = requests.post(prod_url, headers=headers, json=msg_body)
|
||||
print(f"Status Code: {prod.status_code}")
|
||||
print(f"Response: {prod.json()}")
|
||||
@ -55,5 +61,19 @@ curl -X POST --location "https://ntransit.northpass.io/driver/authenticate" \
|
||||
}
|
||||
}'
|
||||
|
||||
Testing the same curl respone for Spark:
|
||||
curl -X POST --location "https://walmart.northpass.io/helpMenu" \
|
||||
-H "X-Hmac-SHA256: fec9bb0355b2b599d6cfc22c73b5e8df3159d0b8b275af5229c900e29e3081c8" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"sessionExpiryTimeInSeconds": 3600,
|
||||
"messageExpirationTimestamp": 1758722640,
|
||||
"driver": {
|
||||
"uuid": "3949c78e-9a9c-43d6-92f0-8c474c0e1d1e",
|
||||
"accessLevel": "BEGINNER"
|
||||
},
|
||||
"subCategory": "REWARDS",
|
||||
"appContext": "contextAwareHelp"
|
||||
}'
|
||||
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user