[1/2] cxf git commit: [CXF-6926] - StaticSTSProperties does not allow initialization of crypto from Properties object
Repository: cxf Updated Branches: refs/heads/3.1.x-fixes 42f6750b3 -> d55039341 [CXF-6926] - StaticSTSProperties does not allow initialization of crypto from Properties object Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3ec5957b Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3ec5957b Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3ec5957b Branch: refs/heads/3.1.x-fixes Commit: 3ec5957b01821138129cc29acb88430fa278d28e Parents: 42f6750 Author: Colm O hEigeartaigh Authored: Tue May 31 15:57:27 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 31 16:05:38 2016 +0100 -- .../java/org/apache/cxf/rt/security/utils/SecurityUtils.java | 6 +- .../src/main/java/org/apache/cxf/sts/StaticSTSProperties.java | 7 ++- 2 files changed, 7 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/3ec5957b/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java -- diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java index 046b7c5..b679edb 100644 --- a/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java +++ b/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java @@ -135,13 +135,17 @@ public final class SecurityUtils { } public static Properties loadProperties(Object o) { +return loadProperties(null, o); +} + +public static Properties loadProperties(ResourceManager manager, Object o) { if (o instanceof Properties) { return (Properties)o; } URL url = null; if (o instanceof String) { -url = SecurityUtils.loadResource(o); +url = SecurityUtils.loadResource(manager, o); } else if (o instanceof URL) { url = (URL)o; } http://git-wip-us.apache.org/repos/asf/cxf/blob/3ec5957b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java index c02bf93..0399575 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java @@ -18,7 +18,6 @@ */ package org.apache.cxf.sts; -import java.net.URL; import java.util.List; import java.util.Properties; import java.util.logging.Level; @@ -73,8 +72,7 @@ public class StaticSTSProperties implements STSPropertiesMBean { public void configureProperties() throws STSException { if (signatureCrypto == null && signatureCryptoProperties != null) { ResourceManager resourceManager = getResourceManager(); -URL url = SecurityUtils.loadResource(resourceManager, signatureCryptoProperties); -Properties sigProperties = SecurityUtils.loadProperties(url); +Properties sigProperties = SecurityUtils.loadProperties(resourceManager, signatureCryptoProperties); if (sigProperties == null) { LOG.fine("Cannot load signature properties using: " + signatureCryptoProperties); throw new STSException("Configuration error: cannot load signature properties"); @@ -89,8 +87,7 @@ public class StaticSTSProperties implements STSPropertiesMBean { if (encryptionCrypto == null && encryptionCryptoProperties != null) { ResourceManager resourceManager = getResourceManager(); -URL url = SecurityUtils.loadResource(resourceManager, encryptionCryptoProperties); -Properties encrProperties = SecurityUtils.loadProperties(url); +Properties encrProperties = SecurityUtils.loadProperties(resourceManager, encryptionCryptoProperties); if (encrProperties == null) { LOG.fine("Cannot load encryption properties using: " + encryptionCryptoProperties); throw new STSException("Configuration error: cannot load encryption properties");
[1/2] cxf git commit: [CXF-6926] - StaticSTSProperties does not allow initialization of crypto from Properties object
Repository: cxf Updated Branches: refs/heads/master e824784db -> 4a0664250 [CXF-6926] - StaticSTSProperties does not allow initialization of crypto from Properties object Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6ee177cc Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6ee177cc Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6ee177cc Branch: refs/heads/master Commit: 6ee177cc53142ad69589950af1e29077fb034449 Parents: e824784 Author: Colm O hEigeartaigh Authored: Tue May 31 15:57:27 2016 +0100 Committer: Colm O hEigeartaigh Committed: Tue May 31 15:57:27 2016 +0100 -- .../java/org/apache/cxf/rt/security/utils/SecurityUtils.java | 6 +- .../src/main/java/org/apache/cxf/sts/StaticSTSProperties.java | 7 ++- 2 files changed, 7 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/cxf/blob/6ee177cc/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java -- diff --git a/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java b/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java index 046b7c5..b679edb 100644 --- a/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java +++ b/rt/security/src/main/java/org/apache/cxf/rt/security/utils/SecurityUtils.java @@ -135,13 +135,17 @@ public final class SecurityUtils { } public static Properties loadProperties(Object o) { +return loadProperties(null, o); +} + +public static Properties loadProperties(ResourceManager manager, Object o) { if (o instanceof Properties) { return (Properties)o; } URL url = null; if (o instanceof String) { -url = SecurityUtils.loadResource(o); +url = SecurityUtils.loadResource(manager, o); } else if (o instanceof URL) { url = (URL)o; } http://git-wip-us.apache.org/repos/asf/cxf/blob/6ee177cc/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java -- diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java index c02bf93..0399575 100644 --- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java +++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/StaticSTSProperties.java @@ -18,7 +18,6 @@ */ package org.apache.cxf.sts; -import java.net.URL; import java.util.List; import java.util.Properties; import java.util.logging.Level; @@ -73,8 +72,7 @@ public class StaticSTSProperties implements STSPropertiesMBean { public void configureProperties() throws STSException { if (signatureCrypto == null && signatureCryptoProperties != null) { ResourceManager resourceManager = getResourceManager(); -URL url = SecurityUtils.loadResource(resourceManager, signatureCryptoProperties); -Properties sigProperties = SecurityUtils.loadProperties(url); +Properties sigProperties = SecurityUtils.loadProperties(resourceManager, signatureCryptoProperties); if (sigProperties == null) { LOG.fine("Cannot load signature properties using: " + signatureCryptoProperties); throw new STSException("Configuration error: cannot load signature properties"); @@ -89,8 +87,7 @@ public class StaticSTSProperties implements STSPropertiesMBean { if (encryptionCrypto == null && encryptionCryptoProperties != null) { ResourceManager resourceManager = getResourceManager(); -URL url = SecurityUtils.loadResource(resourceManager, encryptionCryptoProperties); -Properties encrProperties = SecurityUtils.loadProperties(url); +Properties encrProperties = SecurityUtils.loadProperties(resourceManager, encryptionCryptoProperties); if (encrProperties == null) { LOG.fine("Cannot load encryption properties using: " + encryptionCryptoProperties); throw new STSException("Configuration error: cannot load encryption properties");