[java-identity-provider] branch main updated: IDP-2002 - Migrate all unmanaged config files into core module

Scott Cantor cantor.2 at osu.edu
Thu May 11 17:26:20 UTC 2023


This is an automated email from the git hooks/post-receive script.

scantor 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=47f82ee81e849462fe4bd23f177468e6684b597d

The following commit(s) were added to refs/heads/main by this push:
     new 47f82ee81 IDP-2002 - Migrate all unmanaged config files into core module
47f82ee81 is described below

commit 47f82ee81e849462fe4bd23f177468e6684b597d
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Thu May 11 13:26:16 2023 -0400

    IDP-2002 - Migrate all unmanaged config files into core module
    
    https://shibboleth.atlassian.net/browse/IDP-2002
    
    Brute force creation of various folders under idp.home in core module.
---
 .../net/shibboleth/idp/module/core/impl/Core.java  | 24 ++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java
index 03de0e5d5..95be2acea 100644
--- a/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java
+++ b/idp-conf-impl/src/main/java/net/shibboleth/idp/module/core/impl/Core.java
@@ -18,6 +18,8 @@
 package net.shibboleth.idp.module.core.impl;
 
 import java.io.IOException;
+import java.nio.file.Files;
+import java.nio.file.Path;
 import java.util.Map;
 
 import javax.annotation.Nonnull;
@@ -29,6 +31,9 @@ import net.shibboleth.idp.module.impl.CoreIdPModule;
 
 /**
  * {@link IdPModule} implementation.
+ * 
+ * <p>This is a somewhat special module as it represents the "core" software
+ * being installed or upgraded so has some different characteristics and methods.
  */
 public final class Core extends CoreIdPModule {
 
@@ -48,6 +53,25 @@ public final class Core extends CoreIdPModule {
         return true;
     }
 
+    /** {@inheritDoc} */
+    @Override
+    @Nonnull public Map<ModuleResource, ResourceResult> enable(@Nonnull final ModuleContext moduleContext)
+            throws ModuleException {
+        
+        // First we need to ensure the basic directory layout is in place. On upgrade this won't have any effect.
+        try {
+            final Path home = Path.of(moduleContext.getInstallLocation());
+            Files.createDirectories(home.resolve("conf"));
+            Files.createDirectories(home.resolve("flows"));
+            Files.createDirectories(home.resolve("messages"));
+            Files.createDirectories(home.resolve("views"));
+        } catch (final Exception e) {
+            throw new ModuleException(e);
+        }
+        
+        return super.enable(moduleContext);
+    }
+
     /** {@inheritDoc} */
     @Override
     @Nonnull public Map<ModuleResource, ResourceResult> disable(@Nonnull final ModuleContext moduleContext,

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


More information about the commits mailing list