Skip to content

Commit

Permalink
Merge pull request #1581 from michalvavrik/feature/fix-rh-sso-ocp-fai…
Browse files Browse the repository at this point in the history
…lures

Keycloak fixes and Quarkus FW bump to 1.4.0.Beta5
  • Loading branch information
jedla97 authored Dec 19, 2023
2 parents c72797a + c9287da commit f6cbb3b
Show file tree
Hide file tree
Showing 45 changed files with 215 additions and 169 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.quarkus.ts.http.advanced.reactive;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import org.junit.jupiter.api.Tag;

import io.quarkus.test.bootstrap.KeycloakService;
Expand All @@ -12,11 +16,9 @@
@QuarkusScenario
public class HttpAdvancedReactiveIT extends BaseHttpAdvancedReactiveIT {

private static final String REALM_DEFAULT = "test-realm";

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm", "--hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

@QuarkusApplication(ssl = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.quarkus.ts.http.advanced.reactive;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.bootstrap.KeycloakService;
Expand All @@ -13,11 +17,9 @@
@DisabledIfSystemProperty(named = "ts.s390x.missing.services.excludes", matches = "true", disabledReason = "keycloak container not available on s390x.")
public class OpenShiftHttpAdvancedReactiveIT extends BaseHttpAdvancedReactiveIT {

private static final String REALM_DEFAULT = "test-realm";

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm", "--hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

@QuarkusApplication(ssl = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@

public abstract class BaseHttpAdvancedIT {

protected static final String REALM_DEFAULT = "test-realm";
private static final String ROOT_PATH = "/api";
private static final int TIMEOUT_SEC = 3;
private static final int RETRY = 3;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.quarkus.ts.http.advanced;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import org.junit.jupiter.api.Tag;

import io.quarkus.test.bootstrap.KeycloakService;
Expand All @@ -13,8 +17,8 @@
public class HttpAdvancedIT extends BaseHttpAdvancedIT {

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm", "--hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

@QuarkusApplication(ssl = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.quarkus.ts.http.advanced;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import org.junit.jupiter.api.condition.DisabledIfSystemProperty;

import io.quarkus.test.bootstrap.KeycloakService;
Expand All @@ -14,8 +18,8 @@
public class OpenShiftHttpAdvancedIT extends BaseHttpAdvancedIT {

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm", "--hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

@QuarkusApplication(ssl = true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package io.quarkus.ts.micrometer.oidc;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;
import static org.awaitility.Awaitility.await;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.equalTo;
Expand All @@ -18,7 +21,6 @@
public abstract class BaseMicrometerOidcSecurityIT {

static final String NORMAL_USER = "test-normal-user";
static final String REALM_DEFAULT = "test-realm";
static final String CLIENT_ID_DEFAULT = "test-application-client";
static final String CLIENT_SECRET_DEFAULT = "test-application-client-secret";
static final int ASSERT_SERVICE_TIMEOUT_MINUTES = 1;
Expand All @@ -28,8 +30,8 @@ public abstract class BaseMicrometerOidcSecurityIT {
static final String UNAUTHORIZED_HTTP_CALL_METRIC = HTTP_METRIC + "outcome=\"CLIENT_ERROR\",status=\"401\",uri=\"%s\"}";

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

private AuthzClient authzClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class DevMicrometerOidcSecurityIT extends BaseMicrometerOidcSecurityIT {

@DevModeQuarkusApplication
static RestService app = new RestService()
.withProperty("quarkus.oidc.auth-server-url", () -> keycloak.getRealmUrl())
.withProperty("quarkus.oidc.auth-server-url", keycloak::getRealmUrl)
.withProperty("quarkus.oidc.client-id", CLIENT_ID_DEFAULT)
.withProperty("quarkus.oidc.credentials.secret", CLIENT_SECRET_DEFAULT);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class ProdMicrometerOidcSecurityIT extends BaseMicrometerOidcSecurityIT {

@QuarkusApplication
static RestService app = new RestService()
.withProperty("quarkus.oidc.auth-server-url", () -> keycloak.getRealmUrl())
.withProperty("quarkus.oidc.auth-server-url", keycloak::getRealmUrl)
.withProperty("quarkus.oidc.client-id", CLIENT_ID_DEFAULT)
.withProperty("quarkus.oidc.credentials.secret", CLIENT_SECRET_DEFAULT);

Expand Down
9 changes: 5 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>999-SNAPSHOT</quarkus.platform.version>
<quarkus.ide.version>3.6.1</quarkus.ide.version>
<quarkus.qe.framework.version>1.4.0.Beta4</quarkus.qe.framework.version>
<quarkus.qe.framework.version>1.4.0.Beta5</quarkus.qe.framework.version>
<quarkus-qpid-jms.version>2.5.0</quarkus-qpid-jms.version>
<apache-httpclient-fluent.version>4.5.14</apache-httpclient-fluent.version>
<confluent.kafka-avro-serializer.version>7.5.1</confluent.kafka-avro-serializer.version>
Expand Down Expand Up @@ -57,6 +57,7 @@
<exclude.quarkus.devmode.tests>no</exclude.quarkus.devmode.tests>
<!-- Docker images used by both surefire and failsafe plugin -->
<postgresql.latest.image>docker.io/library/postgres:15</postgresql.latest.image>
<rhbk.image>registry.redhat.io/rhbk/keycloak-rhel9:22-6</rhbk.image>
<wiremock-jre8.version>2.35.1</wiremock-jre8.version>
<build-reporter-maven-extension.version>3.3.1</build-reporter-maven-extension.version>
</properties>
Expand Down Expand Up @@ -749,7 +750,7 @@
<systemPropertyVariables>
<ts.redhat.registry.enabled>true</ts.redhat.registry.enabled>
<!-- Product Services -->
<rhsso.image>registry.redhat.io/rh-sso-7/sso76-openshift-rhel8</rhsso.image>
<rhbk.image>${rhbk.image}</rhbk.image>
<postgresql.10.image>registry.redhat.io/rhscl/postgresql-10-rhel7</postgresql.10.image>
<postgresql.latest.image>registry.redhat.io/rhscl/postgresql-13-rhel7</postgresql.latest.image>
<mariadb.103.image>registry.redhat.io/rhscl/mariadb-103-rhel7</mariadb.103.image>
Expand Down Expand Up @@ -799,7 +800,7 @@
<ts.arm.missing.services.excludes>true</ts.arm.missing.services.excludes>
<ts.redhat.registry.enabled>true</ts.redhat.registry.enabled>
<!-- Product Services -->
<rhsso.image>registry.redhat.io/rh-sso-7/sso76-openshift-rhel8</rhsso.image>
<rhbk.image>${rhbk.image}</rhbk.image>
<postgresql.10.image>registry.redhat.io/rhel8/postgresql-10</postgresql.10.image>
<mysql.80.image>registry.redhat.io/rhel8/mysql-80</mysql.80.image>
<mariadb.103.image>registry.redhat.io/rhel8/mariadb-103</mariadb.103.image>
Expand Down Expand Up @@ -852,7 +853,7 @@
<ts.redhat.registry.enabled>true</ts.redhat.registry.enabled>
<!-- Product Services -->
<amqbroker.image>registry.redhat.io/amq7/amq-broker-rhel8:7.10</amqbroker.image>
<rhsso.image>registry.redhat.io/rh-sso-7/sso76-openshift-rhel8</rhsso.image>
<rhbk.image>${rhbk.image}</rhbk.image>
<postgresql.10.image>registry.redhat.io/rhel8/postgresql-10</postgresql.10.image>
<mysql.80.image>registry.redhat.io/rhel8/mysql-80</mysql.80.image>
<mariadb.103.image>registry.redhat.io/rhel8/mariadb-103</mariadb.103.image>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ public abstract class BaseAuthzSecurityIT {

static final String NORMAL_USER = "test-normal-user";
static final String ADMIN_USER = "test-admin-user";
static final String REALM_DEFAULT = "test-realm";
static final String CLIENT_ID_DEFAULT = "test-application-client";
static final String CLIENT_SECRET_DEFAULT = "test-application-client-secret";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.quarkus.ts.security.keycloak.authz;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import io.quarkus.test.bootstrap.KeycloakService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.QuarkusScenario;
Expand All @@ -9,11 +13,9 @@
@QuarkusScenario
public class KeycloakAuthzSecurityIT extends BaseAuthzSecurityIT {

static final int KEYCLOAK_PORT = 8080;

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm", "--hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

@QuarkusApplication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package io.quarkus.ts.security.keycloak.authz;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

import io.quarkus.test.bootstrap.KeycloakService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.KeycloakContainer;
import io.quarkus.test.services.QuarkusApplication;

@OpenShiftScenario
@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1145")
@EnabledIfSystemProperty(named = "ts.redhat.registry.enabled", matches = "true")
public class OpenShiftRhSsoAuthzSecurityIT extends BaseAuthzSecurityIT {

static final int KEYCLOAK_PORT = 8080;

@Container(image = "${rhsso.image}", expectedLog = "Http management interface listening", port = KEYCLOAK_PORT)
static KeycloakService keycloak = new KeycloakService(REALM_DEFAULT)
.withProperty("SSO_IMPORT_FILE", "resource::/keycloak-realm.json");
@KeycloakContainer(command = { "start-dev", "--import-realm" }, image = "${rhbk.image}")
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH);

@QuarkusApplication
static RestService app = new RestService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public abstract class BaseAuthzSecurityReactiveIT {

static final String NORMAL_USER = "test-normal-user";
static final String ADMIN_USER = "test-admin-user";
static final String REALM_DEFAULT = "test-realm";
static final String CLIENT_ID_DEFAULT = "test-application-client";
static final String CLIENT_SECRET_DEFAULT = "test-application-client-secret";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.quarkus.ts.security.keycloak.authz.reactive;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import io.quarkus.test.bootstrap.KeycloakService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.QuarkusScenario;
Expand All @@ -10,8 +14,8 @@
public class KeycloakAuthzSecurityReactiveIT extends BaseAuthzSecurityReactiveIT {

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

@QuarkusApplication
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
package io.quarkus.ts.security.keycloak.authz.reactive;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;

import io.quarkus.test.bootstrap.KeycloakService;
import io.quarkus.test.bootstrap.RestService;
import io.quarkus.test.scenarios.OpenShiftScenario;
import io.quarkus.test.services.Container;
import io.quarkus.test.services.KeycloakContainer;
import io.quarkus.test.services.QuarkusApplication;

@OpenShiftScenario
@DisabledIfSystemProperty(named = "ts.arm.missing.services.excludes", matches = "true", disabledReason = "https://github.com/quarkus-qe/quarkus-test-suite/issues/1145")
@EnabledIfSystemProperty(named = "ts.redhat.registry.enabled", matches = "true")
public class OpenShiftRhSsoAuthzSecurityReactiveIT extends BaseAuthzSecurityReactiveIT {

static final int KEYCLOAK_PORT = 8080;

@Container(image = "${rhsso.image}", expectedLog = "Http management interface listening", port = KEYCLOAK_PORT)
static KeycloakService keycloak = new KeycloakService(REALM_DEFAULT)
.withProperty("SSO_IMPORT_FILE", "resource::/keycloak-realm.json");
@KeycloakContainer(command = { "start-dev", "--import-realm" }, image = "${rhbk.image}")
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH);

@QuarkusApplication
static RestService app = new RestService()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.quarkus.ts.security.keycloak.jwt;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.junit.jupiter.api.Assertions.assertTrue;
Expand All @@ -22,10 +23,9 @@

public abstract class BaseOidcJwtSecurityIT {

protected static final String REALM_DEFAULT = "test-realm";
protected static final String CLIENT_ID_DEFAULT = "test-application-client";

private static final String LOGIN_REALM_REGEXP = ".*(Sign|Log) in to " + REALM_DEFAULT + ".*";
private static final String LOGIN_REALM_REGEXP = ".*(Sign|Log) in to " + DEFAULT_REALM + ".*";

private WebClient webClient;
private HtmlPage page;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
package io.quarkus.ts.security.keycloak.jwt;

import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_BASE_PATH;
import static io.quarkus.test.bootstrap.KeycloakService.DEFAULT_REALM_FILE;

import org.junit.jupiter.api.Tag;

import io.quarkus.test.bootstrap.KeycloakService;
Expand All @@ -13,8 +17,8 @@
public class KeycloakOidcJwtSecurityIT extends BaseOidcJwtSecurityIT {

//TODO Remove workaround after Keycloak is fixed https://github.com/keycloak/keycloak/issues/9916
@KeycloakContainer(command = { "start-dev --import-realm --hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService("/keycloak-realm.json", REALM_DEFAULT, "/realms")
@KeycloakContainer(command = { "start-dev", "--import-realm", "--hostname-strict=false" })
static KeycloakService keycloak = new KeycloakService(DEFAULT_REALM_FILE, DEFAULT_REALM, DEFAULT_REALM_BASE_PATH)
.withProperty("JAVA_OPTS", "-Dcom.redhat.fips=false");

@QuarkusApplication
Expand Down
Loading

0 comments on commit f6cbb3b

Please sign in to comment.