-
Notifications
You must be signed in to change notification settings - Fork 209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add global requestTimeoutInSeconds setting to OidcClientSettings #1430
Add global requestTimeoutInSeconds setting to OidcClientSettings #1430
Conversation
…estTimeoutInSeconds
@Badisi Can you have a look at this? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1430 +/- ##
==========================================
- Coverage 80.53% 80.49% -0.04%
==========================================
Files 45 45
Lines 1731 1733 +2
Branches 344 345 +1
==========================================
+ Hits 1394 1395 +1
Misses 299 299
- Partials 38 39 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@dbfr3qs, thanks for the PR !
I would go with the opposite: Either:
|
I'm abroad right now, will be able to look into this in 2 weeks |
@pamapa @Badisi Thankyou both for your excellent feedback. I've made the suggested changes to try and satisfy the rules described above, such that the
However, there's a default setting for the |
Makes sense! We can handle this also within |
|
True, Probably something like this within this.requestTimeoutInSeconds = requestTimeoutInSeconds;
this.silentRequestTimeoutInSeconds = silentRequestTimeoutInSeconds ? silentRequestTimeoutInSeconds
: requestTimeoutInSeconds ? requestTimeoutInSeconds
: DefaultSilentRequestTimeoutInSeconds; |
…outInSeconds if defined, else set to DefaultSilentRequestTimeoutInSeconds
Looks good to me. @Badisi What do you think? |
Thanks for contributing and being patient! |
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [oidc-client-ts](https://github.com/authts/oidc-client-ts) | dependencies | minor | [`3.0.1` -> `3.1.0`](https://renovatebot.com/diffs/npm/oidc-client-ts/3.0.1/3.1.0) | --- ### Release Notes <details> <summary>authts/oidc-client-ts (oidc-client-ts)</summary> ### [`v3.1.0`](https://github.com/authts/oidc-client-ts/releases/tag/v3.1.0) [Compare Source](authts/oidc-client-ts@v3.0.1...v3.1.0) oidc-client-ts v3.1.0 is a minor release. No longer using `crypto-js` package, but built-in browser [crypto.subtle](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle) module. Crypto.subtle is available only in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) (HTTPS). Also have a look into the [migration](https://github.com/authts/oidc-client-ts/blob/main/docs/migration.md) info. #### Changelog: - Fixes: - [#​1666](authts/oidc-client-ts#1666): fix link in docs to issue - [#​1600](authts/oidc-client-ts#1600): updated docs about logger - [#​1589](authts/oidc-client-ts#1589): fix compiler error for target=ES2022 - [#​1539](authts/oidc-client-ts#1539): fix small typo in `signinCallback` doc in UserManager.ts - [#​1504](authts/oidc-client-ts#1504): typo in sample app config - [#​1490](authts/oidc-client-ts#1490): fix the return type of `signinCallback` - [#​1443](authts/oidc-client-ts#1443): fixes typos in docs - Features: - [#​1672](authts/oidc-client-ts#1672): make `signoutCallback` return signout response if request_type is so:r - [#​1626](authts/oidc-client-ts#1626): add `popupSignal` property to `signinPopup` and `signoutPop` - [#​1580](authts/oidc-client-ts#1580): add dpop docs - [#​1569](authts/oidc-client-ts#1569): add dpop nonce support - [#​1457](authts/oidc-client-ts#1457): add extra headers - [#​1461](authts/oidc-client-ts#1461): add demonstrating proof of possession - [#​1430](authts/oidc-client-ts#1430): add global `requestTimeoutInSeconds` setting - [#​1405](authts/oidc-client-ts#1405): allow using default scopes from authorization server thanks to [@​klues](https://github.com/klues), [@​smujmaiku](https://github.com/smujmaiku), [@​mftruso](https://github.com/mftruso), [@​peetck](https://github.com/peetck), [@​dbfr3qs](https://github.com/dbfr3qs), [@​mottykohn](https://github.com/mottykohn), [@​noshiro-pf](https://github.com/noshiro-pf), [@​dbfr3qs](https://github.com/dbfr3qs), [@​grjan7](https://github.com/grjan7) and [@​natergj](https://github.com/natergj) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMDkuMCIsInVwZGF0ZWRJblZlciI6IjM4LjEwOS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/191 Reviewed-by: Alexandre Soro <code@soro.dev> Co-authored-by: renovate <renovate@git.tristess.app> Co-committed-by: renovate <renovate@git.tristess.app>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [oidc-client-ts](https://github.com/authts/oidc-client-ts) | dependencies | minor | [`3.0.1` -> `3.1.0`](https://renovatebot.com/diffs/npm/oidc-client-ts/3.0.1/3.1.0) | --- ### Release Notes <details> <summary>authts/oidc-client-ts (oidc-client-ts)</summary> ### [`v3.1.0`](https://github.com/authts/oidc-client-ts/releases/tag/v3.1.0) [Compare Source](authts/oidc-client-ts@v3.0.1...v3.1.0) oidc-client-ts v3.1.0 is a minor release. No longer using `crypto-js` package, but built-in browser [crypto.subtle](https://developer.mozilla.org/en-US/docs/Web/API/Crypto/subtle) module. Crypto.subtle is available only in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts) (HTTPS). Also have a look into the [migration](https://github.com/authts/oidc-client-ts/blob/main/docs/migration.md) info. #### Changelog: - Fixes: - [#​1666](authts/oidc-client-ts#1666): fix link in docs to issue - [#​1600](authts/oidc-client-ts#1600): updated docs about logger - [#​1589](authts/oidc-client-ts#1589): fix compiler error for target=ES2022 - [#​1539](authts/oidc-client-ts#1539): fix small typo in `signinCallback` doc in UserManager.ts - [#​1504](authts/oidc-client-ts#1504): typo in sample app config - [#​1490](authts/oidc-client-ts#1490): fix the return type of `signinCallback` - [#​1443](authts/oidc-client-ts#1443): fixes typos in docs - Features: - [#​1672](authts/oidc-client-ts#1672): make `signoutCallback` return signout response if request_type is so:r - [#​1626](authts/oidc-client-ts#1626): add `popupSignal` property to `signinPopup` and `signoutPop` - [#​1580](authts/oidc-client-ts#1580): add dpop docs - [#​1569](authts/oidc-client-ts#1569): add dpop nonce support - [#​1457](authts/oidc-client-ts#1457): add extra headers - [#​1461](authts/oidc-client-ts#1461): add demonstrating proof of possession - [#​1430](authts/oidc-client-ts#1430): add global `requestTimeoutInSeconds` setting - [#​1405](authts/oidc-client-ts#1405): allow using default scopes from authorization server thanks to [@​klues](https://github.com/klues), [@​smujmaiku](https://github.com/smujmaiku), [@​mftruso](https://github.com/mftruso), [@​peetck](https://github.com/peetck), [@​dbfr3qs](https://github.com/dbfr3qs), [@​mottykohn](https://github.com/mottykohn), [@​noshiro-pf](https://github.com/noshiro-pf), [@​dbfr3qs](https://github.com/dbfr3qs), [@​grjan7](https://github.com/grjan7) and [@​natergj](https://github.com/natergj) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC4xMTAuMiIsInVwZGF0ZWRJblZlciI6IjM4LjExMC4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> Reviewed-on: https://git.tristess.app/alexandresoro/ouca/pulls/196 Reviewed-by: Alexandre Soro <code@soro.dev> Co-authored-by: renovate <renovate@git.tristess.app> Co-committed-by: renovate <renovate@git.tristess.app>
Closes #1414
This adds a
requestTimeoutInSeconds
setting. When this is defined, it applies a retry timeout to all fetch requests made to the authorization server (e.g. /token, /userinfo, /.well-known/openid-configuration) except for requests made withsilentRequestTimeoutInSeconds
(if it is defined).So the logic goes
Checklist