mattermost/api/v4/source
Nick Misasi 8e4cadbc88
[MM-66359] Recaps MVP (#34337)
* initial commit for POC of Plugin Bridge

* Updates

* POC for plugin bridge

* Updates from collaboration

* Fixes

* Refactor Plugin Bridge to use HTTP/REST instead of RPC

- Remove ExecuteBridgeCall hook and Context.SourcePluginId
- Implement HTTP-based bridge using existing PluginHTTP infrastructure
- Add CallPlugin API method with endpoint parameter instead of method name
- Update CallPluginBridge to construct HTTP POST requests
- Add proper headers: Mattermost-User-Id, Mattermost-Plugin-ID
- Use 'com.mattermost.server' as plugin ID for core server calls
- Update ai.go to use REST endpoint /inter-plugin/v1/completion
- Add comprehensive spec documentation in server/spec.md
- Add MIGRATION_GUIDE.md for plugin developers
- Fix 401/404 issues by setting correct headers and URL paths

* Improve Plugin Bridge security and architecture

- Create ServeInternalPluginRequest for internal plugin calls (core + plugin-to-plugin)
- Move header-setting logic from CallPluginBridge to ServeInternalPluginRequest
- Improve separation of concerns: business logic vs HTTP transport
- Add security documentation explaining header protection

Security Improvements:
- ServeInternalPluginRequest is NOT exposed as HTTP route (internal only)
- Headers (Mattermost-User-Id, Mattermost-Plugin-ID) are set by trusted server code
- External requests cannot spoof these headers (stripped by servePluginRequest)
- Core calls use 'com.mattermost.server' as plugin ID for authorization
- Plugin-to-plugin calls use real plugin ID (enforced by server)

Backward Compatibility:
- Keep ServeInterPluginRequest for existing API.PluginHTTP callers (deprecated)
- All tests pass

Docs:
- Update spec.md with security model explanation
- Update MIGRATION_GUIDE.md with correct header usage examples

* Space

* cursor please stop creating markdown files

* Fix style

* Fix i18n, linter

* REMOVE MARKDOWN

* Remove CallPlugin method from plugin API interface

Per review feedback, this method is no longer needed.

Co-authored-by: Nick Misasi <nickmisasi@users.noreply.github.com>

* Remove CallPlugin method implementation from PluginAPI

Co-authored-by: Nick Misasi <nickmisasi@users.noreply.github.com>

* fixes

* Add AI OpenAPI spec

* fix openapi spec

* Use agents client (#34225)

* Use agents client

* Remove default agent

* Fixes

* fix: modify system prompts to ensure JSON is being returned

* Base implementation for recaps working

* small fixes

* Adjustments

* remove webapp changes

* Add feature flags for rewrites and ai bridge, clean up

* Remove comments that aren't helpful

* Fix i18n

* Remove rewrites

* Fix tests

* Fix i18n

* adjust i18n again

* Add back translations

* Remove leftover mock code

* remove model file

* Changes from PR review

* Make the real substitutions

* Include a basic invokation of the client with noop to ensure build works

* more fix

* Remove unneeded change

* Updates from review

* Fixes

* Remove some logic from rewrites to clean up branch

* Use v1.5.0 of agents plugin

* A bunch more additions for general UX flow

* Add missing files

* Add mocks

* Fixes for vet-api, i18n, build, types, etc

* One more linter fix

* Fix i18n and some tests

* Refactors and cleanup in backend code

* remove rogue markdown file

* fixes after refactors from backend

* Add back renamed files, and add tests

* More self code review

* More fixes

* More refactors

* Fix call stack exceeded bug

* Include read messages if there are no unreads

* Fix test failure: use correct error message key for recap permission denied

The getRecapAndCheckOwnership function was using strings.ToLower(callerName)
to generate error keys, which caused 'GetRecap' to become 'getrecap' instead
of the expected 'get'. Changed to use the correct static key that matches
the en.json localization file.

Fixes TestGetRecap/get_recap_by_non-owner test failure.

Co-authored-by: Nick Misasi <nickmisasi@users.noreply.github.com>

* Consolidate permission errors down to a single string

* Fixes for i18n, worktrees making this difficult

* Fix i18n

* Fix i18n once and for all (for real) (final)

* Fix duplicate getAgents method in client4.ts

* Remove duplicate ai state from initial_state.ts

* Fix types

* Fix tests

* Fix return type of GetAgents and GetServices

* Add tests for recaps components

* Fix types

* Update i18n

* Fixes

* Fixes

* More cleanup

* Revert random file

* Use undefined

* fix linter

* Address feedback

* Missed a git add

* Fixes

* Fix i18n

* Remove fallback

* Fixes for PR

---------

Co-authored-by: claude[bot] <209825114+claude[bot]@users.noreply.github.com>
Co-authored-by: Nick Misasi <nickmisasi@users.noreply.github.com>
Co-authored-by: Christopher Speller <crspeller@gmail.com>
Co-authored-by: Felipe Martin <me@fmartingr.com>
Co-authored-by: Mattermost Build <build@mattermost.com>
2026-01-13 11:59:22 -05:00
..
access_control.yaml [MM-65956] Tweak auto add to make it consistent with child policies (#33990) 2025-11-19 20:18:45 +00:00
actions.yaml Add Dynamic Select for Interactive Dialog (#33586) 2025-08-28 07:47:28 -06:00
agents.yaml Add common code for AI workflows (#34381) 2025-11-04 10:16:43 -05:00
ai.yaml [MM-66359] Recaps MVP (#34337) 2026-01-13 11:59:22 -05:00
audit_logging.yaml Feature/audit certificate upload (#30223) 2025-04-16 09:34:18 -04:00
bleve.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
bookmarks.yaml Channel Bookmarks (#25449) 2024-03-12 08:36:05 -06:00
bots.yaml [MM-57966]Centralize the 200 maximum page size cap for the per_page parameter and remove individual mentions from API endpoint documentation (#26859) 2024-04-25 21:18:25 +05:30
brand.yaml Updated API Code Samples (#24141) 2023-08-03 12:45:10 -03:00
channels.yaml Added API docs for /common_teams API (#33941) 2025-09-25 08:41:48 +05:30
cloud.yaml Add support for dynamic fetching of preview modal content from S3 bucket (#33380) 2025-07-15 12:58:18 -04:00
cluster.yaml Update /api/v4/cluster/status docs (#28189) 2024-09-16 17:51:51 +02:00
commands.yaml Updated API Code Samples (#24141) 2023-08-03 12:45:10 -03:00
compliance.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
content_flagging.yaml Reviewer search api (#34036) 2025-10-14 09:06:23 +05:30
custom_profile_attributes.yaml Adds operation ID to the PatchCPAValuesForUser endpoint (#33963) 2025-09-26 10:56:37 +02:00
dataretention.yaml [MM-57966]Centralize the 200 maximum page size cap for the per_page parameter and remove individual mentions from API endpoint documentation (#26859) 2024-04-25 21:18:25 +05:30
definitions.yaml [MM-66359] Recaps MVP (#34337) 2026-01-13 11:59:22 -05:00
elasticsearch.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
emoji.yaml Add documentation for get emojis by names API (#24983) 2023-10-17 15:09:26 -04:00
exports.yaml Updated API Code Samples (#24141) 2023-08-03 12:45:10 -03:00
files.yaml [MM-51201/MM-60406/MM-60404] CrossTeam Search posts and files (#28478) 2024-11-21 13:40:46 -07:00
groups.yaml docs: fix Create custom group API payload structure (#33555) 2025-10-30 13:42:29 +00:00
imports.yaml MMCTL: Add import delete cmd for removing the import files (#29764) 2025-06-10 12:06:38 +02:00
introduction.yaml [MM-66359] Recaps MVP (#34337) 2026-01-13 11:59:22 -05:00
ip_filters.yaml [CLD-6324] Cloud IP Filtering (#24726) 2023-11-14 09:12:04 -05:00
jobs.yaml [MM-56074] mmctl job commands (#26855) 2024-06-17 12:07:05 -04:00
ldap.yaml [MM-63152] LDAP Wizard (#31417) 2025-06-16 16:19:33 -04:00
limits.yaml Added post limit warning (#26793) 2024-04-18 11:50:30 +05:30
logs.yaml MM-57013 Added download button for downloading logs from server logs page in system console (#26389) 2024-06-24 14:05:23 -04:00
metrics.yaml Add 'metrics' tag to /api/v4/client_perf endpoint (#29612) 2025-01-14 09:24:31 +00:00
oauth.yaml OAuth public client improvements (#34435) 2025-11-11 16:57:49 -05:00
outgoing_oauth_connections.yaml Webapp - Outgoing OAuth Connections (#25507) 2024-02-09 14:49:49 -05:00
permissions.yaml Remove deprecated function (#27605) 2024-07-17 16:02:39 -06:00
plugins.yaml Updated API Code Samples (#24141) 2023-08-03 12:45:10 -03:00
posts.yaml [MM-61758] Burn on read feature (#34703) 2025-12-11 07:59:50 +01:00
preferences.yaml MM 55199 Limit User Preferences (#25579) 2024-02-01 15:33:24 -07:00
reactions.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
recaps.yaml [MM-66359] Recaps MVP (#34337) 2026-01-13 11:59:22 -05:00
remoteclusters.yaml MM-61032: Add default_team_id to accept invite flow (#28841) 2024-10-18 12:26:38 +02:00
reports.yaml Add cursor-based Posts Reporting API for compliance and auditing (#34252) 2025-11-17 09:02:19 -07:00
roles.yaml Clarify patch role permissions (#30128) 2025-02-21 17:08:58 +02:00
saml.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
scheduled_post.yaml Feature scheduled messages (#28932) 2024-11-04 11:39:35 +05:30
schemes.yaml Update schemes.yaml (#29502) 2024-12-12 12:19:09 +01:00
service_terms.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
sharedchannels.yaml MM-64531: [Shared Channels] Users on different remote servers should not communicate unless the remotes have established secure connection. (#30985) 2025-07-15 09:30:07 +02:00
status.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
system.yaml Update system health API docs to clarify authentication requirements (#34086) 2025-10-14 12:50:25 -04:00
teams.yaml Update YAML files to document magic link endpoints (#34617) 2025-12-18 13:36:56 +01:00
uploads.yaml Updated API Code Samples (#24141) 2023-08-03 12:45:10 -03:00
usage.yaml Move API Reference (#23777) 2023-06-27 11:10:13 -03:00
users.yaml Update YAML files to document magic link endpoints (#34617) 2025-12-18 13:36:56 +01:00
webhooks.yaml Add channel_locked to webhook creation and update docs (#34398) 2025-11-10 13:40:26 -05:00