From 3cfe33555cde215738faff307672bf440cd267fe Mon Sep 17 00:00:00 2001
From: adam-james <21064735+adam-james-v@users.noreply.github.com>
Date: Wed, 15 Jun 2022 14:03:07 -0700
Subject: [PATCH] JWT shared key can now be any string. Message to suggest
 64char key (#23366)

* JWT shared key can now be any string. Message to suggest 64char key

* Remove util require

* We can now pass nice, readable multiline strings to tru/trs macros

So let's do that here :)
---
 .../sso/integrations/sso_settings.clj                 | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/enterprise/backend/src/metabase_enterprise/sso/integrations/sso_settings.clj b/enterprise/backend/src/metabase_enterprise/sso/integrations/sso_settings.clj
index 0891aa4417a..f589d4f1b60 100644
--- a/enterprise/backend/src/metabase_enterprise/sso/integrations/sso_settings.clj
+++ b/enterprise/backend/src/metabase_enterprise/sso/integrations/sso_settings.clj
@@ -4,7 +4,6 @@
   information. Separating out this information creates a better dependency graph and avoids circular dependencies."
   (:require [clojure.tools.logging :as log]
             [metabase.models.setting :as setting :refer [defsetting]]
-            [metabase.util :as u]
             [metabase.util.i18n :refer [deferred-tru trs tru]]
             [metabase.util.schema :as su]
             [saml20-clj.core :as saml]
@@ -108,12 +107,10 @@ on your IdP, this usually looks something like http://www.example.com/141xkex604
   (deferred-tru "URL of JWT based login page"))
 
 (defsetting jwt-shared-secret
-  (deferred-tru "String used to seed the private key used to validate JWT messages")
-  :setter (fn [new-value]
-            (when (seq new-value)
-              (assert (u/hexadecimal-string? new-value)
-                       "Invalid JWT Shared Secret key must be a hexadecimal-encoded 256-bit key (i.e., a 64-character string)."))
-            (setting/set-value-of-type! :string :jwt-shared-secret new-value)))
+  (deferred-tru (str "String used to seed the private key used to validate JWT messages."
+                     " "
+                     "A hexadecimal-encoded 256-bit key (i.e., a 64-character string) is strongly recommended."))
+  :type :string)
 
 (defsetting jwt-attribute-email
   (deferred-tru "Key to retrieve the JWT user's email address")
-- 
GitLab