Skip to content

fix(oauth): recover saved credentials after delayed authorization - #258

Merged
lipluscodex merged 1 commit into
mainfrom
250-fix-oauth-reauth-cache
Sep 30, 2026
Merged

lipluscodex merged 1 commit into
mainfrom
250-fix-oauth-reauth-cache

Conversation

@lipluscodex

Copy link
Copy Markdown
Member

Closes #250
認可完了後も古いメモリ値を使う再認証ループを修正し、各 credential 取得で共有 token ファイルの更新を取り込みます。
401 で拒否された実際の bearer と refresh 失敗値の再採用を防ぎ、発行 client ID を保持して共有 registration の更新にも対応します。
callback の成功表示を交換・atomic 保存の完了後へ移し、pending の失敗・timeout を後続の呼び出しへ安全に伝えます。

検証: bridge 33 テスト(新規 OAuth 回帰 20 件)、既存 Worker 382 テスト、型チェック、schema drift check、Worker dry-run build が成功。
synthetic credential と一時ディレクトリで遅延完了、共有ファイル更新、401、交換・保存・listener 失敗、timeout を検証。要件の日英版と bridge README を同期。

実機の認証ファイル・設定・稼働 process と公開バージョンは変更していません。実機への可逆的適用・検索復旧確認は review 後の別工程です。
旧 token record の発行 client ID は復元できないため、従来の共有 registration を fallback として使用します。

共有 token を毎回読み直し、401/refresh 失敗で拒否された値を再採用しない。
認可結果を保存後に成功表示し、遅延完了と失敗を後続の呼び出しへ伝える。

検証: bridge 33 件、Worker 382 件、型チェック、schema drift、dry-run build。
@lipluscodex lipluscodex self-assigned this Sep 30, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
github-rag-mcp 96978eb Sep 30 2026, 09:32 AM

@lipluscodex lipluscodex left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lin: Issue #250 と head 96978eb の差分をレビューし、要求を満たすことを確認しました。

共有tokenを毎回読み、遅れて完了した認可の結果を次の呼び出しで利用できます。拒否されたbearerの再採用を防ぎ、新しい並行tokenを誤って拒否しません。callbackの成功表示は交換・atomic保存後となり、失敗/timeoutも後続呼び出しへ伝わります。発行client IDの保持と旧record互換、synthetic資格情報を使う20件のOAuth回帰テストも確認しました。

stdio/HTTPプロトコルと検索の意味は維持されています。関連ドキュメントを更新し、認証情報を公開する差分はありません。範囲逸脱はありません。旧tokenのclient IDは復元できず共有registrationへfallbackする限界は記録済みです。

GitHub CIのtest・CI・Workers Buildsは同じheadでSUCCESS、merge stateはCLEAN。自己レビュー合格。autoモードに従いsquash mergeへ進め、その後このPCへ可逆的に修正版を適用して実stdio検索を確認します。公開リリースは別途マスターの確認が必要です。

@lipluscodex
lipluscodex merged commit 87fb833 into main Sep 30, 2026
3 checks passed
@lipluscodex
lipluscodex deleted the 250-fix-oauth-reauth-cache branch September 30, 2026 09:34
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.

fix(oauth): stale in-memory token blocks re-auth for the life of the proxy process

1 participant