Commit 4dd4f3b
Chris Grierson
fix: add timeout to requests.post()/get() calls in oauth.py
requests.post() and requests.get() calls in oauth.py's retrieve_token(),
get_azure_entra_id_workspace_endpoints(), and PATOAuthTokenExchange.refresh()
do not pass a timeout= parameter. When the OAuth endpoint is unreachable or
slow, these calls block indefinitely. The SDK's per-request timeout
(session.request(timeout=60)) does not protect against this because the
token refresh runs inside session.auth, before the timeout takes effect.
Add an http_timeout_seconds field to ClientCredentials and
PATOAuthTokenExchange dataclasses (default 60, matching _BaseClient), and
a timeout parameter to retrieve_token() and
get_azure_entra_id_workspace_endpoints(). All call sites in
credentials_provider.py and config.py now pass cfg.http_timeout_seconds
so the timeout is user-configurable via Config.
Fixes #1338
Signed-off-by: Chris Grierson <[email protected]>1 parent 6c1da5b commit 4dd4f3b
3 files changed
+29
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
25 | 27 | | |
26 | 28 | | |
27 | 29 | | |
| |||
546 | 548 | | |
547 | 549 | | |
548 | 550 | | |
549 | | - | |
| 551 | + | |
550 | 552 | | |
551 | 553 | | |
552 | 554 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
158 | 158 | | |
159 | 159 | | |
160 | 160 | | |
161 | | - | |
162 | | - | |
163 | | - | |
| 161 | + | |
164 | 162 | | |
165 | 163 | | |
166 | 164 | | |
| |||
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
| 204 | + | |
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
| |||
232 | 231 | | |
233 | 232 | | |
234 | 233 | | |
| 234 | + | |
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
| |||
258 | 258 | | |
259 | 259 | | |
260 | 260 | | |
261 | | - | |
| 261 | + | |
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
| |||
470 | 471 | | |
471 | 472 | | |
472 | 473 | | |
| 474 | + | |
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
| |||
532 | 534 | | |
533 | 535 | | |
534 | 536 | | |
535 | | - | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
536 | 540 | | |
537 | 541 | | |
538 | 542 | | |
| |||
548 | 552 | | |
549 | 553 | | |
550 | 554 | | |
| 555 | + | |
551 | 556 | | |
552 | 557 | | |
553 | 558 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
| 197 | + | |
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
209 | | - | |
| 210 | + | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| |||
513 | 514 | | |
514 | 515 | | |
515 | 516 | | |
| 517 | + | |
516 | 518 | | |
517 | 519 | | |
518 | 520 | | |
519 | 521 | | |
520 | 522 | | |
| 523 | + | |
521 | 524 | | |
522 | 525 | | |
523 | 526 | | |
524 | 527 | | |
525 | | - | |
| 528 | + | |
526 | 529 | | |
527 | 530 | | |
528 | 531 | | |
| |||
828 | 831 | | |
829 | 832 | | |
830 | 833 | | |
| 834 | + | |
831 | 835 | | |
832 | 836 | | |
833 | 837 | | |
| |||
848 | 852 | | |
849 | 853 | | |
850 | 854 | | |
| 855 | + | |
851 | 856 | | |
852 | 857 | | |
853 | 858 | | |
| |||
874 | 879 | | |
875 | 880 | | |
876 | 881 | | |
| 882 | + | |
877 | 883 | | |
878 | 884 | | |
879 | 885 | | |
| |||
890 | 896 | | |
891 | 897 | | |
892 | 898 | | |
893 | | - | |
| 899 | + | |
894 | 900 | | |
895 | 901 | | |
896 | 902 | | |
| |||
0 commit comments