From a21169e2a864565b0019eb8c00fa7de74901d19e Mon Sep 17 00:00:00 2001 From: Jesse Hallam Date: Thu, 11 Dec 2025 18:37:29 -0400 Subject: [PATCH] MM-65959: Add FIPS indicator to about dialog (#34463) --- server/config/client.go | 2 ++ server/fips/fips.go | 8 +++++ server/fips/fips_default.go | 8 +++++ .../about_build_modal.test.tsx | 34 +++++++++++++++++++ .../about_build_modal/about_build_modal.tsx | 4 ++- webapp/platform/types/src/config.ts | 1 + 6 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 server/fips/fips.go create mode 100644 server/fips/fips_default.go diff --git a/server/config/client.go b/server/config/client.go index a52c82845fc..0f854757361 100644 --- a/server/config/client.go +++ b/server/config/client.go @@ -9,6 +9,7 @@ import ( "strings" "github.com/mattermost/mattermost/server/public/model" + "github.com/mattermost/mattermost/server/v8/fips" ) // GenerateClientConfig renders the given configuration for a client. @@ -265,6 +266,7 @@ func GenerateLimitedClientConfig(c *model.Config, telemetryID string, license *m props["BuildHashEnterprise"] = model.BuildHashEnterprise props["BuildEnterpriseReady"] = model.BuildEnterpriseReady props["ServiceEnvironment"] = model.GetServiceEnvironment() + props["IsFipsEnabled"] = strconv.FormatBool(fips.IsEnabled) props["EnableBotAccountCreation"] = strconv.FormatBool(*c.ServiceSettings.EnableBotAccountCreation) props["EnableDesktopLandingPage"] = strconv.FormatBool(*c.ServiceSettings.EnableDesktopLandingPage) diff --git a/server/fips/fips.go b/server/fips/fips.go new file mode 100644 index 00000000000..894ef23cffc --- /dev/null +++ b/server/fips/fips.go @@ -0,0 +1,8 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +//go:build requirefips + +package fips + +const IsEnabled = true diff --git a/server/fips/fips_default.go b/server/fips/fips_default.go new file mode 100644 index 00000000000..9e959298989 --- /dev/null +++ b/server/fips/fips_default.go @@ -0,0 +1,8 @@ +// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +//go:build !requirefips + +package fips + +const IsEnabled = false diff --git a/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx b/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx index f141116534b..4867f4a8bf9 100644 --- a/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx +++ b/webapp/channels/src/components/about_build_modal/about_build_modal.test.tsx @@ -270,6 +270,40 @@ describe('components/AboutBuildModal', () => { expect(screen.getByTestId('aboutModalVersionInfo')).not.toHaveTextContent('Load Metric:'); }); + test('should show FIPS indicator when IsFipsEnabled is true', () => { + const fipsConfig = { + ...config, + IsFipsEnabled: 'true', + }; + + renderAboutBuildModal({config: fipsConfig}); + + expect(screen.getByTestId('aboutModalVersionInfo')).toHaveTextContent('Server Version: 3.6.0 (FIPS)'); + }); + + test('should not show FIPS indicator when IsFipsEnabled is false', () => { + const nonFipsConfig = { + ...config, + IsFipsEnabled: 'false', + }; + + renderAboutBuildModal({config: nonFipsConfig}); + + expect(screen.getByTestId('aboutModalVersionInfo')).toHaveTextContent('Server Version: 3.6.0'); + expect(screen.getByTestId('aboutModalVersionInfo')).not.toHaveTextContent('(FIPS)'); + }); + + test('should not show FIPS indicator when IsFipsEnabled is not set', () => { + const nonFipsConfig = { + ...config, + }; + + renderAboutBuildModal({config: nonFipsConfig}); + + expect(screen.getByTestId('aboutModalVersionInfo')).toHaveTextContent('Server Version: 3.6.0'); + expect(screen.getByTestId('aboutModalVersionInfo')).not.toHaveTextContent('(FIPS)'); + }); + function renderAboutBuildModal(props = {}) { const onExited = jest.fn(); const show = true; diff --git a/webapp/channels/src/components/about_build_modal/about_build_modal.tsx b/webapp/channels/src/components/about_build_modal/about_build_modal.tsx index e86f0643475..e5082e774e4 100644 --- a/webapp/channels/src/components/about_build_modal/about_build_modal.tsx +++ b/webapp/channels/src/components/about_build_modal/about_build_modal.tsx @@ -202,9 +202,11 @@ export default function AboutBuildModal(props: Props) { ); const getServerVersionString = () => { + const version = config.BuildNumber === 'dev' ? config.BuildNumber : config.Version; + const fipsSuffix = config.IsFipsEnabled === 'true' ? ' (FIPS)' : ''; return intl.formatMessage( {id: 'about.serverVersion', defaultMessage: 'Server Version:'}, - ) + '\u00a0' + (config.BuildNumber === 'dev' ? config.BuildNumber : config.Version); + ) + '\u00a0' + version + fipsSuffix; }; const getDesktopVersionString = () => { diff --git a/webapp/platform/types/src/config.ts b/webapp/platform/types/src/config.ts index 9c81db27f47..eae746a96cf 100644 --- a/webapp/platform/types/src/config.ts +++ b/webapp/platform/types/src/config.ts @@ -24,6 +24,7 @@ export type ClientConfig = { BuildHash: string; BuildHashEnterprise: string; BuildNumber: string; + IsFipsEnabled: string; CollapsedThreads: CollapsedThreads; CustomBrandText: string; CustomDescriptionText: string;