[java-identity-provider] branch main updated: IDP-2112 Module enabled status needs to understand operating system

Rod Widdowson rdw at steadingsoftware.com
Thu May 18 12:35:57 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=36ba94482fd0f3432f24459ba077c8a2620e5c6a

The following commit(s) were added to refs/heads/main by this push:
     new 36ba94482 IDP-2112 Module enabled status needs to understand operating system
36ba94482 is described below

commit 36ba94482fd0f3432f24459ba077c8a2620e5c6a
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Thu May 18 13:32:52 2023 +0100

    IDP-2112 Module enabled status needs to understand operating system
    
    https://shibboleth.atlassian.net/browse/IDP-2112
    
    teach isEnabled() about OS specific resources and add some logging about
    skipped resources
---
 .../main/java/net/shibboleth/idp/module/AbstractIdPModule.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
index 86b31b6a8..f29efd1b4 100644
--- a/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
+++ b/idp-admin-api/src/main/java/net/shibboleth/idp/module/AbstractIdPModule.java
@@ -141,7 +141,11 @@ public abstract class AbstractIdPModule implements IdPModule {
                 }
             } else {
                 final Path resolved = Path.of(moduleContext.getInstallLocation()).resolve(resource.getDestination());
-                if (!resolved.toFile().exists()) {
+                if (SystemUtils.IS_OS_WINDOWS && resource.isWindows() && !resolved.toFile().exists()) {
+                    log.debug("Module {}: resource destination {} missing, module is disabled", getId(), resolved);
+                    return false;
+                }
+                if (!SystemUtils.IS_OS_WINDOWS && resource.isNonWindows() && !resolved.toFile().exists()) {
                     log.debug("Module {}: resource destination {} missing, module is disabled", getId(), resolved);
                     return false;
                 }
@@ -175,10 +179,14 @@ public abstract class AbstractIdPModule implements IdPModule {
                 if (SystemUtils.IS_OS_WINDOWS) {
                     if (resource.isWindows()) {
                         results.put(resource, ((BasicModuleResource) resource).enable(moduleContext));
+                    } else {
+                        log.debug("Module {}: skipping non-Windows resource {}", getId(), resource);
                     }
                 } else {
                     if (resource.isNonWindows()) {
                         results.put(resource, ((BasicModuleResource) resource).enable(moduleContext));
+                    } else {
+                        log.debug("Module {}: skipping Windows resource {}", getId(), resource);
                     }
                 }
             }

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


More information about the commits mailing list