Microsoft Teams 8.0.0 release#4019
Open
ewilson-r7 wants to merge 3 commits into
masterrapid7/insightconnect-plugins:masterfrom
microsoft-teams-8.0.0-releaserapid7/insightconnect-plugins:microsoft-teams-8.0.0-releaseCopy head branch name to clipboard
Open
Microsoft Teams 8.0.0 release#4019ewilson-r7 wants to merge 3 commits intomasterrapid7/insightconnect-plugins:masterfrom microsoft-teams-8.0.0-releaserapid7/insightconnect-plugins:microsoft-teams-8.0.0-releaseCopy head branch name to clipboard
ewilson-r7 wants to merge 3 commits into
masterrapid7/insightconnect-plugins:masterfrom
microsoft-teams-8.0.0-releaserapid7/insightconnect-plugins:microsoft-teams-8.0.0-releaseCopy head branch name to clipboard
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
ewilson-r7
force-pushed
the
microsoft-teams-8.0.0-release
branch
from
July 17, 2026 14:25
2f50bec to
b56014a
Compare
igorski-r7
reviewed
Jul 24, 2026
igorski-r7
left a comment
Collaborator
There was a problem hiding this comment.
Please update the release branch or rebase it with master
* microsoft_teams: Remove user account requirement, switch to app-only auth Major refactor (v8.0.0) to eliminate the need for a user account: - Switch from ROPC (password grant) to client_credentials OAuth2 flow - Add Bot Framework integration for sending messages (no user needed) - Migrate all API calls from /beta to /v1.0 Graph endpoints - Remove username_password from connection (breaking change) - Remove username input from get_message_in_chat action - Add proper API client class (graph_api_client.py) - Add Bot Framework service class (bot_service.py) - Add centralized constants (constants.py) - Fix single-tenant bot auth (use tenant ID, not botframework.com) - Remove spurious tenant_id from Graph API resource paths - Update SDK to 6.5.1 - Update unit tests to mock at client level instead of requests level * microsoft_teams: Fix unit tests and prospector issues - Rewrite all unit tests to mock at client level instead of requests level - Implement all stub test cases (previously self.fail placeholders) - Fix mccabe complexity in _send_activity (extract helper methods) - Fix mccabe complexity in get_teams (extract _build_teams_endpoint, _paginate_results, _filter_teams_by_name) - Remove unused BOT_FRAMEWORK_TOKEN_URL constant (bandit B105) - Move time.sleep import to top-level (pylint import-outside-toplevel) - Fix possibly-used-before-assignment in _filter_teams_by_name - Suppress too-many-arguments on legitimate API method signatures 37 tests passing, 0 prospector issues on util modules. * fix lint issues Fix lint issues in unit tests * microsoft_teams: Address PR review feedback - Extract BaseClient class (util/base_client.py) with shared OAuth2 client_credentials auth and HTTP request handling - GraphApiClient and BotService now inherit from BaseClient - Move authentication logic out of connection.py into client classes - Add empty-list guards in all actions that access [0] index: get_channels_for_team, send_html_message, add_channel_to_team, remove_channel_from_team (prevents IndexError on empty results) - Fix super() call in Connection (use modern syntax) - Expose public authenticate() and get_auth_headers() on BaseClient - Remove unused TIMEOUT imports from subclasses - All 37 tests passing, 0 prospector issues * PR Feedback updates * Address PR Feedback * Fix Version History to include updates from previous commit * trigger diff recalc
* Add installed_apps support to create_teams_chat action
Added optional installed_apps input to the create_teams_chat action, allowing
users to install apps (e.g. bots) into a chat at creation time via the
Microsoft Graph API's installedApps property.
This is required for bots to send messages in chats — they cannot be added as
regular members and must be installed as apps instead.
Changes:
- plugin.spec.yaml: Added installed_apps input (type []string) to create_teams_chat
- schema.py: Added INSTALLED_APPS constant and updated input JSON schema
- action.py: Passes installed_apps through to the Graph API client
- graph_api_client.py: Updated create_chat to format installedApps payload and
handle the 202 Accepted async response (direct chat fetch with polling fallback)
- unit tests: Added test cases for installed_apps with oneOnOne and group chats
- test samples: Populated connection credentials across all test JSON files
* Prospector/Pylint fixes
MC0001 complexity (was 11) → Extracted _build_chat_payload from create_chat — now well under threshold
too-many-branches (was 19/15) → Split _handle_async_chat_creation into 5 focused methods: _try_direct_chat_fetch, _poll_chat_operation, _process_poll_response, _final_chat_fetch_or_partial, and the existing _extract_chat_id_from_location
unreachable code → Removed the duplicate raise PluginException block
import-outside-toplevel / reimported re → Removed the import re from inside _extract_chat_id_from_location (it's already at the top of the file)
Coverage fixes:
Added 10 new unit tests in TestGraphApiClientCreateChat that directly test the GraphApiClient methods (201, 202 direct fetch, 202 polling, payload format, error cases, location header parsing)
New code has 100% test coverage
* Add install_app action
New action - install_app:
- Accepts team_id or chat_id (mutually exclusive) and an app_id
- Calls POST /teams/{id}/installedApps or POST /chats/{id}/installedApps
- Validates that exactly one target is provided
* Refactor Install Apps Behavior
Connection
Added app_catalog_id (optional) — When configured, the bot automatically installs itself into chats on 403, eliminating manual steps
Bot Service (bot_service.py)
Constructor now accepts graph_client and app_catalog_id parameters
send_chat_message — on 403, if app_catalog_id is configured, auto-installs the bot in the chat via Graph API and retries the send
Refactored _send_activity into _send_activity + _send_activity_raw to allow inspecting the response status before handling
Graph API Client (graph_api_client.py)
create_chat — simplified back to synchronous-only (no more installed_apps param or 202 async handling)
Removed: _handle_async_chat_creation, _try_direct_chat_fetch, _poll_chat_operation, _process_poll_response, _final_chat_fetch_or_partial, _extract_chat_id_from_location, install_app_in_team
Kept: install_app_in_chat (used internally by bot service auto-install)
Actions
create_teams_chat — removed installed_apps input (redundant with connection-level auto-install)
install_app — removed entirely (action, schema, tests, sample)
* Update changelog
* Refactor Bot Install
bot_service.py — back to a clean, standalone service. No graph_client or app_catalog_id references. Just sends messages and raises PluginException on 403.
connection.py — stores app_catalog_id as a connection-level attribute (self.connection.app_catalog_id)
action.py
— new _send_chat_message_with_auto_install method catches the 403 PluginException, checks if app_catalog_id is configured, calls self.connection.client.install_app_in_chat(), and retries the send.
* Update app cat usage
app_catalog_id now lives on GraphApiClient (as self.app_catalog_id)
install_app_in_chat(chat_id) no longer takes an app_id parameter — it uses the internally stored self.app_catalog_id
Connection passes app_catalog_id to GraphApiClient.__init__
The action code is now simplified
* Bump SDK to 6.6.0 and add enable_cache entry * Set enable_cache to true.
ewilson-r7
force-pushed
the
microsoft-teams-8.0.0-release
branch
from
July 24, 2026 14:57
b56014a to
de744ed
Compare
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.
🎫 Ticket
N/A
🧩 Type of Change
🧠 Background & Motivation
The Microsoft Teams plugin required a user account (ROPC/password grant) to function, which is a security concern and operational burden. This release eliminates that requirement entirely by switching to app-only authentication via client_credentials OAuth2 flow and Bot Framework for sending messages. Additionally, the plugin needed auto-install support so bots can send messages in chats without manual app installation steps.
✨ What Changed
Major refactor to app-only auth (v8.0.0):
username_passwordfrom connection (breaking change)usernameinput fromget_message_in_chatactionBaseClient,GraphApiClient,BotServiceApp Catalog auto-install support:
app_catalog_idto connection — when configured, the bot auto-installs itself into chats on 403, then retries the sendGraphApiClient.install_app_in_chat()handles the install via Graph APIsend_messageaction includes_send_chat_message_with_auto_installretry logicSDK & tooling updates:
enable_cache: trueto plugin.spec.yaml🧪 Testing
GraphApiClient.create_chatmethods (201, 202, polling, payload format, error cases)