Search in sources :

Example 6 with InboundResponseFromIdp

use of uk.gov.ida.saml.hub.domain.InboundResponseFromIdp in project verify-hub by alphagov.

the class UnknownMethodAlgorithmLoggerTest method shouldNotReportStrongAlgorithmsInIDPResponse.

@Test
public void shouldNotReportStrongAlgorithmsInIDPResponse() throws Exception {
    final InboundResponseFromIdp inboundResponseFromIdp = new InboundResponseFromIdp(ID, IN_RESPONSE_TO, ISSUER_IDP, ISSUE_INSTANT, NOT_ON_OR_AFTER, STATUS, signature, MATCHING_DATASET_ASSERTION, DESTINATION, AUTHN_STATEMENT_ASSERTION);
    UnknownMethodAlgorithmLogger.probeResponseForMethodAlgorithm(inboundResponseFromIdp);
    verify(mockAppender, times(0)).doAppend(captorLoggingEvent.capture());
}
Also used : InboundResponseFromIdp(uk.gov.ida.saml.hub.domain.InboundResponseFromIdp) Test(org.junit.jupiter.api.Test)

Example 7 with InboundResponseFromIdp

use of uk.gov.ida.saml.hub.domain.InboundResponseFromIdp in project verify-hub by alphagov.

the class UnknownMethodAlgorithmLoggerTest method shouldReportUnknownSignatureAndDigestAlgorithmsInIDPResponse.

@Test
public void shouldReportUnknownSignatureAndDigestAlgorithmsInIDPResponse() throws Exception {
    InboundResponseFromIdp inboundResponseFromIdp = new InboundResponseFromIdp(ID, IN_RESPONSE_TO, ISSUER_IDP, ISSUE_INSTANT, NOT_ON_OR_AFTER, STATUS, signatureWithUnknownSignatureAndDigestAlgorithms, MATCHING_DATASET_ASSERTION, DESTINATION, AUTHN_STATEMENT_ASSERTION);
    UnknownMethodAlgorithmLogger.probeResponseForMethodAlgorithm(inboundResponseFromIdp);
    verifyLog(mockAppender, captorLoggingEvent, 1, String.format(UnknownMethodAlgorithmLogger.SIGNATURE_AND_DIGEST_ALGORITHMS_MESSAGE, IDP, SIGNATURE_RSA_SHA1_ID, DIGEST_SHA1_ID, Response.DEFAULT_ELEMENT_LOCAL_NAME));
}
Also used : InboundResponseFromIdp(uk.gov.ida.saml.hub.domain.InboundResponseFromIdp) Test(org.junit.jupiter.api.Test)

Aggregations

InboundResponseFromIdp (uk.gov.ida.saml.hub.domain.InboundResponseFromIdp)7 Test (org.junit.jupiter.api.Test)5 Assertion (org.opensaml.saml.saml2.core.Assertion)2 PassthroughAssertion (uk.gov.ida.saml.core.domain.PassthroughAssertion)2 ValidatedAssertions (uk.gov.ida.saml.security.validators.ValidatedAssertions)2 ValidatedResponse (uk.gov.ida.saml.security.validators.ValidatedResponse)2 URI (java.net.URI)1 Optional (java.util.Optional)1 DateTime (org.joda.time.DateTime)1 Response (org.opensaml.saml.saml2.core.Response)1 InboundResponseFromIdpDto (uk.gov.ida.hub.samlengine.domain.InboundResponseFromIdpDto)1 LevelOfAssurance (uk.gov.ida.hub.samlengine.domain.LevelOfAssurance)1 SamlContextException (uk.gov.ida.hub.samlengine.exceptions.SamlContextException)1 InboundResponseFromIdpData (uk.gov.ida.saml.core.domain.InboundResponseFromIdpData)1 AssertionBuilder.anAssertion (uk.gov.ida.saml.core.test.builders.AssertionBuilder.anAssertion)1 PassthroughAssertionBuilder.aPassthroughAssertion (uk.gov.ida.saml.core.test.builders.PassthroughAssertionBuilder.aPassthroughAssertion)1 SamlTransformationErrorException (uk.gov.ida.saml.core.validation.SamlTransformationErrorException)1 IdpIdaStatus (uk.gov.ida.saml.hub.domain.IdpIdaStatus)1