[java-identity-provider] branch main updated: Make Truststore API
Rod Widdowson
rdw at steadingsoftware.com
Sat Jun 28 13:08:29 UTC 2025
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch main
in repository java-identity-provider.
View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=759438d9ddc2749847dc9de5823fda644d9d969d
The following commit(s) were added to refs/heads/main by this push:
new 759438d9d Make Truststore API
759438d9d is described below
commit 759438d9ddc2749847dc9de5823fda644d9d969d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Jun 28 14:01:00 2025 +0100
Make Truststore API
This allows the plugins (inter alia) to use it.
---
.../idp/installer/{plugin/impl => }/TrustStore.java | 20 ++++++++++----------
.../shibboleth/idp/installer/impl/UpdateIdPCLI.java | 4 ++--
.../idp/installer/plugin/impl/PluginInstaller.java | 3 ++-
.../idp/installer/plugin/impl/TrustStoreTest.java | 3 ++-
4 files changed, 16 insertions(+), 14 deletions(-)
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/TrustStore.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/TrustStore.java
similarity index 96%
rename from idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/TrustStore.java
rename to idp-installer/src/main/java/net/shibboleth/idp/installer/TrustStore.java
index 516289b96..3e55822fd 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/TrustStore.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/TrustStore.java
@@ -12,7 +12,7 @@
* limitations under the License.
*/
-package net.shibboleth.idp.installer.plugin.impl;
+package net.shibboleth.idp.installer;
import java.io.IOException;
import java.io.InputStream;
@@ -43,7 +43,6 @@ import org.bouncycastle.openpgp.operator.jcajce.JcaPGPContentVerifierBuilderProv
import org.bouncycastle.util.encoders.Hex;
import org.slf4j.Logger;
-import net.shibboleth.idp.installer.InstallerSupport;
import net.shibboleth.shared.annotation.constraint.NonnullAfterInit;
import net.shibboleth.shared.collection.CollectionSupport;
import net.shibboleth.shared.component.AbstractInitializableComponent;
@@ -66,8 +65,8 @@ import net.shibboleth.shared.primitive.LoggerFactory;
/** Explicit path to trust store. */
@NonnullAfterInit private String explicitTrustStore;
- /** The plugin this is the trust store for. */
- @NonnullAfterInit private String pluginId;
+ /** The plugin this is the trust store for. NULL of this is general purpose usage. */
+ @Nullable private String pluginId;
/** The key store. */
@NonnullAfterInit private Path store;
@@ -292,10 +291,6 @@ import net.shibboleth.shared.primitive.LoggerFactory;
protected void doInitialize() throws ComponentInitializationException {
super.doInitialize();
- if (pluginId == null) {
- throw new ComponentInitializationException("Plugin Id not set up");
- }
-
if (explicitTrustStore != null) {
store = InstallerSupport.pathOf(explicitTrustStore);
if (!Files.exists(store)) {
@@ -303,14 +298,19 @@ import net.shibboleth.shared.primitive.LoggerFactory;
throw new ComponentInitializationException("Supplied trust store does not exist.");
}
backup = InstallerSupport.pathOf(explicitTrustStore + ".backup");
- log.debug("Plugin {}: Loading explicit truststore {}", pluginId, explicitTrustStore);
+ log.debug("Loading explicit truststore {}", explicitTrustStore);
+
try {
loadStore();
} catch (final IOException e) {
- log.error("Plugin {}: Could not load explicit trust store {}", pluginId, explicitTrustStore, e);
+ log.error("Could not load explicit trust store {}", explicitTrustStore, e);
throw new ComponentInitializationException(e);
}
} else {
+ if (pluginId == null) {
+ throw new ComponentInitializationException("Plugin Id not set up");
+ }
+
if (idpHome == null) {
throw new ComponentInitializationException("IdP home not set up");
}
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPCLI.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPCLI.java
index b5910a339..29c5b542b 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPCLI.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/impl/UpdateIdPCLI.java
@@ -42,9 +42,9 @@ import net.shibboleth.idp.Version;
import net.shibboleth.idp.admin.impl.IdPInfo;
import net.shibboleth.idp.cli.AbstractIdPHomeAwareCommandLine;
import net.shibboleth.idp.installer.InstallerSupport;
+import net.shibboleth.idp.installer.TrustStore;
+import net.shibboleth.idp.installer.TrustStore.Signature;
import net.shibboleth.idp.installer.impl.UpdateIdPArguments.OperationType;
-import net.shibboleth.idp.installer.plugin.impl.TrustStore;
-import net.shibboleth.idp.installer.plugin.impl.TrustStore.Signature;
import net.shibboleth.profile.installablecomponent.InstallableComponentInfo;
import net.shibboleth.profile.installablecomponent.InstallableComponentSupport;
import net.shibboleth.profile.installablecomponent.InstallableComponentVersion;
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
index f6981b502..6be1dad08 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstaller.java
@@ -65,8 +65,9 @@ import org.slf4j.Logger;
import net.shibboleth.idp.Version;
import net.shibboleth.idp.installer.InstallerSupport;
+import net.shibboleth.idp.installer.TrustStore;
import net.shibboleth.idp.installer.impl.BuildWar;
-import net.shibboleth.idp.installer.plugin.impl.TrustStore.Signature;
+import net.shibboleth.idp.installer.TrustStore.Signature;
import net.shibboleth.idp.module.IdPModule;
import net.shibboleth.idp.plugin.IdPPlugin;
import net.shibboleth.profile.installablecomponent.InstallableComponentVersion;
diff --git a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/TrustStoreTest.java b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/TrustStoreTest.java
index 313280c86..60af69e15 100644
--- a/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/TrustStoreTest.java
+++ b/idp-installer/src/test/java/net/shibboleth/idp/installer/plugin/impl/TrustStoreTest.java
@@ -35,7 +35,8 @@ import org.testng.annotations.AfterMethod;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
-import net.shibboleth.idp.installer.plugin.impl.TrustStore.Signature;
+import net.shibboleth.idp.installer.TrustStore;
+import net.shibboleth.idp.installer.TrustStore.Signature;
import net.shibboleth.shared.annotation.constraint.NonnullBeforeTest;
import net.shibboleth.shared.component.ComponentInitializationException;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list