This is an automated email from the ASF dual-hosted git repository.

ashishvijaywargiya pushed a commit to branch secret-manager
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git


The following commit(s) were added to refs/heads/secret-manager by this push:
     new 50a27b5a72 Revert "Adding support of Secret Manager framework support 
in Apache OFBiz. For various providers support we can add plugins components."
50a27b5a72 is described below

commit 50a27b5a72d5f71cc90c53557966c5e5b72e98d5
Author: Ashish Vijaywargiya <[email protected]>
AuthorDate: Sun Jun 7 18:39:10 2026 +0530

    Revert "Adding support of Secret Manager framework support in Apache OFBiz. 
For various providers support we can add plugins components."
    
    This reverts commit 9e5308193ba2a72d91fce42baf11afbcad6e28dc.
---
 build.gradle                                       |  7 ---
 dependencies.gradle                                |  1 -
 .../ofbiz/base/secret/FileBasedSecretProvider.java | 43 ---------------
 .../apache/ofbiz/base/secret/SecretProvider.java   | 49 -----------------
 .../ofbiz/base/secret/SecretProviderFactory.java   | 63 ----------------------
 .../ofbiz/entity/config/model/EntityConfig.java    | 13 +++--
 .../entity/connection/DBCPConnectionFactory.java   |  5 --
 7 files changed, 6 insertions(+), 175 deletions(-)

diff --git a/build.gradle b/build.gradle
index fbc08af7d0..09c4349187 100644
--- a/build.gradle
+++ b/build.gradle
@@ -168,13 +168,6 @@ tasks.withType(JavaCompile) {
 // Enables Zip larger than 4 GB and more than 65535 entries
 tasks.withType(Zip) { zip64 = true }
 
-// Multiple SecretProvider plugins each contribute the same META-INF/services/ 
filename.
-// Only one provider should be enabled at a time (via ofbiz-component.xml 
enabled="true/false").
-// FIRST keeps the alphabetically first file during transitional states where 
two are temporarily enabled.
-processResources {
-    duplicatesStrategy = DuplicatesStrategy.EXCLUDE
-}
-
 // Only used for release branches
 def getCurrentGitBranch() {
     return "git branch --show-current".execute().text.trim()
diff --git a/dependencies.gradle b/dependencies.gradle
index adf88d33ca..102c3f1251 100644
--- a/dependencies.gradle
+++ b/dependencies.gradle
@@ -98,7 +98,6 @@ dependencies {
     runtimeOnly 'org.apache.axis2:axis2-transport-http:1.8.2'
     runtimeOnly 'org.apache.axis2:axis2-transport-local:1.8.2'
     runtimeOnly 'com.h2database:h2:2.4.240'
-    runtimeOnly 'com.mysql:mysql-connector-j:8.4.0'
     runtimeOnly 'org.apache.geronimo.specs:geronimo-jaxrpc_1.1_spec:2.1'
     runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api:2.25.4' // for 
external jars using the old log4j1.2: routes logging to log4j 2
     runtimeOnly 'org.apache.logging.log4j:log4j-jul:2.25.4' // for external 
jars using the java.util.logging: routes logging to log4j 2
diff --git 
a/framework/base/src/main/java/org/apache/ofbiz/base/secret/FileBasedSecretProvider.java
 
b/framework/base/src/main/java/org/apache/ofbiz/base/secret/FileBasedSecretProvider.java
deleted file mode 100644
index 2879830d5e..0000000000
--- 
a/framework/base/src/main/java/org/apache/ofbiz/base/secret/FileBasedSecretProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- 
*******************************************************************************/
-package org.apache.ofbiz.base.secret;
-
-import org.apache.ofbiz.base.util.GeneralException;
-import org.apache.ofbiz.base.util.UtilProperties;
-import org.apache.ofbiz.base.util.UtilValidate;
-
-/**
- * Default {@link SecretProvider} implementation that resolves secrets from
- * {@code framework/base/config/passwords.properties}.
- *
- * <p>This preserves full backward compatibility with the existing
- * {@code jdbc-password-lookup} mechanism in {@code entityengine.xml}.
- * No configuration is required to use this implementation.</p>
- */
-public final class FileBasedSecretProvider implements SecretProvider {
-
-    @Override
-    public String getSecret(String key) throws GeneralException {
-        String value = UtilProperties.getPropertyValue("passwords", key);
-        if (UtilValidate.isEmpty(value)) {
-            throw new GeneralException("Secret key '" + key + "' not found in 
passwords.properties");
-        }
-        return value;
-    }
-}
diff --git 
a/framework/base/src/main/java/org/apache/ofbiz/base/secret/SecretProvider.java 
b/framework/base/src/main/java/org/apache/ofbiz/base/secret/SecretProvider.java
deleted file mode 100644
index 11b1f86851..0000000000
--- 
a/framework/base/src/main/java/org/apache/ofbiz/base/secret/SecretProvider.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- 
*******************************************************************************/
-package org.apache.ofbiz.base.secret;
-
-import org.apache.ofbiz.base.util.GeneralException;
-
-/**
- * SPI for resolving secrets and credentials (e.g. database passwords, API 
keys).
- *
- * <p>Implementations must be thread-safe. Register a custom implementation via
- * Java's {@link java.util.ServiceLoader} by providing a file named
- * {@code META-INF/services/org.apache.ofbiz.base.secret.SecretProvider} in
- * your plugin JAR containing the fully-qualified class name of your
- * implementation. If no custom implementation is registered,
- * {@link FileBasedSecretProvider} is used as the default, which resolves
- * secrets from {@code framework/base/config/passwords.properties}.</p>
- *
- * <p>Example entry in a vault plugin's service descriptor:</p>
- * <pre>
- *   org.example.ofbiz.vault.AwsSecretsManagerProvider
- * </pre>
- */
-public interface SecretProvider {
-
-    /**
-     * Returns the secret value for the given key.
-     *
-     * @param key the identifier for the secret (e.g. {@code 
"jdbc-password.mydb"})
-     * @return the resolved secret value, never {@code null} or empty
-     * @throws GeneralException if the secret cannot be found or an error 
occurs during resolution
-     */
-    String getSecret(String key) throws GeneralException;
-}
diff --git 
a/framework/base/src/main/java/org/apache/ofbiz/base/secret/SecretProviderFactory.java
 
b/framework/base/src/main/java/org/apache/ofbiz/base/secret/SecretProviderFactory.java
deleted file mode 100644
index 9d8ec088ac..0000000000
--- 
a/framework/base/src/main/java/org/apache/ofbiz/base/secret/SecretProviderFactory.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- 
*******************************************************************************/
-package org.apache.ofbiz.base.secret;
-
-import java.util.Iterator;
-import java.util.ServiceLoader;
-
-import org.apache.ofbiz.base.lang.ThreadSafe;
-import org.apache.ofbiz.base.util.Debug;
-
-/**
- * Factory that provides the active {@link SecretProvider} instance.
- *
- * <p>On first access the factory uses Java's {@link ServiceLoader} to discover
- * a custom {@link SecretProvider} registered in any plugin's
- * {@code META-INF/services/org.apache.ofbiz.base.secret.SecretProvider} file.
- * If none is found, {@link FileBasedSecretProvider} is used automatically,
- * preserving backward compatibility with {@code passwords.properties}.</p>
- *
- * <p>This mirrors the pattern already used by
- * {@link org.apache.ofbiz.security.SecurityFactory}.</p>
- */
-@ThreadSafe
-public final class SecretProviderFactory {
-
-    private static final String MODULE = SecretProviderFactory.class.getName();
-
-    private static final SecretProvider INSTANCE = loadProvider();
-
-    private static SecretProvider loadProvider() {
-        Iterator<SecretProvider> it = 
ServiceLoader.load(SecretProvider.class).iterator();
-        if (it.hasNext()) {
-            SecretProvider provider = it.next();
-            Debug.logInfo("SecretProvider: using custom implementation " + 
provider.getClass().getName(), MODULE);
-            return provider;
-        }
-        Debug.logInfo("SecretProvider: no custom implementation found, using 
FileBasedSecretProvider", MODULE);
-        return new FileBasedSecretProvider();
-    }
-
-    /** Returns the active {@link SecretProvider} instance. */
-    public static SecretProvider getInstance() {
-        return INSTANCE;
-    }
-
-    private SecretProviderFactory() { }
-}
diff --git 
a/framework/entity/src/main/java/org/apache/ofbiz/entity/config/model/EntityConfig.java
 
b/framework/entity/src/main/java/org/apache/ofbiz/entity/config/model/EntityConfig.java
index ff65892e7a..1861e176cf 100644
--- 
a/framework/entity/src/main/java/org/apache/ofbiz/entity/config/model/EntityConfig.java
+++ 
b/framework/entity/src/main/java/org/apache/ofbiz/entity/config/model/EntityConfig.java
@@ -26,9 +26,8 @@ import java.util.List;
 import java.util.Map;
 
 import org.apache.ofbiz.base.lang.ThreadSafe;
-import org.apache.ofbiz.base.secret.SecretProviderFactory;
 import org.apache.ofbiz.base.util.Debug;
-import org.apache.ofbiz.base.util.GeneralException;
+import org.apache.ofbiz.base.util.UtilProperties;
 import org.apache.ofbiz.base.util.UtilURL;
 import org.apache.ofbiz.base.util.UtilXml;
 import org.apache.ofbiz.entity.GenericEntityConfException;
@@ -354,12 +353,12 @@ public final class EntityConfig {
                     + inlineJdbcElement.getLineNumber());
         }
         String key = "jdbc-password.".concat(jdbcPasswordLookup);
-        try {
-            return SecretProviderFactory.getInstance().getSecret(key);
-        } catch (GeneralException e) {
-            throw new GenericEntityConfException("Secret not found for key '" 
+ key + "' for inline-jdbc element, line: "
-                    + inlineJdbcElement.getLineNumber() + " - " + 
e.getMessage());
+        jdbcPassword = UtilProperties.getPropertyValue("passwords", key);
+        if (jdbcPassword.isEmpty()) {
+            throw new GenericEntityConfException("'" + key + "' property not 
found in passwords.properties file for inline-jdbc element, line: "
+                    + inlineJdbcElement.getLineNumber());
         }
+        return jdbcPassword;
     }
 
     /** Returns the <code>&lt;datasource&gt;</code> child elements as a 
<code>Map</code>. */
diff --git 
a/framework/entity/src/main/java/org/apache/ofbiz/entity/connection/DBCPConnectionFactory.java
 
b/framework/entity/src/main/java/org/apache/ofbiz/entity/connection/DBCPConnectionFactory.java
index 98e2759d5b..45ffe2ef11 100644
--- 
a/framework/entity/src/main/java/org/apache/ofbiz/entity/connection/DBCPConnectionFactory.java
+++ 
b/framework/entity/src/main/java/org/apache/ofbiz/entity/connection/DBCPConnectionFactory.java
@@ -152,11 +152,6 @@ public class DBCPConnectionFactory implements 
ConnectionFactory {
 
         GenericObjectPool<PoolableConnection> pool = new 
GenericObjectPool<>(factory, poolConfig);
         factory.setPool(pool);
-        try {
-            pool.preparePool();
-        } catch (Exception e) {
-            Debug.logWarning("Could not pre-warm connection pool: " + 
e.getMessage(), MODULE);
-        }
 
         mds = new DebugManagedDataSource<>(pool, 
xacf.getTransactionRegistry());
         mds.setAccessToUnderlyingConnectionAllowed(true);

Reply via email to