fix(apps): log inbound activities at info, warn on missing Authorization#568
Draft
corinagum wants to merge 3 commits into
Draft
fix(apps): log inbound activities at info, warn on missing Authorization#568corinagum wants to merge 3 commits into
corinagum wants to merge 3 commits into
Conversation
…zation header Inbound activities only logged at debug, and the missing-Authorization-header path returned 401 with no log line at all. At default info level this made it impossible to tell "request never arrived" from "request arrived and was silently 401'd by the SDK." Adds an info-level entry log on every inbound and a warn log when rejecting for a missing Authorization header. Refs #564. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR improves diagnostics in @microsoft/teams.apps HTTP ingress by adding higher-visibility logs around inbound activity handling and the “missing Authorization header” rejection path, reducing cases where a silent 401 makes it hard to determine whether requests reached the SDK.
Changes:
- Log every inbound activity at
infolevel inHttpServer.handleRequest(type + id). - Log a
warnwhen rejecting an inbound activity due to a missingAuthorizationheader inauthorize.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ype/id Addresses Copilot review feedback on #568: - Activity type/id come from the untrusted request body before auth runs. Strip control characters and cap length before interpolating into log lines so an attacker cannot forge multi-line log entries. - Include type/id on the missing-Authorization-header warn, so users running at WARN level can correlate the rejection with a specific activity without needing the preceding info entry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Per review feedback: the info-level entry log on every inbound activity is redundant with the existing debug log at the same site, and operators who want diagnostic visibility into "did the request reach the SDK" can already get it by flipping the logger to debug. The genuinely new diagnostic value is the warn on the missing-Authorization-header path, which is silent at every log level today; that stays. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Draft
4 tasks
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.
Summary
authorize, replacing a previously silent 401.Cross-SDK: equivalent fix filed for teams.py (microsoft/teams.py#425).
Test plan
npx turbo build --filter=@microsoft/teams.appsnpx jestinpackages/apps(257/257 pass)npx eslint src/http/http-server.ts(clean)