Skip to content

Commit

Permalink
debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
paulineribeyre committed Dec 16, 2024
1 parent ec11731 commit 169c5b1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gen3workflow/routes/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ async def s3_endpoint(path: str, request: Request):

body = await request.body()
body_hash = hashlib.sha256(body).hexdigest()
print("body", body)
for k, v in dict(request.headers).items():
print(k, v)
timestamp = request.headers["x-amz-date"]
date = timestamp[:8] # the date portion (YYYYMMDD) of the timestamp
region = config["USER_BUCKETS_REGION"]
Expand Down Expand Up @@ -139,6 +142,7 @@ async def s3_endpoint(path: str, request: Request):
credentials = session.get_credentials()
assert credentials, "No AWS credentials found"
headers["x-amz-security-token"] = credentials.token
print("credentials.token", credentials.token)

# construct the canonical request
canonical_headers = "".join(
Expand Down Expand Up @@ -173,6 +177,7 @@ async def s3_endpoint(path: str, request: Request):
# generate the signing key, and generate the signature by signing the string to sign with the
# signing key
signing_key = get_signature_key(credentials.secret_key, date, region, service)
print("signing_key", signing_key)
signature = hmac.new(
signing_key, string_to_sign.encode("utf-8"), hashlib.sha256
).hexdigest()
Expand Down

0 comments on commit 169c5b1

Please sign in to comment.