use of uk.gov.ida.hub.policy.domain.EidasCountryDto in project verify-hub by alphagov.
the class ConfigStubRule method setUpStubForEnabledCountries.
public void setUpStubForEnabledCountries(String rpEntityId, Collection<EidasCountryDto> enabledCountries) throws JsonProcessingException {
register(Urls.ConfigUrls.COUNTRIES_ROOT, OK, enabledCountries);
List<String> countryEntityIds = enabledCountries.stream().map(country -> country.getEntityId()).collect(Collectors.toList());
UriBuilder countriesForTransactionUriBuilder = UriBuilder.fromPath(Urls.ConfigUrls.EIDAS_RP_COUNTRIES_FOR_TRANSACTION_RESOURCE);
String countriesForTransactionPath = countriesForTransactionUriBuilder.buildFromEncoded(StringEncoding.urlEncode(rpEntityId).replace("+", "%20")).getPath();
register(countriesForTransactionPath, OK, countryEntityIds);
}
use of uk.gov.ida.hub.policy.domain.EidasCountryDto in project verify-hub by alphagov.
the class CountrySelectedStateController method getRequestFromHub.
public AuthnRequestFromHub getRequestFromHub() {
// Use TransactionConfigProxy to lookup list of countries and findFirst matching by entityId
Optional<EidasCountryDto> countryDto = this.transactionsConfigProxy.getEidasSupportedCountries().stream().filter(eidasCountryDto -> eidasCountryDto.getEntityId().equals(state.getCountryEntityId())).findFirst();
AuthnRequestFromHub requestToSendFromHub = new AuthnRequestFromHub(state.getRequestId(), state.getLevelsOfAssurance(), false, state.getCountryEntityId(), com.google.common.base.Optional.of(true), state.getSessionExpiryTimestamp(), false, countryDto.map(EidasCountryDto::getOverriddenSsoUrl).orElse(null));
hubEventLogger.logRequestFromHub(state.getSessionId(), state.getRequestIssuerEntityId());
return requestToSendFromHub;
}
Aggregations