Skip to content

Commit

Permalink
Remove Account Console version 2
Browse files Browse the repository at this point in the history
Closes #19664

Signed-off-by: Jon Koops <jonkoops@gmail.com>
  • Loading branch information
jonkoops committed Mar 26, 2024
1 parent 2f0a9ba commit b6e2ccc
Show file tree
Hide file tree
Showing 82 changed files with 44 additions and 11,282 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Expand Up @@ -43,5 +43,4 @@
/js/ @keycloak/ui-maintainers
/adapters/oidc/js/ @keycloak/ui-maintainers
/rest/admin-ui-ext/ @keycloak/ui-maintainers
/themes/src/main/resources/theme/keycloak.v2/account/ @keycloak/ui-maintainers
/testsuite/integration-arquillian/tests/other/base-ui/ @keycloak/ui-maintainers
37 changes: 0 additions & 37 deletions .github/workflows/ci.yml
Expand Up @@ -578,42 +578,6 @@ jobs:
with:
job-id: fips-integration-tests-${{ matrix.mode }}

account-console-integration-tests:
name: Account Console IT
runs-on: ubuntu-latest
needs: build
timeout-minutes: 75
strategy:
matrix:
browser: [chrome]
fail-fast: false
steps:
- uses: actions/checkout@v4

- id: integration-test-setup
name: Integration test setup
uses: ./.github/actions/integration-test-setup

- name: Run Account Console IT
run: ./mvnw test ${{ env.SUREFIRE_RETRY }} -Pauth-server-quarkus -Dtest=**.account2.**,!SigningInTest#passwordlessWebAuthnTest,!SigningInTest#twoFactorWebAuthnTest -Dbrowser=${{ matrix.browser }} "-Dwebdriver.chrome.driver=$CHROMEWEBDRIVER/chromedriver" -f testsuite/integration-arquillian/tests/other/base-ui/pom.xml 2>&1 | misc/log/trimmer.sh

- name: Upload JVM Heapdumps
if: always()
uses: ./.github/actions/upload-heapdumps

- uses: ./.github/actions/upload-flaky-tests
name: Upload flaky tests
env:
GH_TOKEN: ${{ github.token }}
with:
job-name: Account Console IT

- name: Surefire reports
if: always()
uses: ./.github/actions/archive-surefire-reports
with:
job-id: account-console-integration-tests-${{ matrix.browser }}

forms-integration-tests:
name: Forms IT
runs-on: ubuntu-latest
Expand Down Expand Up @@ -797,7 +761,6 @@ jobs:
- clustering-integration-tests
- fips-unit-tests
- fips-integration-tests
- account-console-integration-tests
- forms-integration-tests
- webauthn-integration-tests
- sssd-unit-tests
Expand Down
2 changes: 0 additions & 2 deletions common/src/main/java/org/keycloak/common/Profile.java
Expand Up @@ -50,8 +50,6 @@ public enum Feature {

ACCOUNT_API("Account Management REST API", Type.DEFAULT),

@Deprecated
ACCOUNT2("Account Console version 2", Type.DEPRECATED, Feature.ACCOUNT_API),
ACCOUNT3("Account Console version 3", Type.DEFAULT, Feature.ACCOUNT_API),

ADMIN_FINE_GRAINED_AUTHZ("Fine-Grained Admin Permissions", Type.PREVIEW),
Expand Down
10 changes: 5 additions & 5 deletions common/src/test/java/org/keycloak/common/ProfileTest.java
Expand Up @@ -27,7 +27,7 @@ public class ProfileTest {
private static final Profile.Feature DISABLED_BY_DEFAULT_FEATURE = Profile.Feature.DOCKER;
private static final Profile.Feature PREVIEW_FEATURE = Profile.Feature.ADMIN_FINE_GRAINED_AUTHZ;
private static final Profile.Feature EXPERIMENTAL_FEATURE = Profile.Feature.DYNAMIC_SCOPES;
private static Profile.Feature DEPRECATED_FEATURE = Profile.Feature.ACCOUNT2;
private static Profile.Feature DEPRECATED_FEATURE = Profile.Feature.LINKEDIN_OAUTH;

@Rule
public TemporaryFolder temporaryFolder = new TemporaryFolder();
Expand Down Expand Up @@ -94,7 +94,7 @@ public void checkSuccessIfFeatureDisabledWithDisabledDependencies() {
properties.setProperty("keycloak.profile.feature.account3", "disabled");
properties.setProperty("keycloak.profile.feature.account_api", "disabled");
Profile.configure(new PropertiesProfileConfigResolver(properties));
Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.ACCOUNT2));
Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.ACCOUNT3));
Assert.assertFalse(Profile.isFeatureEnabled(Profile.Feature.ACCOUNT_API));
}

Expand Down Expand Up @@ -149,9 +149,9 @@ public void configWithCommaSeparatedList() {

@Test
public void testKeys() {
Assert.assertEquals("account2", Profile.Feature.ACCOUNT2.getKey());
Assert.assertEquals("account2", Profile.Feature.ACCOUNT2.getUnversionedKey());
Assert.assertEquals("account2:v1", Profile.Feature.ACCOUNT2.getVersionedKey());
Assert.assertEquals("account3", Profile.Feature.ACCOUNT3.getKey());
Assert.assertEquals("account3", Profile.Feature.ACCOUNT3.getUnversionedKey());
Assert.assertEquals("account3:v1", Profile.Feature.ACCOUNT3.getVersionedKey());
}

@Test
Expand Down
Expand Up @@ -49,7 +49,7 @@ public void testInvalidFeatureVersion() {
@Test
public void testValidFeatures() {
FeaturePropertyMappers.validateEnabledFeature("preview");
FeaturePropertyMappers.validateEnabledFeature(Feature.ACCOUNT2.getVersionedKey());
FeaturePropertyMappers.validateEnabledFeature(Feature.ACCOUNT3.getVersionedKey());
}

}
Expand Up @@ -47,14 +47,14 @@ public void failMultipleOptionValue(LaunchResult result) {
}

@Test
@Launch({"build", "--features", "account2", "account3"})
@Launch({"build", "--features", "linkedin-oauth", "account3"})
public void failMultipleMultiOptionValue(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
assertThat(cliResult.getErrorOutput(), containsString("Option '--features' (feature) expects one or more comma separated values without whitespace. Expected values are: "));
}

@Test
@Launch({"build", "--features", "xyz,account2"})
@Launch({"build", "--features", "xyz,account3"})
public void failInvalidMultiOptionValue(LaunchResult result) {
CLIResult cliResult = (CLIResult) result;
assertThat(cliResult.getErrorOutput(), containsString("xyz is an unrecognized feature, it should be one of"));
Expand Down
Expand Up @@ -48,10 +48,6 @@ default String getDefaultThemeName(Theme.Type type) {
return DEFAULT_V3;
}

if ((type == Theme.Type.ACCOUNT) && Profile.isFeatureEnabled(Profile.Feature.ACCOUNT2)) {
return DEFAULT_V2;
}

if ((type == Theme.Type.ADMIN) && Profile.isFeatureEnabled(Profile.Feature.ADMIN2)) {
return DEFAULT_V2;
}
Expand Down
Expand Up @@ -227,15 +227,12 @@ private void setThemes(ServerInfoRepresentation info) {

private LinkedList<String> filterThemes(Theme.Type type, LinkedList<String> themeNames) {
LinkedList<String> filteredNames = new LinkedList<>(themeNames);

boolean filterAccountV2 = (type == Theme.Type.ACCOUNT) &&
!Profile.isFeatureEnabled(Profile.Feature.ACCOUNT2);
boolean filterAdminV2 = (type == Theme.Type.ADMIN) &&
!Profile.isFeatureEnabled(Profile.Feature.ADMIN2);
boolean filterLoginV2 = (type == Theme.Type.LOGIN) &&
!Profile.isFeatureEnabled(Profile.Feature.LOGIN2);

if (filterAccountV2 || filterAdminV2 || filterLoginV2) {
if (filterAdminV2 || filterLoginV2) {
filteredNames.remove("keycloak.v2");
filteredNames.remove("rh-sso.v2");
}
Expand Down
Expand Up @@ -17,8 +17,6 @@
package org.keycloak.testsuite.util;

import org.jboss.arquillian.graphene.wait.ElementBuilder;
import org.keycloak.common.Profile;
import org.keycloak.testsuite.ProfileAssume;
import org.openqa.selenium.By;
import org.openqa.selenium.TimeoutException;
import org.openqa.selenium.WebDriver;
Expand Down Expand Up @@ -147,12 +145,6 @@ public static void waitForPageToLoad() {
log.warn("URL seems unstable! (Some redirect are probably still in progress)");
}
}

if (
ProfileAssume.isFeatureEnabled(Profile.Feature.ACCOUNT2) && currentUrl.matches("^[^\\/]+:\\/\\/[^\\/]+\\/auth\\/realms\\/[^\\/]+\\/account\\/.*$") // check for new Account Console URL
) {
pause(2000); // TODO rework this temporary workaround once KEYCLOAK-11201 and/or KEYCLOAK-8181 are fixed
}
}

public static void waitForModalFadeIn() {
Expand Down
Expand Up @@ -16,39 +16,12 @@
*/
package org.keycloak.testsuite.adapter.example.fuse;

import static org.hamcrest.Matchers.*;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.junit.Assert.assertTrue;
import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.assertCommand;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.getCommandOutput;
import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import org.jboss.arquillian.drone.api.annotation.Drone;
import org.jboss.arquillian.graphene.page.Page;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Before;
import org.junit.Test;
import org.keycloak.common.Profile;
import org.keycloak.protocol.oidc.OIDCLoginProtocolService;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.testsuite.adapter.AbstractExampleAdapterTest;
Expand All @@ -59,21 +32,49 @@
import org.keycloak.testsuite.adapter.page.fuse.CustomerPortalFuseExample;
import org.keycloak.testsuite.adapter.page.fuse.ProductPortalFuseExample;
import org.keycloak.testsuite.arquillian.annotation.AppServerContainer;
import org.keycloak.testsuite.arquillian.annotation.DisableFeature;
import org.keycloak.testsuite.auth.page.AuthRealm;
import org.keycloak.testsuite.pages.LogoutConfirmPage;
import org.keycloak.testsuite.utils.arquillian.ContainerConstants;
import org.keycloak.testsuite.auth.page.login.OIDCLogin;
import org.keycloak.testsuite.pages.LogoutConfirmPage;
import org.keycloak.testsuite.util.DroneUtils;
import org.keycloak.testsuite.util.JavascriptBrowser;
import org.keycloak.testsuite.util.WaitUtils;
import org.keycloak.testsuite.utils.arquillian.ContainerConstants;
import org.keycloak.testsuite.utils.fuse.FuseUtils.Result;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MBeanServerConnection;
import javax.management.ObjectName;
import javax.management.ReflectionException;
import javax.management.remote.JMXConnector;
import javax.management.remote.JMXConnectorFactory;
import javax.management.remote.JMXServiceURL;
import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.allOf;
import static org.hamcrest.Matchers.containsInAnyOrder;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.junit.Assert.assertTrue;
import static org.keycloak.testsuite.auth.page.AuthRealm.DEMO;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWith;
import static org.keycloak.testsuite.util.URLAssert.assertCurrentUrlStartsWithLoginUrlOf;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.assertCommand;
import static org.keycloak.testsuite.utils.fuse.FuseUtils.getCommandOutput;
import static org.keycloak.testsuite.utils.io.IOUtil.loadRealm;

@AppServerContainer(ContainerConstants.APP_SERVER_FUSE63)
@AppServerContainer(ContainerConstants.APP_SERVER_FUSE7X)
@DisableFeature(value = Profile.Feature.ACCOUNT2, skipRestart = true) // TODO remove this (KEYCLOAK-16228)
public class FuseAdapterTest extends AbstractExampleAdapterTest {


Expand Down
Expand Up @@ -35,7 +35,6 @@
/**
* @author Vaclav Muzikar <vmuzikar@redhat.com>
*/
@EnableFeature(value = Profile.Feature.ACCOUNT2, skipRestart = true)
public abstract class AbstractAccountTest extends AbstractUiTest {
public static final String ACCOUNT_THEME_NAME_KC = "keycloak.v2";
public static final DateTimeFormatter DEFAULT_TIME_FORMATTER = DateTimeFormatter.ofPattern("MMMM d, yyyy 'at' h:mm a", Locale.ENGLISH);
Expand Down
6 changes: 0 additions & 6 deletions testsuite/integration-arquillian/tests/other/pom.xml
Expand Up @@ -142,12 +142,6 @@
<module>sssd</module>
</modules>
</profile>
<profile>
<id>base-ui</id>
<modules>
<module>base-ui</module>
</modules>
</profile>
<profile>
<id>springboot</id>
<modules>
Expand Down
9 changes: 0 additions & 9 deletions themes/UPDATING-NODE-MODULES.md
Expand Up @@ -11,15 +11,6 @@ git add package.json pnpm-lock.yaml
cd -
```

## For account console v2

```bash
cd src/main/resources/theme/keycloak.v2/account/src
pnpm update --latest --interactive
git add package.json pnpm-lock.yaml
cd -
```

## License Information

Make sure to enter license information for new dependencies, as specified in `docs/dependency-license-information.md`. Javascript dependencies are included as `other` elements.
70 changes: 2 additions & 68 deletions themes/pom.xml
Expand Up @@ -14,20 +14,11 @@

<properties>
<dir.common>src/main/resources/theme/keycloak/common/resources</dir.common>
<dir.account2>src/main/resources/theme/keycloak.v2/account/src</dir.account2>
<!-- ignore folders for incremental builds by the maven build cache plugin -->
<maven.build.cache.exclude.value.1>src/main/resources/theme/keycloak/common/resources/node_modules</maven.build.cache.exclude.value.1>
<maven.build.cache.exclude.value.2>src/main/resources/theme/keycloak/common/resources/vendor</maven.build.cache.exclude.value.2>
<maven.build.cache.exclude.value.3>src/main/resources/theme/keycloak.v2/account/src/node_modules</maven.build.cache.exclude.value.3>
<maven.build.cache.exclude.value.4>src/main/resources/theme/keycloak.v2/account/src/web_modules</maven.build.cache.exclude.value.4>
<maven.build.cache.exclude.value.6>src/main/resources/theme/keycloak.v2/account/resources</maven.build.cache.exclude.value.6>
<maven.build.cache.exclude.glob.6>*.js</maven.build.cache.exclude.glob.6>
<maven.build.cache.exclude.value.7>src/main/resources/theme/keycloak.v2/account/resources</maven.build.cache.exclude.value.7>
<maven.build.cache.exclude.glob.7>*.js.map</maven.build.cache.exclude.glob.7>
<maven.build.cache.exclude.value.8>src/main/resources/theme/keycloak.v2/account/resources/public/app.css</maven.build.cache.exclude.value.8>
<maven.build.cache.exclude.value.9>src/main/resources/theme/keycloak.v2/account/web_modules</maven.build.cache.exclude.value.9>
<maven.build.cache.exclude.value.10>src/main/resources/theme/keycloak.v2/welcome/node_modules</maven.build.cache.exclude.value.10>
<maven.build.cache.exclude.value.11>src/main/resources/theme/keycloak.v2/welcome/resources/vendor</maven.build.cache.exclude.value.11>
<maven.build.cache.exclude.value.3>src/main/resources/theme/keycloak.v2/welcome/node_modules</maven.build.cache.exclude.value.3>
<maven.build.cache.exclude.value.4>src/main/resources/theme/keycloak.v2/welcome/resources/vendor</maven.build.cache.exclude.value.4>
</properties>

<dependencies>
Expand Down Expand Up @@ -86,8 +77,6 @@
<exclude>**/Gruntfile.js</exclude>
<exclude>**/Gemfile*</exclude>
<exclude>**/.*</exclude>

<exclude>**/keycloak.v2/account/src/**</exclude>
</excludes>
</resource>
</resources>
Expand Down Expand Up @@ -123,61 +112,6 @@
</build>
</profile>

<profile>
<id>account2</id>
<activation>
<property>
<name>!skipAccount2</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
<filesets>
<fileset>
<directory>${dir.account2}/web_modules</directory>
</fileset>
</filesets>
</configuration>
</plugin>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<executions>
<execution>
<id>install-node-and-pnpm-account2</id>
<goals>
<goal>install-node-and-pnpm</goal>
</goals>
</execution>
<execution>
<id>pnpm-install-account2</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>${pnpm.args.install}</arguments>
<workingDirectory>${dir.account2}</workingDirectory>
</configuration>
</execution>
<execution>
<id>run-build-account2</id>
<goals>
<goal>pnpm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
<workingDirectory>${dir.account2}</workingDirectory>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>

<profile>
<id>common</id>
<activation>
Expand Down

0 comments on commit b6e2ccc

Please sign in to comment.