[java-identity-provider] branch main updated: IDP-2113 Report missing dependency on update of other plugins

Rod Widdowson rdw at steadingsoftware.com
Mon Aug 21 14:53:37 UTC 2023


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=15b8a403ef27410bc6ff10fd344d75ba9dcc596d

The following commit(s) were added to refs/heads/main by this push:
     new 15b8a403e IDP-2113 Report missing dependency on update of other plugins
15b8a403e is described below

commit 15b8a403ef27410bc6ff10fd344d75ba9dcc596d
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Mon Aug 21 15:52:36 2023 +0100

    IDP-2113 Report missing dependency on update of other plugins
    
    https://shibboleth.atlassian.net/browse/IDP-2113
    
    plugin -l enhanced to warn on non-existant modules
---
 .../idp/installer/plugin/impl/PluginInstaller.java           |  2 +-
 .../idp/installer/plugin/impl/PluginInstallerCLI.java        | 12 ++++++++++--
 2 files changed, 11 insertions(+), 3 deletions(-)

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 47f8a3e30..7aaa41fa1 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
@@ -452,7 +452,7 @@ public final class PluginInstaller extends AbstractInitializableComponent implem
      * @return a set of the names of the currently enabled Modules.
      * @throws BuildException on loading a module
      */
-    @Nonnull private Set<String> getLoadedModules() throws BuildException {
+    @Nonnull public Set<String> getLoadedModules() throws BuildException {
         final @Nonnull Set<String> enablededModules = new HashSet<>();
         final Iterator<IdPModule> modules = ServiceLoader.load(IdPModule.class, getInstalledPluginsLoader()).iterator();
         while (modules.hasNext()) {
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
index cfed30301..f258981ac 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/plugin/impl/PluginInstallerCLI.java
@@ -29,6 +29,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Properties;
+import java.util.Set;
 
 import javax.annotation.Nonnull;
 import javax.annotation.Nullable;
@@ -333,14 +334,21 @@ public final class PluginInstallerCLI extends AbstractIdPHomeAwareCommandLine<Pl
      */
     private void doList(final boolean fullList, @Nullable final String pluginId) {
         boolean list = false;
-        assert installer != null;
-        final List<IdPPlugin> plugins = installer.getInstalledPlugins();
+        final PluginInstaller inst = installer;
+        assert inst != null;
+        final List<IdPPlugin> plugins = inst.getInstalledPlugins();
+        final Set<String> modules = inst.getLoadedModules();
         for (final IdPPlugin plugin: plugins) {
             if (pluginId == null || pluginId.equals(plugin.getPluginId())) {
                 list = true;
                 outOrLog(String.format("Plugin: %-22s\tCurrent Version: %d.%d.%d",
                        plugin.getPluginId(),
                        plugin.getMajorVersion(),plugin.getMinorVersion(), plugin.getPatchVersion()));
+                for (final String module:plugin.getRequiredModules()) {
+                        if (!modules.contains(module)) {
+                                getLogger().error("Plugin {} requires non-enabled module {}", plugin.getPluginId(), module);
+                        }
+                }
                 if (fullList) {
                     printDetails(plugin);
                 }

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list