From 6ca78b75540317a6ca3e49ace5bfa6cd92f3ded6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Barto=C5=A1?= Date: Wed, 6 Sep 2023 11:43:18 +0200 Subject: [PATCH] Return Oracle JDBC driver to the upstream Closes #22999 --- .../release_notes/topics/23_0_0.adoc | 6 -- .../topics/keycloak/changes-23_0_0.adoc | 6 -- docs/guides/server/db.adoc | 5 ++ quarkus/runtime/pom.xml | 34 +++++++--- .../it/cli/dist/BuildCommandDistTest.java | 11 ++- .../servers/auth-server/quarkus/pom.xml | 67 ++++++++++++------- 6 files changed, 80 insertions(+), 49 deletions(-) diff --git a/docs/documentation/release_notes/topics/23_0_0.adoc b/docs/documentation/release_notes/topics/23_0_0.adoc index c696877418f..2b4290db383 100644 --- a/docs/documentation/release_notes/topics/23_0_0.adoc +++ b/docs/documentation/release_notes/topics/23_0_0.adoc @@ -13,9 +13,3 @@ the latest FAPI 2 draft specifications when communicating with your clients. Tha Keycloak has preview for support for OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer (DPoP). Thanks to https://github.com/tnorimat[Takashi Norimatsu] and https://github.com/dteleguin[Dmitry Telegin] for their contributions. - -= Oracle Database driver not part of the distribution - -The Oracle Database JDBC driver is no longer part of the Keycloak distribution. -Administrators will need to install a version of the Oracle Driver matching their environment -as described in the configuring the database {section}. diff --git a/docs/documentation/upgrading/topics/keycloak/changes-23_0_0.adoc b/docs/documentation/upgrading/topics/keycloak/changes-23_0_0.adoc index 28615dfa9da..0768e7247cd 100644 --- a/docs/documentation/upgrading/topics/keycloak/changes-23_0_0.adoc +++ b/docs/documentation/upgrading/topics/keycloak/changes-23_0_0.adoc @@ -30,12 +30,6 @@ Previous versions of Keycloak supported specifying the encoding in the first lin Message properties files for themes are now read in UTF-8 encoding, with an automatic fallback to ISO-8859-1 encoding. If you are using a different encoding, convert the files to UTF-8. -= Oracle Database driver not part of the distribution - -The Oracle Database JDBC driver is no longer part of the Keycloak distribution. -Administrators will need to install a version of the Oracle Driver matching their environment -as described in the configuring the database {section}. - = Changes to the value format of claims mapped by the realm and client role mappers Before this release, both realm (`User Realm Role`) and client (`User Client Role`) protocol mappers diff --git a/docs/guides/server/db.adoc b/docs/guides/server/db.adoc index 31b42fe9ff2..426727f168f 100644 --- a/docs/guides/server/db.adoc +++ b/docs/guides/server/db.adoc @@ -2,6 +2,7 @@ <#import "/templates/kc.adoc" as kc> <#import "/templates/options.adoc" as opts> <#import "/templates/links.adoc" as links> +<#import "/templates/profile.adoc" as profile> <@tmpl.guide title="Configuring the database" @@ -28,6 +29,8 @@ The server has built-in support for different databases. You can query the avail By default, the server uses the `dev-file` database. This is the default database that the server will use to persist data and only exists for development use-cases. The `dev-file` database is not suitable for production use-cases, and must be replaced before deploying to production. +<@profile.ifProduct> + == Installing a database driver (Oracle) Database drivers are shipped as part of Keycloak except for the Oracle Database driver which needs to be installed separately. @@ -68,6 +71,8 @@ See the <@links.server id="containers" /> {section} for details on how to build Then continue configuring the database as described in the next section. + + == Configuring a database For each supported database, the server provides some opinionated defaults to simplify database configuration. You complete the configuration by providing some key settings such as the database host and credentials. diff --git a/quarkus/runtime/pom.xml b/quarkus/runtime/pom.xml index 67e37d2b765..3762f7ac728 100644 --- a/quarkus/runtime/pom.xml +++ b/quarkus/runtime/pom.xml @@ -78,16 +78,6 @@ io.quarkus quarkus-jdbc-oracle - - - com.oracle.database.jdbc - ojdbc11 - - - com.oracle.database.nls - orai18n - - io.quarkus @@ -734,6 +724,30 @@ + + product + + + product + + + + + io.quarkus + quarkus-jdbc-oracle + + + com.oracle.database.jdbc + ojdbc11 + + + com.oracle.database.nls + orai18n + + + + + includeGelf diff --git a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java index 43b52ffb69c..2664a1e550f 100644 --- a/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java +++ b/quarkus/tests/integration/src/test/java/org/keycloak/it/cli/dist/BuildCommandDistTest.java @@ -85,8 +85,15 @@ class BuildCommandDistTest { CLIResult cliResult = (CLIResult) result; String dbDriver = Database.getDriver("oracle", true).orElse(""); + String errorMessage = String.format("ERROR: Unable to find the JDBC driver (%s). You need to install it.", dbDriver); - cliResult.assertError(String.format("ERROR: Unable to find the JDBC driver (%s). You need to install it.", dbDriver)); - cliResult.assertNoBuild(); + boolean isProduct = System.getProperty("product") != null; + if (isProduct) { + cliResult.assertError(errorMessage); + cliResult.assertNoBuild(); + } else { + cliResult.assertNoMessage(errorMessage); + cliResult.assertBuild(); + } } } diff --git a/testsuite/integration-arquillian/servers/auth-server/quarkus/pom.xml b/testsuite/integration-arquillian/servers/auth-server/quarkus/pom.xml index 50acd8eb5c4..f43d394f56e 100644 --- a/testsuite/integration-arquillian/servers/auth-server/quarkus/pom.xml +++ b/testsuite/integration-arquillian/servers/auth-server/quarkus/pom.xml @@ -186,31 +186,6 @@ - - includeProprietaryDependencies - generate-resources - - copy - - - - - com.oracle.database.jdbc - ojdbc11 - ${oracle-jdbc.version} - jar - ${auth.server.home}/providers - - - com.oracle.database.nls - orai18n - ${oracle-jdbc.version} - jar - ${auth.server.home}/providers - - - - copy-testsuite-providers generate-resources @@ -363,5 +338,47 @@ + + product + + + product + + + + + + maven-dependency-plugin + + + includeProprietaryDependencies + generate-resources + + copy + + + + + com.oracle.database.jdbc + ojdbc11 + ${oracle-jdbc.version} + jar + ${auth.server.home}/providers + + + com.oracle.database.nls + orai18n + ${oracle-jdbc.version} + jar + ${auth.server.home}/providers + + + + + + + + +