mattermost/server
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
..
bin Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
build Update runtime chainguard image for fips (#34997) 2026-01-20 23:09:51 +02:00
channels [MM-67021] Fix 500 errors on check-cws-connection in non-Cloud environments (#34786) 2026-02-02 13:41:14 +00:00
cmd Remove vestigial MySQL support (#34865) 2026-01-20 21:01:59 +00:00
config MM-66789 Restrict log downloads to a root path for support packets (#35014) 2026-01-29 13:29:55 -05:00
einterfaces Metrics for Autotranslations (#34900) 2026-01-29 05:46:45 -05:00
enterprise Metrics for Autotranslations (#34900) 2026-01-29 05:46:45 -05:00
fips MM-65959: Add FIPS indicator to about dialog (#34463) 2025-12-11 18:37:29 -04:00
fonts Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
i18n [MM-67021] Fix 500 errors on check-cws-connection in non-Cloud environments (#34786) 2026-02-02 13:41:14 +00:00
platform Add audits for accessing posts without membership (#31266) 2026-01-20 10:38:27 +01:00
public [MM-66581] Include some thread context in AI Rewrites prompt (#34931) 2026-01-30 09:14:06 -05:00
scripts [MM-67030] Remove newsletter signup and replace with terms/privacy agreement (#34801) 2026-01-23 18:24:27 +00:00
templates MM-59966 - Compliance Export overhaul - feature branch (#29789) 2025-01-10 16:56:02 -05:00
tests Remove vestigial MySQL support (#34865) 2026-01-20 21:01:59 +00:00
.gitignore Update .server/gitignore to ignore all JSON files under the directory (#27593) 2024-07-11 09:12:57 +02:00
.go-version bumps go version to 1.24.11 (#34876) 2026-01-09 17:22:23 +01:00
.golangci.yml MM-62151 avoid select * for post store (#34709) 2026-01-09 18:23:16 +00:00
.sass-lint.yml Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
config.mk Enabling Prometheus, Grafana, Loki and Promtail running as containers by default in local dev environments (#34263) 2025-10-23 14:08:53 +02:00
copyright.txt Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
docker-compose.makefile.m1.yml Remove obsolete docker version (#30040) 2025-01-30 12:53:25 -07:00
docker-compose.makefile.yml Explicitly name Postgres container volume (#33954) 2025-10-02 09:29:00 -04:00
docker-compose.pgvector.yml Add support for pgvector in local dev (#33900) 2025-09-15 18:58:43 +00:00
docker-compose.yaml selinux security context fixes in docker compose (#34394) 2025-11-14 17:32:56 +01:00
go.mod updates opensearch library dependency and adds tests for caused_by error reason returned (#34826) 2026-01-27 16:01:22 +01:00
go.sum updates opensearch library dependency and adds tests for caused_by error reason returned (#34826) 2026-01-27 16:01:22 +01:00
Makefile Bump playbooks to v2.7.0 (#35150) 2026-01-30 11:42:41 -07:00
path.go Centralize the GetPackagePath (#27004) 2024-05-15 12:05:13 -03:00