Commit 8775110
fix(data-classes): ensure lazy initialization for Cognito token generation response properties (#7653)
* fix(data-classes): ensure lazy initialization for Cognito token generation responses
Fixed inconsistent lazy initialization in PreTokenGenerationTriggerEventResponse
and PreTokenGenerationV2TriggerEvent response properties. Properties now
consistently initialize empty dictionaries in _data when None, preventing
None returns and ensuring modifications persist correctly.
Affects: claims_override_details, claims_scope_override_details,
id_token_generation, and access_token_generation properties.
* test(data-classes): use the original test scenario but keep the fixed access
* test(data-classes): fix linter format issues
* test(data-classes): add assertions for lazy initialization of token generation properties
---------
Co-authored-by: dirk.nilius <[email protected]>
Co-authored-by: Leandro Damascena <[email protected]>
Co-authored-by: Ana Falcão <[email protected]>1 parent 93c4b27 commit 8775110
File tree
2 files changed
+27
-19
lines changed- aws_lambda_powertools/utilities/data_classes
- tests/unit/data_classes/required_dependencies
2 files changed
+27
-19
lines changedLines changed: 14 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
579 | | - | |
580 | | - | |
581 | | - | |
582 | | - | |
583 | | - | |
584 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
585 | 582 | | |
586 | 583 | | |
587 | 584 | | |
| |||
597 | 594 | | |
598 | 595 | | |
599 | 596 | | |
600 | | - | |
601 | | - | |
602 | | - | |
603 | | - | |
604 | | - | |
605 | | - | |
606 | | - | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
607 | 601 | | |
608 | 602 | | |
609 | 603 | | |
| |||
622 | 616 | | |
623 | 617 | | |
624 | 618 | | |
625 | | - | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
626 | 622 | | |
627 | 623 | | |
628 | 624 | | |
629 | 625 | | |
630 | 626 | | |
631 | | - | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
632 | 630 | | |
633 | 631 | | |
634 | 632 | | |
| |||
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
191 | 191 | | |
192 | 192 | | |
193 | 193 | | |
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
232 | 236 | | |
233 | 237 | | |
234 | 238 | | |
| |||
246 | 250 | | |
247 | 251 | | |
248 | 252 | | |
249 | | - | |
250 | | - | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
251 | 261 | | |
252 | 262 | | |
253 | 263 | | |
| |||
0 commit comments