mattermost/api/v4/source
Jesse Hallam 70a50edcf2
[MM-67021] Fix 500 errors on check-cws-connection in non-Cloud environments (#34786)
* Fix 500 errors on check-cws-connection in non-Cloud environments

The check-cws-connection endpoint was returning 500 errors in
self-hosted enterprise environments because:

1. The client only checked BuildEnterpriseReady before making the
   request, which is true for all enterprise builds
2. The server handler didn't check for a Cloud license before
   attempting to connect to CWS
3. The CWS URL is not configured in non-Cloud environments, causing
   the connection check to fail

This fix:
- Server: Add IsCloud() license check to match other cloud endpoints,
  returning 403 instead of 500 for non-Cloud licenses
- Client: Add Cloud license check to skip the request entirely in
  non-Cloud environments

* Add unit tests for check-cws-connection license check

* Return JSON status from check-cws-connection endpoint

Change the check-cws-connection endpoint to return 200 with a JSON body
containing status (available/unavailable) instead of using HTTP error
codes. This allows the endpoint to be used for air-gap detection on
self-hosted instances, not just Cloud deployments.

* i18n

---------

Co-authored-by: Mattermost Build <build@mattermost.com>
2026-02-02 13:41:14 +00:00
..
access_control.yaml [MM-67126] Deprecate UpdateAccessControlPolicyActiveStatus API in favor of new one (#34940) 2026-01-27 15:49:08 +01:00
actions.yaml Add Dynamic Select for Interactive Dialog (#33586) 2025-08-28 07:47:28 -06:00
agents.yaml Autotranslations MVP (#34696) 2026-01-26 17:05:34 -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 [MM-67021] Fix 500 errors on check-cws-connection in non-Cloud environments (#34786) 2026-02-02 13:41:14 +00: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 Autotranslations MVP (#34696) 2026-01-26 17:05:34 -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