You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by GitBox <gi...@apache.org> on 2022/05/02 10:45:18 UTC

[GitHub] [cxf] lukepasek opened a new pull request, #944: NPE fix in addClaims() method

lukepasek opened a new pull request, #944:
URL: https://github.com/apache/cxf/pull/944

   In AbstractSTSClient NPE is thrown when instance claims is null, and claimsCallbackHandler returns claims as ClaimCollection.
   In the original code the wrong variable was cast on the claimCollection local variable, was claims and should be claimsToSerialize.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cxf] reta commented on a diff in pull request #944: NPE fix in addClaims() method

Posted by GitBox <gi...@apache.org>.
reta commented on code in PR #944:
URL: https://github.com/apache/cxf/pull/944#discussion_r862834328


##########
rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java:
##########
@@ -1453,7 +1453,7 @@ protected void addClaims(XMLStreamWriter writer) throws Exception {
         if (claimsToSerialize instanceof Element) {
             StaxUtils.copy((Element)claimsToSerialize, writer);
         } else if (claimsToSerialize instanceof ClaimCollection) {
-            ClaimCollection claimCollection = (ClaimCollection)claims;
+            ClaimCollection claimCollection = (ClaimCollection)claimsToSerialize;

Review Comment:
   Thanks for the fix @lukepasek , seems like we have a gap in tests, could you please add at least one to capture that? Thank you!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cxf] coheigea commented on a diff in pull request #944: NPE fix in addClaims() method

Posted by GitBox <gi...@apache.org>.
coheigea commented on code in PR #944:
URL: https://github.com/apache/cxf/pull/944#discussion_r867801220


##########
rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java:
##########
@@ -1453,7 +1453,7 @@ protected void addClaims(XMLStreamWriter writer) throws Exception {
         if (claimsToSerialize instanceof Element) {
             StaxUtils.copy((Element)claimsToSerialize, writer);
         } else if (claimsToSerialize instanceof ClaimCollection) {
-            ClaimCollection claimCollection = (ClaimCollection)claims;
+            ClaimCollection claimCollection = (ClaimCollection)claimsToSerialize;

Review Comment:
   I'll add the test to the STS systests



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [cxf] coheigea merged pull request #944: NPE fix in addClaims() method

Posted by GitBox <gi...@apache.org>.
coheigea merged PR #944:
URL: https://github.com/apache/cxf/pull/944


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@cxf.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org