[java-identity-provider] 02/02: IDP-1523 Secrets.properties moves to credentials

Rod Widdowson rdw at steadingsoftware.com
Sat Dec 21 11:06:51 EST 2019


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

rdw pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=0a569ddf33c7130c3eddcb84f81f73518d97e529

commit 0a569ddf33c7130c3eddcb84f81f73518d97e529
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Sat Dec 21 15:44:00 2019 +0000

    IDP-1523 Secrets.properties moves to credentials
    
    https://issues.shibboleth.net/jira/browse/IDP-1523
    
    Installer work
---
 .../main/java/net/shibboleth/idp/installer/CopyDistribution.java | 1 +
 .../src/main/java/net/shibboleth/idp/installer/V4Install.java    | 9 +++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java
index 8174630..54d4773 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/CopyDistribution.java
@@ -157,6 +157,7 @@ public final class CopyDistribution extends AbstractInitializableComponent {
             throw new BuildException("Source distribution not found");
         }
         distCopy(src, dist, "conf");
+        distCopy(src, dist, "credentials");
         distCopy(src, dist, "flows");
         distCopy(src, dist, "messages");
         distCopy(src, dist, "views");
diff --git a/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java b/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
index 11874a1..fd14e3f 100644
--- a/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
+++ b/idp-installer/src/main/java/net/shibboleth/idp/installer/V4Install.java
@@ -268,17 +268,17 @@ public class V4Install extends AbstractInitializableComponent {
         if (sealerCreated) {
             // We need to write the passwords to secrets.properties
             try {
-                final Path target = conf.resolve("secrets.properties");
+                final Path target = installerProps.getTargetDir().resolve("credentials").resolve("secrets.properties");
                 if (Files.exists(target)) {
                     throw new BuildException("Internal error - secrets.properties");
                 }
-                final Path mergePath = installerProps.getSecretsMergeProperties();
-                final Path source = distConf.resolve("secrets.properties");
+                final Path distCreds = installerProps.getTargetDir().resolve("dist").resolve("credentials");
+                final Path source = distCreds.resolve("secrets.properties");
                 if (!Files.exists(source)) {
                     throw new BuildException("missing secrets.properties in dist");
                 }
-                final PropertiesWithComments propertiesToReWrite = new PropertiesWithComments();
                 final Properties replacements;
+                final Path mergePath = installerProps.getSecretsMergeProperties();
                 if (mergePath != null) {
                     log.debug("Creating {} from {} and {}", target, source, mergePath);
                     replacements = new Properties();
@@ -293,6 +293,7 @@ public class V4Install extends AbstractInitializableComponent {
                     replacements .setProperty("idp.sealer.keyPassword", installerProps.getSealerPassword());
                     log.debug("Creating {} from {} and {}", target, source, replacements.keySet());
                 }
+                final PropertiesWithComments propertiesToReWrite = new PropertiesWithComments();
                 propertiesToReWrite.load(new FileInputStream(source.toFile()));
                 propertiesToReWrite.replaceProperties(replacements);
                 propertiesToReWrite.store(new FileOutputStream(target.toFile()));

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


More information about the commits mailing list