diff --git a/enterprise/backend/test/metabase_enterprise/api/session_test.clj b/enterprise/backend/test/metabase_enterprise/api/session_test.clj new file mode 100644 index 0000000000000000000000000000000000000000..82773aa89ae6b0354e5fa8ea291693634ebb50fe --- /dev/null +++ b/enterprise/backend/test/metabase_enterprise/api/session_test.clj @@ -0,0 +1,35 @@ +(ns metabase-enterprise.api.session-test + (:require + [clojure.test :refer :all] + [metabase.public-settings.premium-features-test :as premium-features-test] + [metabase.test :as mt] + [metabase.test.fixtures :as fixtures])) + +(use-fixtures :once (fixtures/initialize :db)) + +(deftest properties-token-features-test + (premium-features-test/with-premium-features #{:audit-app + :advanced-permissions + :embedding + :whitelabel + :advanced-config + :content-management + :sso + :hosting + :sandboxes + :snippet-collections + :disable-password-login + :official-collections} + (is (= {:advanced_config true + :advanced_permissions true + :audit_app true + :content_management true + :disable_password_login true + :embedding true + :hosting true + :official_collections true + :sandboxes true + :snippet_collections true + :sso true + :whitelabel true} + (:token-features (mt/user-http-request :crowberto :get 200 "session/properties")))))) diff --git a/enterprise/backend/test/metabase_enterprise/api/session_test.lcj b/enterprise/backend/test/metabase_enterprise/api/session_test.lcj new file mode 100644 index 0000000000000000000000000000000000000000..b152f63728d2952e184a89a480eb2014877f404d --- /dev/null +++ b/enterprise/backend/test/metabase_enterprise/api/session_test.lcj @@ -0,0 +1,8 @@ +(ns metabase-enterprise.audit-app.api.user-test + (:require + [clojure.test :refer :all] + [metabase.models :refer [Card Dashboard DashboardCard Pulse PulseCard PulseChannel PulseChannelRecipient User]] + [metabase.public-settings.premium-features-test :as premium-features-test] + [metabase.test :as mt] + [toucan2.core :as t2] + [toucan2.tools.with-temp :as t2.with-temp])) diff --git a/src/metabase/public_settings.clj b/src/metabase/public_settings.clj index 9182a2c9ea0c4ab85dfc7c74b17c5f6d4fc05a5e..ec880a91ed09069b222dc6a51c4f22ccc7c94f0b 100644 --- a/src/metabase/public_settings.clj +++ b/src/metabase/public_settings.clj @@ -546,15 +546,18 @@ "Features registered for this instance's token" :visibility :public :setter :none - :getter (fn [] {:embedding (premium-features/hide-embed-branding?) - :whitelabel (premium-features/enable-whitelabeling?) - :audit_app (premium-features/enable-audit-app?) - :sandboxes (premium-features/enable-sandboxes?) - :sso (premium-features/enable-sso?) - :advanced_config (premium-features/enable-advanced-config?) - :advanced_permissions (premium-features/enable-advanced-permissions?) - :content_management (premium-features/enable-content-management?) - :hosting (premium-features/is-hosted?)}) + :getter (fn [] {:embedding (premium-features/hide-embed-branding?) + :whitelabel (premium-features/enable-whitelabeling?) + :audit_app (premium-features/enable-audit-app?) + :sandboxes (premium-features/enable-sandboxes?) + :sso (premium-features/enable-sso?) + :advanced_config (premium-features/enable-advanced-config?) + :advanced_permissions (premium-features/enable-advanced-permissions?) + :content_management (premium-features/enable-content-management?) + :hosting (premium-features/is-hosted?) + :official_collections (premium-features/enable-official-collections?) + :snippet_collections (premium-features/enable-snippet-collections?) + :disable_password_login (premium-features/can-disable-password-login?)}) :doc false) (defsetting redirect-all-requests-to-https diff --git a/src/metabase/public_settings/premium_features.clj b/src/metabase/public_settings/premium_features.clj index 0283b2d7bc2e56cd180fdcf1d0af9b8915769b23..f109b4c94b5d8d59dddd7d3042489ed07af3211c 100644 --- a/src/metabase/public_settings/premium_features.clj +++ b/src/metabase/public_settings/premium_features.clj @@ -292,6 +292,10 @@ "Should we enable advanced SSO features (SAML and JWT authentication; role and group mapping)?" :sso) +(define-premium-feature can-disable-password-login? + "Can we password login?" + :disable-password-login) + (define-premium-feature ^{:added "0.41.0"} enable-advanced-config? "Should we enable knobs and levers for more complex orgs (granular caching controls, allow-lists email domains for notifications, more in the future)?" @@ -303,10 +307,17 @@ :advanced-permissions) (define-premium-feature ^{:added "0.41.0"} enable-content-management? - "Should we enable official Collections, Question verifications (and more in the future, like workflows, forking, - etc.)?" + "Should we enable Question verifications (and more in the future, like workflows, forking, etc.)?" :content-management) +(define-premium-feature ^{:added "0.41.0"} enable-official-collections? + "Should we enable Official Collections?" + :official-collections) + +(define-premium-feature ^{:added "0.41.0"} enable-snippet-collections? + "Should we enable Snippet collections" + :snippet-collections) + (define-premium-feature ^{:added "0.45.0"} enable-serialization? "Enable the v2 SerDes functionality" :serialization) diff --git a/test/metabase/api/session_test.clj b/test/metabase/api/session_test.clj index 5ea3fde6c4feaf35f10914b46a5eb1a9f628e117..30582e5d9f88924b30700faa9bbbb8128e825365 100644 --- a/test/metabase/api/session_test.clj +++ b/test/metabase/api/session_test.clj @@ -383,7 +383,6 @@ (-> (mt/user-http-request :crowberto :get 200 "session/properties") :test-session-api-setting))))))) - (deftest properties-i18n-test (testing "GET /session/properties" (testing "Setting the X-Metabase-Locale header should result give you properties in that locale"