Skip to content

Add signin/failure invoke activity support#404

Merged
heyitsaamir merged 5 commits into
mainfrom
copilot/apply-similar-change-python-pr
Dec 1, 2025
Merged

Add signin/failure invoke activity support#404
heyitsaamir merged 5 commits into
mainfrom
copilot/apply-similar-change-python-pr

Conversation

Copilot AI commented Nov 18, 2025

Copy link
Copy Markdown
Contributor

Add signin/failure invoke activity support to teams.ts

This PR applies the same changes from the Python PR microsoft/teams.py#206 to add support for signin/failure invoke activities.

Changes Made:

  • Create SignInFailure model in packages/api/src/models/sign-in/sign-in-failure.ts
  • Update packages/api/src/models/sign-in/index.ts to export SignInFailure
  • Create SignInFailureInvokeActivity in packages/api/src/activities/invoke/sign-in/failure.ts
  • Update packages/api/src/activities/invoke/sign-in/index.ts to include SignInFailureInvokeActivity in the union type
  • Fix JSDoc formatting for consistency with TypeScript documentation standards
  • Fix import order to pass linter
  • Add signin/failure to InvokeResponseBody in packages/api/src/models/invoke-response.ts
  • Add signin/failure to InvokeAliases in packages/apps/src/routes/invoke/index.ts
  • Run lint - all checks pass
  • Run build - all packages build successfully
  • Run code review - no issues found
  • Run security checks - no vulnerabilities found

Summary:

Successfully resolved the issue where signin/failure invoke activities would cause validation errors. The implementation follows the exact same pattern as the Python PR microsoft/teams.py#206, adapting it to TypeScript conventions.

Problem

When sign-in failures occurred, the system would throw validation errors because the signin/failure invoke activity type was not supported.

Solution

Added complete support for the signin/failure invoke activity type:

  1. Created SignInFailure model - Contains code and message fields to capture failure details
  2. Created ISignInFailureInvokeActivity - New invoke activity interface for handling signin/failure events
  3. Updated SignInInvokeActivity union - Added the failure activity to the discriminated union type
  4. Updated InvokeResponseBody - Added response type mapping for signin/failure
  5. Updated InvokeAliases - Added route alias for signin.failure

Impact

Before: Sign-in failures would cause validation errors and prevent proper error handling.

After: Sign-in failures are gracefully handled:

  • Activities are properly typed
  • Error codes and messages are captured
  • No validation errors occur
  • Applications can implement custom error handling
  • Build and lint checks pass

Breaking Changes

None - fully backward compatible. Only adds new functionality.

Security Summary

No security vulnerabilities were introduced by these changes. CodeQL analysis found no alerts.

Original prompt

Can you apply a similar change from this Python PR microsoft/teams.py#206?

try with


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Apply similar change from referenced Python PR Add signin/failure invoke activity support Nov 18, 2025
Copilot AI requested a review from heyitsaamir November 18, 2025 01:19

Copy link
Copy Markdown
Collaborator

@copilot looks like it's failing lint. Make sure you lint and test before committing.

Copilot AI commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

@copilot looks like it's failing lint. Make sure you lint and test before committing.

Fixed the import order lint error in commit da54d93. The imports are now alphabetically sorted as required by ESLint.

Copy link
Copy Markdown
Collaborator

@copilot don't forget to build. The build is failing.

Copilot AI commented Nov 18, 2025

Copy link
Copy Markdown
Contributor Author

@copilot don't forget to build. The build is failing.

Fixed the build errors in commit 0d00ecc. Added signin/failure to InvokeResponseBody and InvokeAliases types. All packages now build successfully.

@heyitsaamir
heyitsaamir marked this pull request as ready for review November 18, 2025 18:50
@heyitsaamir
heyitsaamir merged commit c7eeba6 into main Dec 1, 2025
9 checks passed
@heyitsaamir
heyitsaamir deleted the copilot/apply-similar-change-python-pr branch December 1, 2025 19:48
corinagum added a commit that referenced this pull request Apr 27, 2026
Follow-up to the allowlist feature (shipped via #515). No runtime
behavior change for correct callers. Adds hardening informed by review
feedback on the sibling Python PR (microsoft/teams.py#404):

1. **Docstring clarity.** `App.additionalAllowedDomains`,
`HttpServerOptions`, and `ServiceTokenValidator` constructor all
document that entries must be bare hostnames matched exactly
(case-insensitive); wildcard patterns like `*.example.com`, URL
suffixes, and full URLs are NOT supported. `['*']` is the sole wildcard,
used as a disable-validation sentinel.
2. **Defensive copy.** `HttpServer` and `ServiceTokenValidator` no
longer store the caller's array by reference. A post-construction
mutation of the caller's array would previously have changed validator
behavior at runtime; now it is isolated.
3. **Tests** covering the class of bug Python shipped in #404: plumbing
from `HttpServerOptions` through `HttpServer.initialize()` into the
`ServiceTokenValidator` constructor.

---------

Co-authored-by: Copilot <[email protected]>
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