Skip to content

Commit 6db25bc

Browse files
committed
msg/idtoken claims validator not performing automatic verify
1 parent 77c00b7 commit 6db25bc

3 files changed

Lines changed: 1 addition & 31 deletions

File tree

src/main/java/org/oidc/msg/validator/IDTokenClaimValidator.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
package org.oidc.msg.validator;
1818

1919
import org.oidc.msg.InvalidClaimException;
20-
import org.oidc.msg.Message;
2120
import org.oidc.msg.oidc.IDToken;
2221

2322
/** General validator for claims type of id token. */
@@ -29,11 +28,6 @@ public Object validate(Object value) throws InvalidClaimException {
2928
throw new InvalidClaimException(
3029
String.format("Parameter '%s' is not of expected type", value));
3130
}
32-
// TODO: This might not be correct phase to do verify as we might not be able to set all input
33-
// for verify
34-
if (!((IDToken) value).verify()) {
35-
throw new InvalidClaimException(String.format("Parameter '%s' verification failed", value));
36-
}
3731
return value;
3832
}
3933
}

src/main/java/org/oidc/msg/validator/MessageClaimValidator.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ public Object validate(Object value) throws InvalidClaimException {
2828
throw new InvalidClaimException(
2929
String.format("Parameter '%s' is not of expected type", value));
3030
}
31-
// TODO: This might not be correct phase to do verify as we might not be able to set all input
32-
// for verify
33-
if (!((Message) value).verify()) {
34-
throw new InvalidClaimException(String.format("Parameter '%s' verification failed", value));
35-
}
3631
return value;
3732
}
3833
}

src/test/java/org/oidc/msg/AbstractMessageTest.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -440,26 +440,7 @@ public void successTestMessageType() throws InvalidClaimException {
440440
((Message) (mockMessage.getClaims().get("parameter1"))).getClaims().get("parameter1"),
441441
"value");
442442
}
443-
444-
@Test(expected = InvalidClaimException.class)
445-
public void failTestMessageTypeInnerFails() throws InvalidClaimException {
446-
HashMap<String, Object> innerClaims = new HashMap<>();
447-
innerClaims.put("parameter1", 5);
448-
Map<String, ParameterVerificationDefinition> innerParVerDef = new HashMap<String, ParameterVerificationDefinition>();
449-
innerParVerDef.put("parameter1", ParameterVerification.SINGLE_OPTIONAL_STRING.getValue());
450-
MockMessage innerMockMessage = new MockMessage(innerClaims, innerParVerDef);
451-
452-
HashMap<String, Object> claims = new HashMap<>();
453-
claims.put("parameter1", innerMockMessage);
454-
Map<String, ParameterVerificationDefinition> parVerDef = new HashMap<String, ParameterVerificationDefinition>();
455-
parVerDef.put("parameter1", ParameterVerification.SINGLE_OPTIONAL_MESSAGE.getValue());
456-
MockMessage mockMessage = new MockMessage(claims, parVerDef);
457-
mockMessage.verify();
458-
Assert.assertEquals(
459-
((Message) (mockMessage.getClaims().get("parameter1"))).getClaims().get("parameter1"),
460-
"value");
461-
}
462-
443+
463444
@Test(expected = InvalidClaimException.class)
464445
public void failTestMessageType() throws InvalidClaimException {
465446
HashMap<String, Object> claims = new HashMap<>();

0 commit comments

Comments
 (0)