Repository navigation
Conversation
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
…ery OAuth error Retry the token exchange on a network error or 5xx, up to three attempts, requesting a fresh GitHub OIDC token each time because WorkOS accepts each one once. Never retry a 4xx. Re-exchange and re-send an API call once when the API answers 401. Handle unauthorized_client, and make each OAuth error hint name the setting to change.
[Medium impact] The PR appears safe to merge; both previous findings are fixed and no new actionable issue remains. SummaryAdds bounded WIF token-exchange retries, one retry after an API 401, and clearer OAuth error hints.
Reviews (2) · Last reviewed commit: "fix(wif): retry a dropped response body ..." · Reviewed by Greptile |
…se before re-exchanging A connection that dropped while the token response body was read ended the exchange as 'the response was not JSON' instead of being retried like any other network failure. A 401 response was cancelled only after the re-exchange, so a failed re-exchange left it open.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #268. Review this after it; the diff here is only what was added on top.
What changes
unauthorized_client: check that the client has an enabled trust, that workload identity federation is on for the team, and that the client targets a non-production environment.unauthorized_client, andWORKOS_ENVIRONMENT_IDbeing optional (it must match the client's bound environment when set).The branch also merges
main(release 0.24.0), so the release files show in the diff.Checked
workos apilisted organizations and created one using only the job's OIDC token. It passed again with this branch ataeaa5adagainst the current server tip: https://github.com/nicknisi/wif-test/actions/runs/43374371447.Not checked
bun run build.