From 513c00bcd94a5c9e9d4029141c0513110c0ca902 Mon Sep 17 00:00:00 2001 From: Stan Silvert Date: Tue, 20 Jun 2023 15:02:22 -0400 Subject: [PATCH] Remove unused feature flags. (#21039) * Remove unused feature flags. Fixes #20944 Fixes #20943 * Update release notes. * Update docs/documentation/release_notes/topics/22_0_0.adoc Co-authored-by: Jon Koops --------- Co-authored-by: Jon Koops --- docs/documentation/release_notes/topics/22_0_0.adoc | 8 +++++++- js/apps/account-ui/pom.xml | 2 -- .../services/resources/account/AccountConsole.java | 6 ------ .../main/resources/theme/keycloak.v2/account/index.ftl | 4 +--- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/documentation/release_notes/topics/22_0_0.adoc b/docs/documentation/release_notes/topics/22_0_0.adoc index 2531b32560..0d10837926 100644 --- a/docs/documentation/release_notes/topics/22_0_0.adoc +++ b/docs/documentation/release_notes/topics/22_0_0.adoc @@ -88,4 +88,10 @@ In relation to the KeyStore Vault news, we also integrated Quarkus's recently re = Account Console v3 promoted to preview -In version 21.1.0 of Keycloak the new Account Console (version 3) was introduced as an experimental feature. Starting this version it has been promoted to a preview feature. \ No newline at end of file +In version 21.1.0 of Keycloak the new Account Console (version 3) was introduced as an experimental feature. Starting this version it has been promoted to a preview feature. + += Account Console template variables removed + +Two of the variables exposed to the Account Console V2 and V3 templates (`isEventsEnabled` and `isTotpConfigured`) were left unused, and have been removed in this release. + +It is possible that if a developer extended the Account Console theme, he or she could make use of these variables. So make sure that these variables are no longer used if you are extending the base theme. \ No newline at end of file diff --git a/js/apps/account-ui/pom.xml b/js/apps/account-ui/pom.xml index c7202adf31..0adf4430de 100644 --- a/js/apps/account-ui/pom.xml +++ b/js/apps/account-ui/pom.xml @@ -98,9 +98,7 @@ "isEditUserNameAllowed": ${realm.editUsernameAllowed?c}, "isInternationalizationEnabled": ${realm.isInternationalizationEnabled()?c}, "isLinkedAccountsEnabled": ${realm.identityFederationEnabled?c}, - "isEventsEnabled": ${isEventsEnabled?c}, "isMyResourcesEnabled": ${(realm.userManagedAccessAllowed && isAuthorizationEnabled)?c}, - "isTotpConfigured": ${isTotpConfigured?c}, "deleteAccountAllowed": ${deleteAccountAllowed?c}, "updateEmailFeatureEnabled": ${updateEmailFeatureEnabled?c}, "updateEmailActionEnabled": ${updateEmailActionEnabled?c}, diff --git a/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java b/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java index a524d8b213..0973df958c 100644 --- a/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java +++ b/services/src/main/java/org/keycloak/services/resources/account/AccountConsole.java @@ -128,23 +128,17 @@ public class AccountConsole { } }); - EventStoreProvider eventStore = session.getProvider(EventStoreProvider.class); - map.put("isEventsEnabled", eventStore != null && realm.isEventsEnabled()); map.put("isAuthorizationEnabled", Profile.isFeatureEnabled(Profile.Feature.AUTHORIZATION)); - boolean isTotpConfigured = false; boolean deleteAccountAllowed = false; boolean isViewGroupsEnabled= false; if (user != null) { - isTotpConfigured = user.credentialManager().isConfiguredFor(realm.getOTPPolicy().getType()); RoleModel deleteAccountRole = realm.getClientByClientId(Constants.ACCOUNT_MANAGEMENT_CLIENT_ID).getRole(AccountRoles.DELETE_ACCOUNT); deleteAccountAllowed = deleteAccountRole != null && user.hasRole(deleteAccountRole) && realm.getRequiredActionProviderByAlias(DeleteAccount.PROVIDER_ID).isEnabled(); RoleModel viewGrouRole = realm.getClientByClientId(Constants.ACCOUNT_MANAGEMENT_CLIENT_ID).getRole(AccountRoles.VIEW_GROUPS); isViewGroupsEnabled = viewGrouRole != null && user.hasRole(viewGrouRole); } - map.put("isTotpConfigured", isTotpConfigured); - map.put("deleteAccountAllowed", deleteAccountAllowed); map.put("isViewGroupsEnabled", isViewGroupsEnabled); diff --git a/themes/src/main/resources/theme/keycloak.v2/account/index.ftl b/themes/src/main/resources/theme/keycloak.v2/account/index.ftl index 84c45c4b14..8a4a81eb49 100644 --- a/themes/src/main/resources/theme/keycloak.v2/account/index.ftl +++ b/themes/src/main/resources/theme/keycloak.v2/account/index.ftl @@ -43,9 +43,7 @@ isEditUserNameAllowed : ${realm.editUsernameAllowed?c}, isInternationalizationEnabled : ${realm.isInternationalizationEnabled()?c}, isLinkedAccountsEnabled : ${realm.identityFederationEnabled?c}, - isEventsEnabled : ${isEventsEnabled?c}, isMyResourcesEnabled : ${(realm.userManagedAccessAllowed && isAuthorizationEnabled)?c}, - isTotpConfigured : ${isTotpConfigured?c}, deleteAccountAllowed : ${deleteAccountAllowed?c}, updateEmailFeatureEnabled: ${updateEmailFeatureEnabled?c}, updateEmailActionEnabled: ${updateEmailActionEnabled?c}, @@ -108,7 +106,7 @@ - +