From 70eb1939ae09a095a9e8011ab2e4b5f55044beb9 Mon Sep 17 00:00:00 2001 From: Nicolas Chaulet Date: Mon, 17 Apr 2023 08:52:33 -0400 Subject: [PATCH] [Fleet] Fix output ca_trusted_fingerprint validation message (#154651) --- .../edit_output_flyout/output_form_validators.test.tsx | 4 +++- .../components/edit_output_flyout/output_form_validators.tsx | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.test.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.test.tsx index ea0e1541fb41c..6b806fe1f20bd 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.test.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.test.tsx @@ -118,7 +118,9 @@ describe('Output form validation', () => { '9F:0A:10:41:14:57:AD:DE:39:82:EF:01:DF:20:D2:E7:AA:53:A8:EF:29:C5:0B:CB:FA:3F:3E:93:AE:BF:63:1B' ); - expect(res).toEqual(['CA trusted fingerprint should be a base64 CA sha256 fingerprint']); + expect(res).toEqual([ + 'CA trusted fingerprint should be valid HEX encoded SHA-256 of a CA certificate', + ]); }); }); }); diff --git a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.tsx b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.tsx index d76bb1ca7d035..870b1f74b9bca 100644 --- a/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.tsx +++ b/x-pack/plugins/fleet/public/applications/fleet/sections/settings/components/edit_output_flyout/output_form_validators.tsx @@ -154,7 +154,8 @@ export function validateCATrustedFingerPrint(value: string) { if (value !== '' && !value.match(/^[a-zA-Z0-9]+$/)) { return [ i18n.translate('xpack.fleet.settings.outputForm.caTrusterdFingerprintInvalidErrorMessage', { - defaultMessage: 'CA trusted fingerprint should be a base64 CA sha256 fingerprint', + defaultMessage: + 'CA trusted fingerprint should be valid HEX encoded SHA-256 of a CA certificate', }), ]; }