Skip to content

Deprecate skipAuth in favor of dangerouslyAllowUnauthenticatedRequests#636

Merged
heyitsaamir merged 7 commits into
microsoft:mainfrom
heyitsaamir:heyitsaamir-deprecate-skipauth
Jul 16, 2026
Merged

Deprecate skipAuth in favor of dangerouslyAllowUnauthenticatedRequests#636
heyitsaamir merged 7 commits into
microsoft:mainfrom
heyitsaamir:heyitsaamir-deprecate-skipauth

Conversation

@heyitsaamir

@heyitsaamir heyitsaamir commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • add dangerouslyAllowUnauthenticatedRequests as the replacement auth-bypass option
  • keep skipAuth as a deprecated AppOptions-only alias and remove it from lower HTTP/plugin layers
  • add DANGEROUSLY_ALLOW_UNAUTHENTICATED_REQUESTS support via an internal boolean env helper

Validation

  • npm test --workspace @microsoft/teams.apps -- app.spec.ts env.spec.ts --runInBand
  • npm test --workspace @microsoft/teams.apps -- http-server.spec.ts app.spec.ts plugin.spec.ts --runInBand
  • npm run lint --workspace @microsoft/teams.apps
  • npm run build --workspace @microsoft/teams.apps
  • npm test --workspace @microsoft/teams.botbuilder -- --runInBand
  • Manual: ran examples/echo with DANGEROUSLY_ALLOW_UNAUTHENTICATED_REQUESTS=true PORT=3987 npm run dev --workspace @examples/echo; unauthenticated POST /api/messages returned 200 and the echo handler sent typing plus you said "hello from env path" through a local mock Bot Framework service URL.
  • Manual: ran examples/echo without DANGEROUSLY_ALLOW_UNAUTHENTICATED_REQUESTS; unauthenticated POST /api/messages returned 401 {"error":"Authentication not configured"}.

Add dangerouslyAllowUnauthenticatedRequests as the replacement for skipAuth, keep skipAuth as an AppOptions-only deprecated alias, and support the new option via DANGEROUSLY_ALLOW_UNAUTHENTICATED_REQUESTS.

Co-authored-by: Copilot App <[email protected]>
Copilot AI review requested due to automatic review settings July 9, 2026 05:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR deprecates the existing skipAuth auth-bypass option and replaces it with a more explicit dangerouslyAllowUnauthenticatedRequests flag, adding optional env-var support to enable the bypass for local development/testing.

Changes:

  • Introduces dangerouslyAllowUnauthenticatedRequests across App, HttpServer, and HttpPlugin, while keeping skipAuth as a deprecated AppOptions alias.
  • Adds DANGEROUSLY_ALLOW_UNAUTHENTICATED_REQUESTS support via a shared isTruthyEnvValue helper.
  • Updates tests and documentation to reflect the new option name and behavior.

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/botbuilder/src/adapter.spec.ts Updates botbuilder adapter tests to use dangerouslyAllowUnauthenticatedRequests instead of skipAuth.
packages/apps/src/utils/env.ts Adds isTruthyEnvValue helper for consistent env-var truthiness parsing.
packages/apps/src/utils/env.spec.ts Adds unit tests for isTruthyEnvValue.
packages/apps/src/plugins/http/plugin.ts Replaces skipAuth option plumbing with dangerouslyAllowUnauthenticatedRequests in the deprecated HttpPlugin.
packages/apps/src/plugins/http/plugin.spec.ts Updates HttpPlugin tests to cover the renamed option and pass-through.
packages/apps/src/http/http-server.ts Renames the bypass option to dangerouslyAllowUnauthenticatedRequests and updates warnings/auth flow accordingly.
packages/apps/src/http/http-server.spec.ts Updates HttpServer tests for the renamed option and default behavior.
packages/apps/src/app.ts Adds dangerouslyAllowUnauthenticatedRequests to AppOptions, supports env var fallback, and keeps skipAuth as deprecated alias.
packages/apps/src/app.spec.ts Adds coverage for option/env-var precedence and deprecated skipAuth alias support.
packages/apps/README.md Documents the new option and DANGEROUSLY_ALLOW_UNAUTHENTICATED_REQUESTS env var for local testing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Rename the internal truthy parsing helper from env-specific naming to string-specific naming while keeping it private to the package.

Co-authored-by: Copilot App <[email protected]>
Use the existing direct process.env access style in App when resolving DANGEROUSLY_ALLOW_UNAUTHENTICATED_REQUESTS.

Co-authored-by: Copilot App <[email protected]>
Comment thread packages/apps/src/app.ts
Comment thread packages/apps/src/utils/string.ts Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.

Comment thread packages/apps/src/http/http-server.ts
Comment thread packages/apps/src/utils/env.ts Outdated
Comment thread packages/apps/src/app.spec.ts Outdated
@heyitsaamir
heyitsaamir enabled auto-merge July 14, 2026 23:40
@heyitsaamir
heyitsaamir added this pull request to the merge queue Jul 16, 2026
Merged via the queue into microsoft:main with commit ed16a6a Jul 16, 2026
3 checks passed
@heyitsaamir
heyitsaamir deleted the heyitsaamir-deprecate-skipauth branch July 16, 2026 19:03
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.

3 participants