fix(msteams): ignore blank certificate settings#109112
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 19, 2026, 12:18 AM ET / 04:18 UTC. Summary PR surface: Source +23, Tests +36. Total +59 across 2 files. Reproducibility: yes. for the resolver-level bug: the supplied before/after production-function transcript exercises the exported credential functions with whitespace-only certificate values, and the focused regression tests cover the corrected outcomes. Review metrics: none identified. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Keep the owner-local resolver split, preserving filesystem-path bytes while treating whitespace-only certificate settings as absent, then land only after a refreshed review against current Do we have a high-confidence way to reproduce the issue? Yes for the resolver-level bug: the supplied before/after production-function transcript exercises the exported credential functions with whitespace-only certificate values, and the focused regression tests cover the corrected outcomes. Is this the best way to solve the issue? Yes. Keeping normalized presence checks separate from returned certificate paths is the narrowest solution: it avoids blank values shadowing the environment without corrupting valid filesystem-path bytes. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 16e967eb7f53. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +23, Tests +36. Total +59 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
Review history (5 earlier review cycles)
|
ebb41b3 to
28d6c00
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
28d6c00 to
c670d78
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
What Problem This Solves
Fixes an issue where operators using Microsoft Teams federated authentication could have whitespace-only certificate settings reported as configured. Gateway startup would then try to read a certificate file whose path consisted only of spaces instead of treating the certificate credential as missing.
Why This Change Was Made
Federated certificate settings now use owner-local config-over-environment resolvers. Blank values no longer shadow valid environment values, certificate paths keep their original filesystem bytes, and identifier-like thumbprint and managed-identity values remain normalized. Secret authentication and managed-identity selection are unchanged.
User Impact
Microsoft Teams setup and status now reject blank certificate configuration consistently, and a blank config field can correctly fall back to a valid environment setting without changing the selected certificate path.
AI-assisted.
Evidence
Local-machine production-function proof on Node
v24.18.0:Before / negative control against exact latest main
aaa37a0c264a9b2bc25c6d5a8e98ede130455fed: in a detached worktree, importedextensions/msteams/src/token.ts, setappId,tenantId,authType: "federated", and whitespace-only config/env certificate fields, then called both exported credential functions.This is RED: the production resolver returned federated credentials that
createFederatedApppasses toreadFileSync, and channel/setup callers use the resolver result as their configured predicate.After on current exact head
c670d785a614a33c58385e8e53e9f565c5dee733: imported the same exported production functions, cleared the Microsoft Teams federated-auth environment, evaluated whitespace-only config, then evaluated the same config with padded valid environment values.The padded certificate path remains byte-for-byte unchanged because it is a filesystem path; the thumbprint is normalized as an identifier.
Focused regression and controls on the same exact head:
The focused file also keeps valid certificate config/env, secret credentials, system/user managed identity, and explicit
useManagedIdentity=falsebehavior covered../node_modules/.bin/oxfmt --check extensions/msteams/src/token.ts extensions/msteams/src/token.test.tspassed on the same exact tree;git diff --checkpassed.Not tested: a live Microsoft Teams certificate login, because no tenant certificate credentials were available. The changed behavior is entirely before SDK/network dispatch; the proof drives the exported production credential resolver that all channel, setup, probe, graph, monitor, and send-context callers consume.