You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2023/10/16 15:17:07 UTC
[cxf] branch coheigea/wss4j-4.0.0 created (now a534f5a1c2)
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a change to branch coheigea/wss4j-4.0.0
in repository https://gitbox.apache.org/repos/asf/cxf.git
at a534f5a1c2 Updating to WSS4J 4.0.0
This branch includes the following new commits:
new a534f5a1c2 Updating to WSS4J 4.0.0
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
[cxf] 01/01: Updating to WSS4J 4.0.0
Posted by co...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
coheigea pushed a commit to branch coheigea/wss4j-4.0.0
in repository https://gitbox.apache.org/repos/asf/cxf.git
commit a534f5a1c27147203dc134e4f967972b526498e8
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Oct 16 16:16:39 2023 +0100
Updating to WSS4J 4.0.0
---
parent/pom.xml | 2 +-
.../apache/cxf/rs/security/oauth2/saml/SamlOAuthValidator.java | 2 +-
.../apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java | 2 +-
.../cxf/rs/security/saml/sso/SamlpRequestComponentBuilder.java | 2 +-
.../cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java | 8 ++++++--
.../cxf/rt/security/saml/xacml2/DefaultXACMLRequestBuilder.java | 2 +-
.../cxf/rt/security/saml/xacml2/RequestComponentBuilderTest.java | 2 +-
.../apache/cxf/sts/token/delegation/SAMLDelegationHandler.java | 4 ++--
.../java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java | 4 ++--
9 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/parent/pom.xml b/parent/pom.xml
index e6198ca120..7a39cb1677 100644
--- a/parent/pom.xml
+++ b/parent/pom.xml
@@ -235,7 +235,7 @@
<cxf.woodstox.core.version>6.5.1</cxf.woodstox.core.version>
<cxf.woodstox.stax2-api.version>4.2.1</cxf.woodstox.stax2-api.version>
<cxf.wsdl4j.version>1.6.3</cxf.wsdl4j.version>
- <cxf.jakarta.wss4j.version>3.0.1</cxf.jakarta.wss4j.version>
+ <cxf.jakarta.wss4j.version>4.0.0-SNAPSHOT</cxf.jakarta.wss4j.version>
<cxf.xmlschema.version>2.3.1</cxf.xmlschema.version>
<cxf.xnio.version>3.8.11.Final</cxf.xnio.version>
<cxf.zest.version>2.1</cxf.zest.version>
diff --git a/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/saml/SamlOAuthValidator.java b/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/saml/SamlOAuthValidator.java
index 9da501b2d0..27ccf9ebfb 100644
--- a/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/saml/SamlOAuthValidator.java
+++ b/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/saml/SamlOAuthValidator.java
@@ -98,7 +98,7 @@ public class SamlOAuthValidator {
for (AudienceRestriction ar : restrictions) {
List<Audience> audiences = ar.getAudiences();
for (Audience a : audiences) {
- if (absoluteAddress.equals(a.getAudienceURI())) {
+ if (absoluteAddress.equals(a.getURI())) {
return;
}
}
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
index dbc9b32d04..85c0e0ede9 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLSSOResponseValidator.java
@@ -295,7 +295,7 @@ public class SAMLSSOResponseValidator {
if (audienceRestriction.getAudiences() != null) {
boolean matchFound = false;
for (org.opensaml.saml.saml2.core.Audience audience : audienceRestriction.getAudiences()) {
- if (appliesTo.equals(audience.getAudienceURI())) {
+ if (appliesTo.equals(audience.getURI())) {
matchFound = true;
oneMatchFound = true;
break;
diff --git a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlpRequestComponentBuilder.java b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlpRequestComponentBuilder.java
index 415aedb3be..9e9bbad53d 100644
--- a/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlpRequestComponentBuilder.java
+++ b/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SamlpRequestComponentBuilder.java
@@ -192,7 +192,7 @@ public final class SamlpRequestComponentBuilder {
builderFactory.getBuilder(AuthnContextClassRef.DEFAULT_ELEMENT_NAME);
}
AuthnContextClassRef authnCtxClassRef = requestedAuthnCtxClassRefBuilder.buildObject();
- authnCtxClassRef.setAuthnContextClassRef(authnCtxClassRefValue);
+ authnCtxClassRef.setURI(authnCtxClassRefValue);
return authnCtxClassRef;
}
diff --git a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
index 52e90f32dd..1b4bb80b52 100644
--- a/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
+++ b/rt/rs/security/sso/saml/src/test/java/org/apache/cxf/rs/security/saml/sso/SAMLResponseValidatorTest.java
@@ -286,7 +286,9 @@ public class SAMLResponseValidatorTest {
DOMUtils.findAllElementsByTagNameNS(policyElement, SAMLConstants.SAML20_NS, "Assertion");
assertNotNull(assertions);
assertTrue(assertions.size() == 1);
- assertions.get(0).setAttributeNS(null, "newattr", "http://apache.org");
+ Thread.sleep(1000L);
+ Instant issueInstant = Instant.now();
+ assertions.get(0).setAttributeNS(null, "IssueInstant", issueInstant.toString());
Response marshalledResponse = (Response)OpenSAMLUtil.fromDom(policyElement);
@@ -395,7 +397,9 @@ public class SAMLResponseValidatorTest {
doc.appendChild(policyElement);
assertNotNull(policyElement);
- policyElement.setAttributeNS(null, "newattr", "http://apache.org");
+ Thread.sleep(1000L);
+ Instant issueInstant = Instant.now();
+ policyElement.setAttributeNS(null, "IssueInstant", issueInstant.toString());
Response marshalledResponse = (Response)OpenSAMLUtil.fromDom(policyElement);
diff --git a/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/DefaultXACMLRequestBuilder.java b/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/DefaultXACMLRequestBuilder.java
index bf03f55c79..75a345ec10 100644
--- a/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/DefaultXACMLRequestBuilder.java
+++ b/rt/security-saml/src/main/java/org/apache/cxf/rt/security/saml/xacml2/DefaultXACMLRequestBuilder.java
@@ -27,7 +27,7 @@ import java.util.List;
import javax.xml.namespace.QName;
-import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+import net.shibboleth.shared.xml.DOMTypeSupport;
import org.apache.cxf.message.Message;
import org.apache.cxf.rt.security.saml.xacml.CXFMessageParser;
import org.apache.cxf.rt.security.saml.xacml.XACMLConstants;
diff --git a/rt/security-saml/src/test/java/org/apache/cxf/rt/security/saml/xacml2/RequestComponentBuilderTest.java b/rt/security-saml/src/test/java/org/apache/cxf/rt/security/saml/xacml2/RequestComponentBuilderTest.java
index de3f660ad1..3c10018100 100644
--- a/rt/security-saml/src/test/java/org/apache/cxf/rt/security/saml/xacml2/RequestComponentBuilderTest.java
+++ b/rt/security-saml/src/test/java/org/apache/cxf/rt/security/saml/xacml2/RequestComponentBuilderTest.java
@@ -31,7 +31,7 @@ import javax.xml.parsers.ParserConfigurationException;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
-import net.shibboleth.utilities.java.support.xml.DOMTypeSupport;
+import net.shibboleth.shared.xml.DOMTypeSupport;
import org.apache.cxf.rt.security.saml.xacml.XACMLConstants;
import org.apache.wss4j.common.saml.OpenSAMLUtil;
import org.opensaml.xacml.ctx.ActionType;
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
index 796b3013b0..d377361389 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/delegation/SAMLDelegationHandler.java
@@ -124,14 +124,14 @@ public class SAMLDelegationHandler implements TokenDelegationHandler {
for (AudienceRestrictionCondition restriction
: assertion.getSaml1().getConditions().getAudienceRestrictionConditions()) {
for (org.opensaml.saml.saml1.core.Audience audience : restriction.getAudiences()) {
- addresses.add(audience.getUri());
+ addresses.add(audience.getURI());
}
}
} else if (assertion.getSaml2() != null) {
for (org.opensaml.saml.saml2.core.AudienceRestriction restriction
: assertion.getSaml2().getConditions().getAudienceRestrictions()) {
for (org.opensaml.saml.saml2.core.Audience audience : restriction.getAudiences()) {
- addresses.add(audience.getAudienceURI());
+ addresses.add(audience.getURI());
}
}
}
diff --git a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
index 7a7d740f1c..d7d0d3cdfa 100644
--- a/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
+++ b/services/sts/sts-core/src/main/java/org/apache/cxf/sts/token/renewer/SAMLTokenRenewer.java
@@ -390,7 +390,7 @@ public class SAMLTokenRenewer extends AbstractSAMLTokenProvider implements Token
for (AudienceRestrictionCondition restrCondition : restrConditions) {
if (restrCondition.getAudiences() != null) {
for (Audience audience : restrCondition.getAudiences()) {
- if (appliesTo.equals(audience.getUri())) {
+ if (appliesTo.equals(audience.getURI())) {
return true;
}
}
@@ -409,7 +409,7 @@ public class SAMLTokenRenewer extends AbstractSAMLTokenProvider implements Token
for (AudienceRestriction audienceRestriction : audienceRestrictions) {
if (audienceRestriction.getAudiences() != null) {
for (org.opensaml.saml.saml2.core.Audience audience : audienceRestriction.getAudiences()) {
- if (appliesTo.equals(audience.getAudienceURI())) {
+ if (appliesTo.equals(audience.getURI())) {
return true;
}
}