diff --git a/.github/workflows/js-ci.yml b/.github/workflows/js-ci.yml index 48c9f0b56fcd..629a601f8e20 100644 --- a/.github/workflows/js-ci.yml +++ b/.github/workflows/js-ci.yml @@ -182,8 +182,6 @@ jobs: - name: Run Playwright tests run: pnpm --fail-if-no-match --filter ${{ env.WORKSPACE }} test - env: - KEYCLOAK_SERVER: http://localhost:8080 - name: Upload Playwright report uses: actions/upload-artifact@v4 @@ -285,7 +283,6 @@ jobs: working-directory: js/apps/admin-ui env: CYPRESS_BASE_URL: http://localhost:8080/admin/ - CYPRESS_KEYCLOAK_SERVER: http://localhost:8080 SPLIT: ${{ strategy.job-total }} SPLIT_INDEX: ${{ strategy.job-index }} SPLIT_RANDOM_SEED: ${{ needs.generate-test-seed.outputs.seed }} diff --git a/common/src/main/java/org/keycloak/common/util/Environment.java b/common/src/main/java/org/keycloak/common/util/Environment.java index 02aa6da79d00..f491eed5d305 100644 --- a/common/src/main/java/org/keycloak/common/util/Environment.java +++ b/common/src/main/java/org/keycloak/common/util/Environment.java @@ -29,6 +29,10 @@ public class Environment { public static final int DEFAULT_JBOSS_AS_STARTUP_TIMEOUT = 300; + public static final String PROFILE = "kc.profile"; + public static final String ENV_PROFILE = "KC_PROFILE"; + public static final String DEV_PROFILE_VALUE = "dev"; + public static int getServerStartupTimeout() { String timeout = System.getProperty("jboss.as.management.blocking.timeout"); if (timeout != null) { @@ -57,4 +61,17 @@ public static boolean isJavaInFipsMode() { return false; } + public static boolean isDevMode() { + return DEV_PROFILE_VALUE.equalsIgnoreCase(getProfile()); + } + + public static String getProfile() { + String profile = System.getProperty(PROFILE); + + if (profile != null) { + return profile; + } + + return System.getenv(ENV_PROFILE); + } } diff --git a/core/pom.xml b/core/pom.xml index c057066ccc49..5d1f8600b634 100755 --- a/core/pom.xml +++ b/core/pom.xml @@ -54,6 +54,10 @@ com.fasterxml.jackson.core jackson-databind + + com.fasterxml.jackson.datatype + jackson-datatype-jdk8 + org.jboss.logging jboss-logging diff --git a/core/src/main/java/org/keycloak/util/JsonSerialization.java b/core/src/main/java/org/keycloak/util/JsonSerialization.java index e321d11151f5..e082ac54ba20 100755 --- a/core/src/main/java/org/keycloak/util/JsonSerialization.java +++ b/core/src/main/java/org/keycloak/util/JsonSerialization.java @@ -24,6 +24,7 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; import com.fasterxml.jackson.databind.node.ObjectNode; +import com.fasterxml.jackson.datatype.jdk8.Jdk8Module; import java.io.IOException; import java.io.InputStream; @@ -41,6 +42,7 @@ public class JsonSerialization { public static final ObjectMapper sysPropertiesAwareMapper = new ObjectMapper(new SystemPropertiesJsonParserFactory()); static { + mapper.registerModule(new Jdk8Module()); mapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); prettyMapper.configure(SerializationFeature.FAIL_ON_EMPTY_BEANS, false); diff --git a/js/apps/account-ui/index.html b/js/apps/account-ui/index.html deleted file mode 100644 index f284617802de..000000000000 --- a/js/apps/account-ui/index.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - - - - - Account Management - - - - - - - - - - - - - Loading the account console - - - - - - You need to enable JavaScript to run this app. - - - diff --git a/js/apps/account-ui/maven-resources/theme/keycloak.v3/account/index.ftl b/js/apps/account-ui/maven-resources/theme/keycloak.v3/account/index.ftl new file mode 100644 index 000000000000..1cc5a4d4e9cb --- /dev/null +++ b/js/apps/account-ui/maven-resources/theme/keycloak.v3/account/index.ftl @@ -0,0 +1,139 @@ + + + + + + + + + ${properties.title!'Account Management'} + + + <#if devServerUrl?has_content> + + + + + #if> + <#if entryStyles?has_content> + <#list entryStyles as style> + + #list> + #if> + <#if properties.styles?has_content> + <#list properties.styles?split(' ') as style> + + #list> + #if> + <#if entryScript?has_content> + + #if> + <#if properties.scripts?has_content> + <#list properties.scripts?split(' ') as script> + + #list> + #if> + <#if entryImports?has_content> + <#list entryImports as import> + + #list> + #if> + + + + + + + + + + + + Loading the Account Console + + + + + JavaScript is required to use the Account Console. + + + diff --git a/js/apps/account-ui/playwright.config.ts b/js/apps/account-ui/playwright.config.ts index 706eeb49dd25..8580ab472adb 100644 --- a/js/apps/account-ui/playwright.config.ts +++ b/js/apps/account-ui/playwright.config.ts @@ -1,5 +1,6 @@ import { defineConfig, devices } from "@playwright/test"; -import { getRootPath } from "./src/utils/getRootPath"; + +import { getAccountUrl } from "./test/utils"; /** * See https://playwright.dev/docs/test-configuration. @@ -16,7 +17,7 @@ export default defineConfig({ }, use: { - baseURL: `http://localhost:8080${getRootPath()}`, + baseURL: getAccountUrl(), trace: "on-first-retry", }, diff --git a/js/apps/account-ui/pom.xml b/js/apps/account-ui/pom.xml index 9378e6035a6a..203fad0206fc 100644 --- a/js/apps/account-ui/pom.xml +++ b/js/apps/account-ui/pom.xml @@ -94,110 +94,6 @@ - - com.google.code.maven-replacer-plugin - maven-replacer-plugin - - - process-resources - - replace - - - - - dist/index.html - target/classes/theme/keycloak.v3/account/index.ftl - false - - - src="./ - src="${resourceUrl}/ - - - href="./ - href="${resourceUrl}/ - - - ]]> - ]]> - - - ]]> - ]]> - - - Account Management]]> - -${properties.title!"Account Management"} - -]]> - - - ]]> - - - { - "authUrl": "${authUrl}", - "authServerUrl": "${authServerUrl}", - "realm": "${realm.name}", - "clientId": "${clientId}", - "resourceUrl": "${resourceUrl}", - "logo": "${properties.logo!""}", - "logoUrl": "${properties.logoUrl!""}", - "baseUrl": "${baseUrl}", - "locale": "${locale}", - "referrerName": "${referrerName!""}", - "referrerUrl": "${referrer_uri!""}", - "features": { - "isRegistrationEmailAsUsername": ${realm.registrationEmailAsUsername?c}, - "isEditUserNameAllowed": ${realm.editUsernameAllowed?c}, - "isInternationalizationEnabled": ${realm.isInternationalizationEnabled()?c}, - "isLinkedAccountsEnabled": ${realm.identityFederationEnabled?c}, - "isMyResourcesEnabled": ${(realm.userManagedAccessAllowed && isAuthorizationEnabled)?c}, - "deleteAccountAllowed": ${deleteAccountAllowed?c}, - "updateEmailFeatureEnabled": ${updateEmailFeatureEnabled?c}, - "updateEmailActionEnabled": ${updateEmailActionEnabled?c}, - "isViewGroupsEnabled": ${isViewGroupsEnabled?c}, - "isOid4VciEnabled": ${isOid4VciEnabled?c} - } - } - -
Loading the account console
Loading the Account Console