You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2016/06/05 17:02:36 UTC
[08/33] cxf git commit: [CXF-6926] - StaticSTSProperties does not
allow initialization of crypto from Properties object
[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-jaxrs-2.1
Commit: 6ee177cc53142ad69589950af1e29077fb034449
Parents: e824784
Author: Colm O hEigeartaigh <co...@apache.org>
Authored: Tue May 31 15:57:27 2016 +0100
Committer: Colm O hEigeartaigh <co...@apache.org>
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");