Commit 7f4b8f3
Olivier Gintrand
fix: handle missing expires_in in OAuth token response
When an OAuth2 provider omits the expires_in field from the token
response (which is RECOMMENDED but not REQUIRED per RFC 6749 Section
5.1), the gateway crashes with a TypeError during token storage.
Changes:
- oauth_manager.py: Extract expires_in with .get() and convert to
int only when present, passing None when absent
- token_storage_service.py: Accept Optional[int] for expires_in and
skip expires_at computation when None, logging the event
Fixes #3989
Signed-off-by: Olivier Gintrand <olivier.gintrand@forterro.com>1 parent a2aa82a commit 7f4b8f3
2 files changed
Lines changed: 14 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
573 | 573 | | |
574 | 574 | | |
575 | 575 | | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
576 | 581 | | |
577 | 582 | | |
578 | 583 | | |
579 | 584 | | |
580 | 585 | | |
581 | 586 | | |
582 | | - | |
| 587 | + | |
583 | 588 | | |
584 | 589 | | |
585 | 590 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
107 | 111 | | |
108 | 112 | | |
109 | 113 | | |
| |||
0 commit comments