Skip to content

fix: validate OAuth state before token exchange - #381

Open
ryanduguid wants to merge 1 commit into
XeroAPI:masterfrom
ryanduguid:codex/validate-oauth-state-before-exchange
Open

fix: validate OAuth state before token exchange#381
ryanduguid wants to merge 1 commit into
XeroAPI:masterfrom
ryanduguid:codex/validate-oauth-state-before-exchange

Conversation

@ryanduguid

Copy link
Copy Markdown

Summary

  • validate a supplied OAuth callback state before the authorization-code exchange
  • prevent a mismatched callback from making a token request or overwriting the current token set
  • add regression coverage for mismatched, matching, and legacy no-state callback paths

This preserves the SDK's existing optional-state compatibility: callers that do not configure state continue to work. It makes the existing configured-state protection effective before the mutating token exchange occurs.

Validation

  • git diff --check

Ruby and Bundler are not available in the audit environment, so I could not execute the repository's normal bundle exec rake spec suite. The new specs are deliberately focused for that CI run.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants