Repository navigation
Commit 0c74608
committed
fix: drop a client-supplied x-amz-tenant-id before setting the context value
The adapter asserts `x-amz-tenant-id` from the Lambda invocation context, but it
only ever set the header, never cleared one the caller had sent. When the context
carried no tenant ID the block was skipped entirely, so a caller's own
`x-amz-tenant-id` was forwarded to the application untouched — the opposite of
what the multi-tenancy guide promised.
Remove the header before the conditional insert, the same way the sibling
`x-amzn-request-context` and `x-amzn-lambda-context` headers are set
unconditionally. The adapter now either sets this header itself or leaves the
application with none.
Also rewrite the multi-tenancy guide. It claimed no additional configuration was
required, which is wrong in a way that matters: the tenant ID only arrives when
the function uses Lambda tenant isolation, which is immutable at creation time,
excludes function URLs, and among HTTP triggers works only with API Gateway REST.
A reader who followed the old guide on a function URL would see an empty tenant on
every request, and the tempting workaround is to start trusting a caller-supplied
header.1 parent 64a89c2 commit 0c74608
2 files changed
Lines changed: 74 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
8 | 23 | | |
9 | 24 | | |
10 | 25 | | |
| |||
22 | 37 | | |
23 | 38 | | |
24 | 39 | | |
25 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1600 | 1600 | | |
1601 | 1601 | | |
1602 | 1602 | | |
1603 | | - | |
| 1603 | + | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
1604 | 1607 | | |
1605 | 1608 | | |
1606 | 1609 | | |
| |||
2506 | 2509 | | |
2507 | 2510 | | |
2508 | 2511 | | |
| 2512 | + | |
| 2513 | + | |
2509 | 2514 | | |
2510 | 2515 | | |
2511 | 2516 | | |
2512 | 2517 | | |
| 2518 | + | |
| 2519 | + | |
2513 | 2520 | | |
2514 | 2521 | | |
2515 | 2522 | | |
| |||
2519 | 2526 | | |
2520 | 2527 | | |
2521 | 2528 | | |
| 2529 | + | |
| 2530 | + | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
2522 | 2566 | | |
2523 | 2567 | | |
2524 | 2568 | | |
| |||
0 commit comments