use of uk.gov.ida.saml.core.domain.Cycle3Dataset in project verify-hub by alphagov.
the class HubAttributeQueryRequestBuilder method createCycle3Assertion.
private Optional<HubAssertion> createCycle3Assertion(AttributeQueryRequestDto attributeQueryRequestDto) {
Optional<HubAssertion> cycle3AttributeAssertion = Optional.empty();
if (attributeQueryRequestDto.getCycle3Dataset().isPresent()) {
AssertionRestrictions assertionRestrictions = new AssertionRestrictions(attributeQueryRequestDto.getAssertionExpiry(), attributeQueryRequestDto.getRequestId(), attributeQueryRequestDto.getAuthnRequestIssuerEntityId());
Optional<Cycle3Dataset> cycle3Data = Optional.of(Cycle3Dataset.createFromData(attributeQueryRequestDto.getCycle3Dataset().get().getAttributes()));
cycle3AttributeAssertion = Optional.of(new HubAssertion(UUID.randomUUID().toString(), hubEntityId, DateTime.now(), new PersistentId(attributeQueryRequestDto.getPersistentId().getNameId()), assertionRestrictions, cycle3Data));
}
return cycle3AttributeAssertion;
}
use of uk.gov.ida.saml.core.domain.Cycle3Dataset in project verify-hub by alphagov.
the class HubEidasAttributeQueryRequestBuilder method createCycle3Assertion.
private Optional<HubAssertion> createCycle3Assertion(EidasAttributeQueryRequestDto attributeQueryRequestDto) {
Optional<HubAssertion> cycle3AttributeAssertion = Optional.empty();
Optional<uk.gov.ida.hub.samlengine.domain.Cycle3Dataset> serializableCycle3Dataset = attributeQueryRequestDto.getCycle3Dataset();
if (serializableCycle3Dataset.isPresent()) {
AssertionRestrictions assertionRestrictions = new AssertionRestrictions(attributeQueryRequestDto.getAssertionExpiry(), attributeQueryRequestDto.getRequestId(), attributeQueryRequestDto.getAuthnRequestIssuerEntityId());
Optional<Cycle3Dataset> cycle3Data = serializableCycle3Dataset.map(uk.gov.ida.hub.samlengine.domain.Cycle3Dataset::getAttributes).map(Cycle3Dataset::createFromData);
HubAssertion hubAssertion = new HubAssertion(UUID.randomUUID().toString(), hubEntityId, DateTime.now(), new PersistentId(attributeQueryRequestDto.getPersistentId().getNameId()), assertionRestrictions, cycle3Data);
cycle3AttributeAssertion = Optional.of(hubAssertion);
}
return cycle3AttributeAssertion;
}
Aggregations