Repository navigation
Commit bf1e986
fix(sandbox): reject service names as regions in extract_aws_region
Boto3 connects to global S3 endpoints like
bucket.s3.amazonaws.com (no region in the hostname). The previous
extract_aws_region returned "s3" for this pattern because it took
the label at parts[len-3] without checking if it was actually a
region.
Add looks_like_region() which requires a hyphen followed by a digit
(e.g., us-east-1). Service names like "s3" or "bedrock-runtime" are
rejected, causing the fallback to us-east-1.
Refs NVIDIA#15761 parent 715b5f5 commit bf1e986
1 file changed
Lines changed: 23 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
| |||
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
26 | | - | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
27 | 43 | | |
28 | 44 | | |
29 | 45 | | |
| |||
36 | 52 | | |
37 | 53 | | |
38 | 54 | | |
39 | | - | |
| 55 | + | |
40 | 56 | | |
41 | 57 | | |
42 | 58 | | |
| |||
358 | 374 | | |
359 | 375 | | |
360 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
361 | 382 | | |
362 | 383 | | |
363 | 384 | | |
| |||
0 commit comments