fix(msteams): bound user token response parsing [AI]#101764
Conversation
4459fcd to
96b784c
Compare
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: this helper-only Microsoft Teams SSO bounded-read branch overlaps the same problem already owned by the open proof-positive route-level PR, which covers the registered sign-in routes and cloud token-host parity. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Close this helper-only duplicate and continue review on #97781, preserving the route-level bounded-read, SDK cloud-token-host, and overflow coverage there. So I’m closing this here and keeping the remaining discussion on #97781. Review detailsBest possible solution: Close this helper-only duplicate and continue review on #97781, preserving the route-level bounded-read, SDK cloud-token-host, and overflow coverage there. Do we have a high-confidence way to reproduce the issue? Yes, by source inspection. Current main and Is this the best way to solve the issue? No for this branch as the landing path. The bounded-reader direction is useful, but the canonical route-level PR is the narrower maintainable endpoint because it covers the live registered routes and sovereign-cloud token host behavior. Security review: Security review cleared: No supply-chain or secret-handling regression was found; the diff narrows an external SSO response-read boundary and adds only a focused test. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against 3d206140f3f0. |
What Problem This Solves
Fixes an issue where Microsoft Teams SSO token exchange could fail poorly when the Bot Framework User Token service returned a very large or malformed JSON response.
Why This Change Was Made
The Microsoft Teams SSO success path now uses the shared provider JSON response reader, matching the bounded parsing behavior already used by the plugin's Graph and attachment paths. The regression test verifies the stream is cancelled at the JSON response limit and that raw
Response.json()parsing is not used.AI-assisted.
User Impact
Microsoft Teams SSO token exchange now handles oversized or malformed User Token service responses with bounded parsing. Normal token responses keep the same behavior, and invalid responses do not persist a delegated token.
Evidence
pnpm format -- extensions/msteams/src/sso.ts extensions/msteams/src/monitor-handler.sso.test.tsgit diff --checknode scripts/run-vitest.mjs extensions/msteams/src/monitor-handler.sso.test.ts- 1 file, 6 tests passedrg -n "await [A-Za-z0-9_]+\\.json\\(|\\.json\\(\\)" extensions/msteams/src extensions/msteams/*.ts- remaining Microsoft Teams matches are regression-test spies onlyKnown limitation: remote Testbox/Crabbox proof was not available in this environment because neither
crabboxnor../crabbox/bin/crabboxis installed.