Skip to content

Commit 74c5206

Browse files
clean up
1 parent 599f1ef commit 74c5206

File tree

3 files changed

+4
-7
lines changed

3 files changed

+4
-7
lines changed

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@
160160
"filename": "docs/s3.md",
161161
"hashed_secret": "08d2e98e6754af941484848930ccbaddfefe13d6",
162162
"is_verified": false,
163-
"line_number": 56
163+
"line_number": 55
164164
}
165165
],
166166
"migrations/versions/e1886270d9d2_create_system_key_table.py": [
@@ -209,5 +209,5 @@
209209
}
210210
]
211211
},
212-
"generated_at": "2026-02-03T17:56:09Z"
212+
"generated_at": "2026-02-25T19:02:33Z"
213213
}

docs/s3.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ Note: This discussion can apply to many use cases, but it is written with a spec
55
Contents:
66
- [Using IAM keys](#using-iam-keys)
77
- [Using a custom S3 endpoint](#using-a-custom-s3-endpoint)
8-
- [Diagram](#diagram)
98

109
## Using IAM keys
1110

gen3workflow/routes/s3.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -280,27 +280,25 @@ async def s3_endpoint(path: str, request: Request):
280280

281281
# construct the canonical request. All header keys must be lowercase
282282
sorted_headers = sorted(list(headers.keys()), key=str.casefold)
283-
lowercase_sorted_headers = [k.lower() for k in sorted_headers]
284283
canonical_headers = "".join(
285284
f"{key.lower()}:{headers[key]}\n" for key in sorted_headers
286285
)
287-
signed_headers = ";".join(lowercase_sorted_headers)
286+
signed_headers = ";".join([k.lower() for k in sorted_headers])
288287
query_params = dict(request.query_params)
289288
# the query params in the canonical request have to be sorted:
290289
query_params_names = sorted(list(query_params.keys()))
291290
canonical_query_params = "&".join(
292291
f"{urllib.parse.quote_plus(key)}={urllib.parse.quote_plus(query_params[key])}"
293292
for key in query_params_names
294293
)
295-
body_hash = headers["x-amz-content-sha256"]
296294
canonical_request = (
297295
f"{request.method}\n"
298296
f"{request_path}\n"
299297
f"{canonical_query_params}\n"
300298
f"{canonical_headers}"
301299
f"\n"
302300
f"{signed_headers}\n"
303-
f"{body_hash}"
301+
f"{headers['x-amz-content-sha256']}"
304302
)
305303

306304
# construct the string to sign based on the canonical request

0 commit comments

Comments
 (0)