From ea95905287bf3ef53cf15f4b6c5829567875bed8 Mon Sep 17 00:00:00 2001 From: ting-lan-wang Date: Fri, 6 Dec 2024 22:34:14 -0500 Subject: [PATCH] Update the code using the latest driver. Use JDK 17 in the root project. Fix incorrect version numbers in pom.xml. Merge the changes from origin/main. --- ojdbc-provider-azure/pom.xml | 1 - .../configuration/AzureVaultJsonProvider.java | 4 +- .../OciDatabaseToolsConnectionProvider.java | 10 +- .../configuration/OciVaultJsonProvider.java | 12 +- .../configuration/OciVaultSecretProvider.java | 8 +- .../oci/resource/VaultPasswordProvider.java | 5 +- .../oci/resource/VaultUsernameProvider.java | 3 - .../jdbc/provider/oci/vault/Secret.java | 68 +++++++- .../jdbc/provider/oci/vault/SecretBundle.java | 113 ------------ .../oci/vault/SecretBundleFactory.java | 161 ------------------ ojdbc-provider-opentelemetry/pom.xml | 2 - ojdbc-provider-pkl/pom.xml | 34 +--- .../pkl/configuration/parser/YamlParser.java | 2 +- ojdbc-provider-samples/pom.xml | 12 +- pom.xml | 12 +- 15 files changed, 90 insertions(+), 357 deletions(-) delete mode 100644 ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundle.java delete mode 100644 ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundleFactory.java diff --git a/ojdbc-provider-azure/pom.xml b/ojdbc-provider-azure/pom.xml index 3d90e64b..dad76aa9 100644 --- a/ojdbc-provider-azure/pom.xml +++ b/ojdbc-provider-azure/pom.xml @@ -16,7 +16,6 @@ 1.8 1.8 - UTF-8 diff --git a/ojdbc-provider-azure/src/main/java/oracle/jdbc/provider/azure/configuration/AzureVaultJsonProvider.java b/ojdbc-provider-azure/src/main/java/oracle/jdbc/provider/azure/configuration/AzureVaultJsonProvider.java index 80b05acf..0ae90265 100644 --- a/ojdbc-provider-azure/src/main/java/oracle/jdbc/provider/azure/configuration/AzureVaultJsonProvider.java +++ b/ojdbc-provider-azure/src/main/java/oracle/jdbc/provider/azure/configuration/AzureVaultJsonProvider.java @@ -38,13 +38,12 @@ package oracle.jdbc.provider.azure.configuration; -import com.azure.security.keyvault.secrets.models.KeyVaultSecret; import oracle.jdbc.driver.configuration.OracleConfigurationParsableProvider; import oracle.jdbc.provider.azure.keyvault.KeyVaultSecretFactory; import oracle.jdbc.provider.parameter.Parameter; import oracle.jdbc.provider.parameter.ParameterSet; -import oracle.jdbc.util.OracleConfigurationCache; import oracle.jdbc.provider.parameter.ParameterSetParser; +import oracle.jdbc.util.OracleConfigurationCache; import java.io.ByteArrayInputStream; import java.io.InputStream; @@ -56,6 +55,7 @@ * See {@link #getInputStream(String)} for the spec of the JSON payload. */ public class AzureVaultJsonProvider extends OracleConfigurationParsableProvider { + private static final OracleConfigurationCache CACHE = OracleConfigurationCache.create(100); /** diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciDatabaseToolsConnectionProvider.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciDatabaseToolsConnectionProvider.java index 65a67b87..b64dcb56 100644 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciDatabaseToolsConnectionProvider.java +++ b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciDatabaseToolsConnectionProvider.java @@ -2,6 +2,8 @@ import com.oracle.bmc.databasetools.model.DatabaseToolsConnection; import com.oracle.bmc.databasetools.model.DatabaseToolsConnectionOracleDatabase; +import com.oracle.bmc.databasetools.model.DatabaseToolsConnectionOracleDatabaseProxyClient; +import com.oracle.bmc.databasetools.model.DatabaseToolsConnectionOracleDatabaseProxyClientUserName; import com.oracle.bmc.databasetools.model.DatabaseToolsKeyStore; import com.oracle.bmc.databasetools.model.DatabaseToolsKeyStoreContent; import com.oracle.bmc.databasetools.model.DatabaseToolsKeyStoreContentSecretId; @@ -10,14 +12,11 @@ import com.oracle.bmc.databasetools.model.DatabaseToolsUserPassword; import com.oracle.bmc.databasetools.model.DatabaseToolsUserPasswordSecretId; import com.oracle.bmc.databasetools.model.LifecycleState; -import com.oracle.bmc.databasetools.model.DatabaseToolsConnectionOracleDatabaseProxyClient; -import com.oracle.bmc.databasetools.model.DatabaseToolsConnectionOracleDatabaseProxyClientUserName; import com.oracle.bmc.model.BmcException; import oracle.jdbc.OracleConnection; -import oracle.jdbc.provider.oci.OciResourceParameter; import oracle.jdbc.provider.oci.databasetools.DatabaseToolsConnectionFactory; -import oracle.jdbc.provider.oci.vault.SecretBundle; -import oracle.jdbc.provider.oci.vault.SecretBundleFactory; +import oracle.jdbc.provider.oci.vault.Secret; +import oracle.jdbc.provider.oci.vault.SecretFactory; import oracle.jdbc.provider.parameter.ParameterSet; import oracle.jdbc.spi.OracleConfigurationCachableProvider; import oracle.jdbc.spi.OracleConfigurationProvider; @@ -29,7 +28,6 @@ import java.util.Map; import java.util.Objects; import java.util.Properties; -import java.util.Set; /** *

diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultJsonProvider.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultJsonProvider.java index 81df1906..0055e18a 100644 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultJsonProvider.java +++ b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultJsonProvider.java @@ -1,7 +1,6 @@ package oracle.jdbc.provider.oci.configuration; import oracle.jdbc.driver.configuration.OracleConfigurationParsableProvider; -import oracle.jdbc.provider.oci.vault.SecretBundleFactory; import oracle.jdbc.provider.oci.vault.SecretFactory; import oracle.jdbc.provider.parameter.ParameterSet; import oracle.jdbc.util.OracleConfigurationCache; @@ -12,15 +11,12 @@ import java.util.HashMap; import java.util.Map; -import static java.util.Objects.requireNonNull; - /** * A provider for JSON payload which contains configuration from OCI Vault. * See {@link #getInputStream(String)} for the spec of the JSON payload. **/ public class OciVaultJsonProvider extends OracleConfigurationParsableProvider { - private String secretName; private static final OracleConfigurationCache CACHE = OracleConfigurationCache.create(100); /** @@ -45,14 +41,8 @@ public InputStream getInputStream(String secretOcid) { OciConfigurationParameters.getParser() .parseNamedValues(optionsWithOcid); - // Get secret name - secretName = SecretFactory.getInstance() - .request(parameters) - .getContent() - .getName(); - // Get secret contents - String secretContent = SecretBundleFactory.getInstance() + String secretContent = SecretFactory.getInstance() .request(parameters) .getContent() .getBase64Secret(); diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultSecretProvider.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultSecretProvider.java index ab190214..3ff2e0fa 100644 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultSecretProvider.java +++ b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/configuration/OciVaultSecretProvider.java @@ -38,8 +38,8 @@ package oracle.jdbc.provider.oci.configuration; -import oracle.jdbc.provider.oci.vault.SecretBundle; -import oracle.jdbc.provider.oci.vault.SecretBundleFactory; +import oracle.jdbc.provider.oci.vault.Secret; +import oracle.jdbc.provider.oci.vault.SecretFactory; import oracle.jdbc.provider.parameter.ParameterSet; import oracle.jdbc.spi.OracleConfigurationSecretProvider; @@ -67,7 +67,7 @@ public final class OciVaultSecretProvider * } * } * - * @param secretJsonObject json object to be parsed + * @param secretMap A map object to be parsed * @return encoded char array in base64 format that represents the retrieved * Secret. */ @@ -77,7 +77,7 @@ public char[] getSecret(Map secretMap) { OciConfigurationParameters.getParser() .parseNamedValues(secretMap); - SecretBundle secretBundle = SecretBundleFactory.getInstance() + Secret secretBundle = SecretFactory.getInstance() .request(parameters) .getContent(); diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultPasswordProvider.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultPasswordProvider.java index 78268e3e..99098d12 100644 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultPasswordProvider.java +++ b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultPasswordProvider.java @@ -38,14 +38,13 @@ package oracle.jdbc.provider.oci.resource; -import oracle.jdbc.provider.oci.OciResourceParameter; -import oracle.jdbc.provider.oci.vault.SecretBundleFactory; -import oracle.jdbc.provider.parameter.ParameterSet; import oracle.jdbc.provider.resource.ResourceParameter; import oracle.jdbc.spi.PasswordProvider; import java.util.Map; +import static oracle.jdbc.provider.oci.vault.SecretFactory.OCID; + /** *

* A provider of passwords from the OCI Vault service. diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultUsernameProvider.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultUsernameProvider.java index bfe8d265..cb527762 100644 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultUsernameProvider.java +++ b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/resource/VaultUsernameProvider.java @@ -38,9 +38,6 @@ package oracle.jdbc.provider.oci.resource; import oracle.jdbc.provider.oci.vault.Secret; -import oracle.jdbc.provider.oci.OciResourceParameter; -import oracle.jdbc.provider.oci.vault.SecretBundleFactory; -import oracle.jdbc.provider.parameter.ParameterSet; import oracle.jdbc.provider.resource.ResourceParameter; import oracle.jdbc.spi.UsernameProvider; diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/Secret.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/Secret.java index cba18bfd..88a87602 100644 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/Secret.java +++ b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/Secret.java @@ -38,25 +38,77 @@ package oracle.jdbc.provider.oci.vault; +import com.oracle.bmc.secrets.model.Base64SecretBundleContentDetails; +import com.oracle.bmc.secrets.model.SecretBundle; +import com.oracle.bmc.secrets.model.SecretBundleContentDetails; + +import java.nio.ByteBuffer; +import java.nio.CharBuffer; +import java.util.Arrays; +import java.util.Base64; + +import static java.nio.charset.StandardCharsets.UTF_8; + /** * A secret managed by the OCI Vault service. */ public final class Secret { - private final String name; + private final String base64Secret; - private Secret(String name) { - this.name = name; + private Secret(String base64Secret) { + this.base64Secret = base64Secret; } - static Secret fromSecret(com.oracle.bmc.vault.model.Secret secret) { - return new Secret(secret.getSecretName()); + static Secret fromSecretBundle(SecretBundle secretBundle) { + + SecretBundleContentDetails secretBundleContentDetails = + secretBundle.getSecretBundleContent(); + + if (secretBundleContentDetails instanceof + Base64SecretBundleContentDetails) { + + String base64Secret = + ((Base64SecretBundleContentDetails)secretBundleContentDetails) + .getContent(); + + return new Secret(base64Secret); + } + else { + throw new IllegalStateException( + "Unsupported content type: " + secretBundleContentDetails.getClass()); + } + } + + /** + * Returns the secret decoded as UTF-8 characters. The {@code char[]} returned + * by this method is not retained: It's contents may be wiped from memory + * after it has been consumed. + * @return Characters representing the UTF-8 decoding of the secret. Not null. + */ + public char[] toCharArray() { + byte[] contentBytes = Base64.getDecoder().decode(base64Secret); + try { + CharBuffer contentBuffer = UTF_8.decode(ByteBuffer.wrap(contentBytes)); + char[] contentChars = new char[contentBuffer.remaining()]; + try { + contentBuffer.get(contentChars); + return contentChars; + } + finally { + contentBuffer.clear(); + contentBuffer.put(new char[contentBuffer.capacity()]); + } + } + finally { + Arrays.fill(contentBytes, (byte)0); + } } /** - * @return String that represents name of the Secret + * @return String that represents the Secret in base64 format */ - public String getName() { - return name; + public String getBase64Secret() { + return base64Secret; } } diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundle.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundle.java deleted file mode 100644 index 588dd07e..00000000 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundle.java +++ /dev/null @@ -1,113 +0,0 @@ -/* - ** Copyright (c) 2023 Oracle and/or its affiliates. - ** - ** The Universal Permissive License (UPL), Version 1.0 - ** - ** Subject to the condition set forth below, permission is hereby granted to any - ** person obtaining a copy of this software, associated documentation and/or data - ** (collectively the "Software"), free of charge and under any and all copyright - ** rights in the Software, and any and all patent rights owned or freely - ** licensable by each licensor hereunder covering either (i) the unmodified - ** Software as contributed to or provided by such licensor, or (ii) the Larger - ** Works (as defined below), to deal in both - ** - ** (a) the Software, and - ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if - ** one is included with the Software (each a "Larger Work" to which the Software - ** is contributed by such licensors), - ** - ** without restriction, including without limitation the rights to copy, create - ** derivative works of, display, perform, and distribute the Software and make, - ** use, sell, offer for sale, import, export, have made, and have sold the - ** Software and the Larger Work(s), and to sublicense the foregoing rights on - ** either these or other terms. - ** - ** This license is subject to the following condition: - ** The above copyright notice and either this complete permission notice or at - ** a minimum a reference to the UPL must be included in all copies or - ** substantial portions of the Software. - ** - ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - ** SOFTWARE. - */ - -package oracle.jdbc.provider.oci.vault; - -import com.oracle.bmc.secrets.model.Base64SecretBundleContentDetails; -import com.oracle.bmc.secrets.model.SecretBundleContentDetails; - -import java.nio.ByteBuffer; -import java.nio.CharBuffer; -import java.util.Arrays; -import java.util.Base64; - -import static java.nio.charset.StandardCharsets.UTF_8; - -/** - * A secret managed by the OCI Vault service. - */ -public final class SecretBundle { - - private final String base64Secret; - - private SecretBundle(String base64Secret) { - this.base64Secret = base64Secret; - } - - static SecretBundle fromSecretBundle(com.oracle.bmc.secrets.model.SecretBundle secretBundle) { - - SecretBundleContentDetails secretBundleContentDetails = - secretBundle.getSecretBundleContent(); - - if (secretBundleContentDetails instanceof - Base64SecretBundleContentDetails) { - - String base64Secret = - ((Base64SecretBundleContentDetails)secretBundleContentDetails) - .getContent(); - - return new SecretBundle(base64Secret); - } - else { - throw new IllegalStateException( - "Unsupported content type: " + secretBundleContentDetails.getClass()); - } - } - - /** - * Returns the secret decoded as UTF-8 characters. The {@code char[]} returned - * by this method is not retained: It's contents may be wiped from memory - * after it has been consumed. - * @return Characters representing the UTF-8 decoding of the secret. Not null. - */ - public char[] toCharArray() { - byte[] contentBytes = Base64.getDecoder().decode(base64Secret); - try { - CharBuffer contentBuffer = UTF_8.decode(ByteBuffer.wrap(contentBytes)); - char[] contentChars = new char[contentBuffer.remaining()]; - try { - contentBuffer.get(contentChars); - return contentChars; - } - finally { - contentBuffer.clear(); - contentBuffer.put(new char[contentBuffer.capacity()]); - } - } - finally { - Arrays.fill(contentBytes, (byte)0); - } - } - - /** - * @return String that represents the Secret in base64 format - */ - public String getBase64Secret() { - return base64Secret; - } -} diff --git a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundleFactory.java b/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundleFactory.java deleted file mode 100644 index deeb96fa..00000000 --- a/ojdbc-provider-oci/src/main/java/oracle/jdbc/provider/oci/vault/SecretBundleFactory.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - ** Copyright (c) 2023 Oracle and/or its affiliates. - ** - ** The Universal Permissive License (UPL), Version 1.0 - ** - ** Subject to the condition set forth below, permission is hereby granted to any - ** person obtaining a copy of this software, associated documentation and/or data - ** (collectively the "Software"), free of charge and under any and all copyright - ** rights in the Software, and any and all patent rights owned or freely - ** licensable by each licensor hereunder covering either (i) the unmodified - ** Software as contributed to or provided by such licensor, or (ii) the Larger - ** Works (as defined below), to deal in both - ** - ** (a) the Software, and - ** (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if - ** one is included with the Software (each a "Larger Work" to which the Software - ** is contributed by such licensors), - ** - ** without restriction, including without limitation the rights to copy, create - ** derivative works of, display, perform, and distribute the Software and make, - ** use, sell, offer for sale, import, export, have made, and have sold the - ** Software and the Larger Work(s), and to sublicense the foregoing rights on - ** either these or other terms. - ** - ** This license is subject to the following condition: - ** The above copyright notice and either this complete permission notice or at - ** a minimum a reference to the UPL must be included in all copies or - ** substantial portions of the Software. - ** - ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - ** IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - ** FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - ** AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - ** LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - ** OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - ** SOFTWARE. - */ - -package oracle.jdbc.provider.oci.vault; - -import com.oracle.bmc.Region; -import com.oracle.bmc.auth.AbstractAuthenticationDetailsProvider; -import com.oracle.bmc.secrets.SecretsClient; -import com.oracle.bmc.secrets.requests.GetSecretBundleRequest; -import oracle.jdbc.provider.cache.CachedResourceFactory; -import oracle.jdbc.provider.factory.ResourceFactory; -import oracle.jdbc.provider.oci.OciResourceFactory; -import oracle.jdbc.provider.oci.OciResourceParameter; -import oracle.jdbc.provider.oci.Ocid; -import oracle.jdbc.provider.parameter.ParameterSet; -import oracle.jdbc.provider.factory.Resource; - -import java.time.OffsetDateTime; -import java.time.ZoneOffset; -import java.util.Date; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - *

- * Factory for requesting secrets from the Vault service. Secrets are - * represented as {@link SecretBundle} objects. Oracle JDBC can use the content of - * a secret as a database password, or any other security sensitive value. - *

- */ -public final class SecretBundleFactory extends OciResourceFactory { - - private static final ResourceFactory INSTANCE = - CachedResourceFactory.create(new SecretBundleFactory()); - - private SecretBundleFactory() { } - - /** - * Returns a singleton of {@code SecretFactory}. - * @return a singleton of {@code SecretFactory} - */ - public static ResourceFactory getInstance() { - return INSTANCE; - } - - /** - * {@inheritDoc} - *

- * Requests the content of a secret bundle from the Vault service. The - * {@code parameterSet} is required to include an {@link OciResourceParameter#OCID}. - *

- */ - @Override - protected Resource request( - AbstractAuthenticationDetailsProvider authenticationDetails, - ParameterSet parameterSet) { - - String secretOcid = parameterSet.getRequired(OciResourceParameter.OCID); - Ocid ocid = new Ocid(secretOcid); - - // Ensure parsed region is not null to prevent failure in sending request - if (ocid.getRegion() == null) { - throw new IllegalStateException( - "Region is missing in Secret OCID: " - + ocid.getContent()); - } - - com.oracle.bmc.secrets.model.SecretBundle secretBundle = requestSecret(authenticationDetails, ocid); - - SecretBundle secret = SecretBundle.fromSecretBundle(secretBundle); - Date expireTimeDate = secretBundle.getTimeOfExpiry(); - - if (expireTimeDate == null) { - return Resource.createPermanentResource(secret, true); - } - else { - OffsetDateTime expireTime = - expireTimeDate.toInstant().atOffset(ZoneOffset.UTC); - - return Resource.createExpiringResource(secret, expireTime, true); - } - } - - /** Requests a secret from the OCI Vault service. */ - private com.oracle.bmc.secrets.model.SecretBundle requestSecret( - AbstractAuthenticationDetailsProvider authenticationDetails, - Ocid ocid) { - - try (SecretsClient client = - SecretsClient.builder() - .region(ocid.getRegion()) - .build(authenticationDetails)) { - - GetSecretBundleRequest request = - GetSecretBundleRequest.builder() - .secretId(ocid.getContent()) - .stage(GetSecretBundleRequest.Stage.Current) - .build(); - - return client.getSecretBundle(request) - .getSecretBundle(); - } - } - - /** - * Returns a {@link Region} which is parsed from the provided {@code ocid}. - * The format of Oracle Cloud ID (OCID) is documented as follows: - *
-   *   ocid1...[REGION][.FUTURE USE].
-   * 
- * @see Resource Identifiers - * @param ocid OCID of the regional resource - * @return an {@code Region} which is extracted from the {@code ocid} - */ - private Region parseRegion(String ocid) { - String regex = "ocid1\\.[^.]+\\.[^.]+\\.([^.]+)\\..+"; - Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(ocid); - if (matcher.matches()) { - return Region.fromRegionCode(matcher.group(1)); - } - throw new IllegalStateException( - "Fail to parse region from the Secret OCID: " + ocid); - } - -} diff --git a/ojdbc-provider-opentelemetry/pom.xml b/ojdbc-provider-opentelemetry/pom.xml index 01affe12..9f263956 100644 --- a/ojdbc-provider-opentelemetry/pom.xml +++ b/ojdbc-provider-opentelemetry/pom.xml @@ -16,10 +16,8 @@ 1.42.1 - 1.40.0 1.8 1.8 - 1.29.0 diff --git a/ojdbc-provider-pkl/pom.xml b/ojdbc-provider-pkl/pom.xml index 04089c3c..97fd3a6f 100644 --- a/ojdbc-provider-pkl/pom.xml +++ b/ojdbc-provider-pkl/pom.xml @@ -1,23 +1,22 @@ - - 4.0.0 Oracle JDBC Providers Pkl Module ojdbc-provider-pkl - 1.0.1 jar com.oracle.database.jdbc ojdbc-extensions - 1.0.1 + ${extensions-version} 0.27.0 + 17 + 17 @@ -52,16 +51,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - 3.12.1 - - 11 - 11 - - - org.apache.maven.plugins maven-jar-plugin @@ -80,7 +69,6 @@ - @@ -108,20 +96,6 @@ - - maven-clean-plugin - 3.3.2 - - - - ${maven.multiModuleProjectDirectory}/ojdbc-provider-pkl/src/main/java/oracle/jdbc/provider/configuration/generated - - *.java - - - - - diff --git a/ojdbc-provider-pkl/src/main/java/oracle/jdbc/provider/pkl/configuration/parser/YamlParser.java b/ojdbc-provider-pkl/src/main/java/oracle/jdbc/provider/pkl/configuration/parser/YamlParser.java index f9ed6009..18fe39a9 100644 --- a/ojdbc-provider-pkl/src/main/java/oracle/jdbc/provider/pkl/configuration/parser/YamlParser.java +++ b/ojdbc-provider-pkl/src/main/java/oracle/jdbc/provider/pkl/configuration/parser/YamlParser.java @@ -27,7 +27,7 @@ public class YamlParser implements OracleConfigurationParser { @Override - public Properties readProperties( + public Properties parse( InputStream inputStream, Map options) throws SQLException { Properties properties = new Properties(); diff --git a/ojdbc-provider-samples/pom.xml b/ojdbc-provider-samples/pom.xml index 2c12f596..b3467a2a 100644 --- a/ojdbc-provider-samples/pom.xml +++ b/ojdbc-provider-samples/pom.xml @@ -14,6 +14,11 @@ ${extensions-version} + + 1.8 + 1.8 + + com.oracle.database.jdbc @@ -25,15 +30,10 @@ ojdbc-provider-oci ${project.parent.version} - - com.oracle.database.jdbc - ojdbc-provider-gcp - ${project.parent.version} - com.oracle.database.jdbc ojdbc-provider-pkl - 1.0.1 + ${project.parent.version} com.oracle.database.security diff --git a/pom.xml b/pom.xml index 510f61a7..57826eef 100644 --- a/pom.xml +++ b/pom.xml @@ -30,8 +30,8 @@ - 11 - 11 + 17 + 17 23.6.0.24.10 5.9.0 4.11.0 @@ -51,7 +51,7 @@ [9,) - 11 + 17 @@ -63,7 +63,6 @@ ojdbc-provider-samples ojdbc-provider-opentelemetry ojdbc-provider-pkl - ojdbc-provider-gcp @@ -76,7 +75,8 @@ com.oracle.database.jdbc ojdbc8 - ${jdbc.version} + + 26.1.0.24.00.241202 com.oracle.database.security @@ -116,7 +116,7 @@ org.apache.maven.plugins maven-compiler-plugin - 3.11.0 + 3.12.1 org.apache.maven.plugins