From 03830b4462b3f11acd28a63ab05c3105bc19e094 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Mon, 4 Jan 2021 20:29:25 +0100 Subject: Gui creation part 1 --- .../at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'connector_lib') diff --git a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java index b1ef799f..42fefaab 100644 --- a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java +++ b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java @@ -46,7 +46,9 @@ public class MsEidasNodeConstants { public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_PATH = "webcontent.templates"; public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_CCSELECTION = "webcontent.templates.countryselection"; - + public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_OTHER_LOGIN_METHOD_SELECTION = "webcontent.templates" + + ".otherLoginMethodselection"; + public static final String PROP_CONFIG_MONITORING_EIDASNODE_METADATAURL = "monitoring.eIDASNode.metadata.url"; @@ -139,6 +141,7 @@ public class MsEidasNodeConstants { public static final String ENDPOINT_PVP_REDIRECT = "/pvp/redirect"; public static final String ENDPOINT_COUNTRYSELECTION = "/myHomeCountry"; + public static final String ENDPOINT_OTHERLOGINMETHODSELECTION = "/otherLoginMethod"; public static final String ENDPOINT_MONITORING_MONITOR = "/monitoring"; public static final String ENDPOINT_MONITORING_VERIFY = "/verify"; @@ -150,7 +153,7 @@ public class MsEidasNodeConstants { public static final String TEMPLATE_HTML_ERROR = "error_message.html"; public static final String TEMPLATE_HTML_PVP_POSTBINDING = "pvp2_post_binding.html"; public static final String TEMPLATE_HTML_COUNTRYSELECTION = "countrySelection.html"; - + public static final String TEMPLATE_HTML_OTHERLOGINMETHODS = "chooseOtherLoginMethod.html"; // ************ execution context and generic data ************ public static final String REQ_PARAM_SELECTED_COUNTRY = "selectedCountry"; public static final String REQ_PARAM_SELECTED_ENVIRONMENT = "selectedEnvironment"; -- cgit v1.2.3 From f74e02f9f0735ff9a1e897c5eba10f69ff720f8f Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Tue, 12 Jan 2021 13:35:02 +0100 Subject: created tasks and beans --- .../at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'connector_lib') diff --git a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java index 42fefaab..1300ad74 100644 --- a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java +++ b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java @@ -46,8 +46,8 @@ public class MsEidasNodeConstants { public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_PATH = "webcontent.templates"; public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_CCSELECTION = "webcontent.templates.countryselection"; - public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_OTHER_LOGIN_METHOD_SELECTION = "webcontent.templates" + - ".otherLoginMethodselection"; + public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_OTHER_LOGIN_METHOD_SELECTION = "webcontent.templates" + + ".otherLoginMethodselection"; public static final String PROP_CONFIG_MONITORING_EIDASNODE_METADATAURL = "monitoring.eIDASNode.metadata.url"; -- cgit v1.2.3 From de03adfbe79968f65bb711d7b3a583eeb1054140 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Mon, 1 Feb 2021 09:42:38 +0100 Subject: more transitions & tests --- connector_lib/pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'connector_lib') diff --git a/connector_lib/pom.xml b/connector_lib/pom.xml index f24a2801..8ed561f3 100644 --- a/connector_lib/pom.xml +++ b/connector_lib/pom.xml @@ -62,6 +62,14 @@ test-jar + + at.gv.egiz.eaaf + eaaf_module_pvp2_core + + + at.gv.egiz.eaaf + eaaf_module_pvp2_sp + -- cgit v1.2.3 From faca8b55b133adb7e01d891df1b45d24b7690111 Mon Sep 17 00:00:00 2001 From: Alexander Marsalek Date: Mon, 15 Feb 2021 10:38:44 +0100 Subject: Constants for GUI endpoints, load values from config, ID Austria signal controller --- .../asitplus/eidas/specific/connector/MsEidasNodeConstants.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'connector_lib') diff --git a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java index 379ed378..2c87a794 100644 --- a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java +++ b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java @@ -48,6 +48,10 @@ public class MsEidasNodeConstants { public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_CCSELECTION = "webcontent.templates.countryselection"; public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_OTHER_LOGIN_METHOD_SELECTION = "webcontent.templates" + ".otherLoginMethodselection"; + public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_RESIDENCY = "webcontent.templates" + + ".residency"; + public static final String PROP_CONFIG_WEBCONTENT_TEMPLATES_OTHER_CONTACTS_WITH_AUSTRIAN_EGOV = + "webcontent.templates.otherContactsWithAustrianEgov"; public static final String PROP_CONFIG_MONITORING_EIDASNODE_METADATAURL = "monitoring.eIDASNode.metadata.url"; @@ -142,7 +146,8 @@ public class MsEidasNodeConstants { public static final String ENDPOINT_COUNTRYSELECTION = "/myHomeCountry"; public static final String ENDPOINT_OTHERLOGINMETHODSELECTION = "/otherLoginMethod"; - + public static final String ENDPOINT_RESIDENCY_INPUT = "/residency"; + public static final String ENDPOINT_OTHER_CONTACTS_INPUT = "/otherContacts"; public static final String ENDPOINT_MONITORING_MONITOR = "/monitoring"; public static final String ENDPOINT_MONITORING_VERIFY = "/verify"; @@ -154,6 +159,8 @@ public class MsEidasNodeConstants { public static final String TEMPLATE_HTML_PVP_POSTBINDING = "pvp2_post_binding.html"; public static final String TEMPLATE_HTML_COUNTRYSELECTION = "countrySelection.html"; public static final String TEMPLATE_HTML_OTHERLOGINMETHODS = "chooseOtherLoginMethod.html"; + public static final String TEMPLATE_HTML_RESIDENCY = "residency.html"; + public static final String TEMPLATE_HTML_OTHERCONTACTSWITHAUSTRIANEGOV = "otherContactsWithAustrianEgov.html"; // ************ execution context and generic data ************ public static final String REQ_PARAM_SELECTED_COUNTRY = "selectedCountry"; public static final String REQ_PARAM_SELECTED_ENVIRONMENT = "selectedEnvironment"; -- cgit v1.2.3 From 84244f4ac1909c20ce36531f110705b24edbad12 Mon Sep 17 00:00:00 2001 From: Christian Kollmann Date: Mon, 22 Feb 2021 10:43:57 +0100 Subject: Rename tasks to clarify functionality --- .../eidas/specific/connector/MsEidasNodeConstants.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'connector_lib') diff --git a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java index 2c87a794..c6eb9bfa 100644 --- a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java +++ b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/MsEidasNodeConstants.java @@ -85,7 +85,7 @@ public class MsEidasNodeConstants { PROP_CONFIG_PVP2_PREFIX + "metadata.organisation.friendyname"; public static final String CONFIG_PROPS_METADATA_ORGANISATION_URL = PROP_CONFIG_PVP2_PREFIX + "metadata.organisation.url"; - + // TODO: is not implemented yet public static final String PROP_CONFIG_SP_VALIDATION_DISABLED = "configuration.sp.disableRegistrationRequirement"; @@ -100,14 +100,14 @@ public class MsEidasNodeConstants { public static final String PROP_CONFIG_AUTHBLOCK_KEYSTORE_PASSWORD = "auth.eIDAS.authblock.keystore.password"; public static final String PROP_CONFIG_AUTHBLOCK_KEYSTORE_NAME = - "auth.eIDAS.authblock.keystore.name"; + "auth.eIDAS.authblock.keystore.name"; public static final String PROP_CONFIG_AUTHBLOCK_KEY_ALIAS = "auth.eIDAS.authblock.key.alias"; public static final String PROP_CONFIG_AUTHBLOCK_KEY_PASSWORD = "auth.eIDAS.authblock.key.password"; - - - + + + public static final String PROP_CONFIG_SP_LIST_PREFIX = "sp"; public static final String PROP_CONFIG_SP_UNIQUEIDENTIFIER = EaafConfigConstants.SERVICE_UNIQUEIDENTIFIER; @@ -145,7 +145,7 @@ public class MsEidasNodeConstants { public static final String ENDPOINT_PVP_REDIRECT = "/pvp/redirect"; public static final String ENDPOINT_COUNTRYSELECTION = "/myHomeCountry"; - public static final String ENDPOINT_OTHERLOGINMETHODSELECTION = "/otherLoginMethod"; + public static final String ENDPOINT_OTHER_LOGIN_METHOD_SELECTION = "/otherLoginMethod"; public static final String ENDPOINT_RESIDENCY_INPUT = "/residency"; public static final String ENDPOINT_OTHER_CONTACTS_INPUT = "/otherContacts"; public static final String ENDPOINT_MONITORING_MONITOR = "/monitoring"; @@ -158,7 +158,7 @@ public class MsEidasNodeConstants { public static final String TEMPLATE_HTML_ERROR = "error_message.html"; public static final String TEMPLATE_HTML_PVP_POSTBINDING = "pvp2_post_binding.html"; public static final String TEMPLATE_HTML_COUNTRYSELECTION = "countrySelection.html"; - public static final String TEMPLATE_HTML_OTHERLOGINMETHODS = "chooseOtherLoginMethod.html"; + public static final String TEMPLATE_HTML_OTHERLOGINMETHODS = "other_login_method.html"; public static final String TEMPLATE_HTML_RESIDENCY = "residency.html"; public static final String TEMPLATE_HTML_OTHERCONTACTSWITHAUSTRIANEGOV = "otherContactsWithAustrianEgov.html"; // ************ execution context and generic data ************ @@ -182,5 +182,5 @@ public class MsEidasNodeConstants { private MsEidasNodeConstants() { //hidden Constructor for class with static values only. } - + } -- cgit v1.2.3 From cbf1d0408519d0763a1a87b733c16a1ba5d022ba Mon Sep 17 00:00:00 2001 From: Thomas <> Date: Wed, 7 Jul 2021 09:31:43 +0200 Subject: add HTML template for additional eID information --- connector_lib/pom.xml | 10 + .../gui/config/StaticResourceConfiguration.java | 207 +++++++++++++++++++++ .../src/main/resources/common_gui.beans.xml | 3 + 3 files changed, 220 insertions(+) create mode 100644 connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/config/StaticResourceConfiguration.java (limited to 'connector_lib') diff --git a/connector_lib/pom.xml b/connector_lib/pom.xml index 8ed561f3..a8a88e71 100644 --- a/connector_lib/pom.xml +++ b/connector_lib/pom.xml @@ -27,6 +27,14 @@ org.springframework spring-webmvc + + org.thymeleaf + thymeleaf-spring5 + + + org.hibernate.validator + hibernate-validator + javax.validation validation-api @@ -37,6 +45,8 @@ javax.servlet-api provided + + diff --git a/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/config/StaticResourceConfiguration.java b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/config/StaticResourceConfiguration.java new file mode 100644 index 00000000..1f357674 --- /dev/null +++ b/connector_lib/src/main/java/at/asitplus/eidas/specific/connector/gui/config/StaticResourceConfiguration.java @@ -0,0 +1,207 @@ +/* + * Copyright 2019 A-SIT Plus GmbH + * AT-specific eIDAS Connector has been developed in a cooperation between EGIZ, + * A-SIT Plus GmbH, A-SIT, and Graz University of Technology. + * + * Licensed under the EUPL, Version 1.2 or - as soon they will be approved by + * the European Commission - subsequent versions of the EUPL (the "License"); + * You may not use this work except in compliance with the License. + * You may obtain a copy of the License at: + * https://joinup.ec.europa.eu/news/understanding-eupl-v12 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" basis, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * This product combines work with different licenses. See the "NOTICE" text + * file for details on the various modules and licenses. + * The "NOTICE" text file is part of the distribution. Any derivative works + * that you distribute must include a readable copy of the "NOTICE" text file. + */ + +package at.asitplus.eidas.specific.connector.gui.config; + +import java.net.MalformedURLException; +import java.util.List; + +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.support.ReloadableResourceBundleMessageSource; +import org.springframework.web.servlet.config.annotation.EnableWebMvc; +import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; +import org.thymeleaf.templateresolver.FileTemplateResolver; + +import at.asitplus.eidas.specific.connector.MsEidasNodeConstants; +import at.gv.egiz.eaaf.core.api.idp.IConfiguration; +import at.gv.egiz.eaaf.core.api.logging.IMessageSourceLocation; +import at.gv.egiz.eaaf.core.impl.utils.FileUtils; + +/** + * Spring configurator for Web resources. + * + * @author tlenz + * + */ +@Configuration +@EnableWebMvc +public class StaticResourceConfiguration implements WebMvcConfigurer { + private static final Logger log = LoggerFactory.getLogger(StaticResourceConfiguration.class); + private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { + "/" + }; + + private static final String DEFAULT_MESSAGE_SOURCE = "classpath:properties/status_messages"; + + @Autowired + private IConfiguration basicConfig; + + @Override + public void addResourceHandlers(ResourceHandlerRegistry registry) { + final String staticResources = basicConfig.getBasicConfiguration( + MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_STATIC_PATH); + try { + if (StringUtils.isNotEmpty(staticResources)) { + String absPath = FileUtils.makeAbsoluteUrl(staticResources, basicConfig + .getConfigurationRootDirectory()); + if (!absPath.endsWith("/")) { + absPath += "/"; + } + + registry.addResourceHandler("/static/**").addResourceLocations(absPath); + log.info("Add Ressourcefolder: " + absPath + " for static Web content"); + + } else { + log.debug("No Ressourcefolder for static Web content"); + } + + } catch (final MalformedURLException e) { + log.warn("Can NOT initialize ressourcefolder for static Web content", e); + + } + + registry.addResourceHandler("/**").addResourceLocations(CLASSPATH_RESOURCE_LOCATIONS); + + } + + /** + * Get a message source with only internal message properties. + * + * @param ressourceLocations List of source-locations + * @return + */ + @Bean + public ReloadableResourceBundleMessageSource internalMessageSource( + @Autowired(required = false) final List ressourceLocations) { + final ReloadableResourceBundleMessageSource messageSource = + new ReloadableResourceBundleMessageSource(); + + // add default message source + messageSource.setBasename(DEFAULT_MESSAGE_SOURCE); + + if (ressourceLocations != null) { + // load more message sources + for (final IMessageSourceLocation el : ressourceLocations) { + if (el.getMessageSourceLocation() != null) { + for (final String source : el.getMessageSourceLocation()) { + messageSource.addBasenames(source); + log.debug("Add additional messageSources: {}", el.getMessageSourceLocation().toArray()); + + } + } + } + } + + messageSource.setDefaultEncoding("UTF-8"); + return messageSource; + + } + + /** + * Get full message source with internal and external message-properties files. + * + * @param ressourceLocations List of source-locations + * @return + */ + @Bean + public ReloadableResourceBundleMessageSource messageSource( + @Autowired(required = false) final List ressourceLocations) { + final ReloadableResourceBundleMessageSource messageSource = + new ReloadableResourceBundleMessageSource(); + messageSource.setDefaultEncoding("UTF-8"); + messageSource.setParentMessageSource(internalMessageSource(ressourceLocations)); + + final String staticResources = basicConfig + .getBasicConfiguration(MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_PROPERTIES_PATH); + try { + if (StringUtils.isNotEmpty(staticResources)) { + final String absPath = + FileUtils.makeAbsoluteUrl(staticResources, basicConfig.getConfigurationRootDirectory()); + messageSource.setBasename(absPath); + + } else { + log.debug("No Ressourcefolder for dynamic Web content templates"); + + } + + } catch (final MalformedURLException e) { + log.warn("Can NOT initialize ressourcefolder for dynamic Web content templates", e); + + } + + return messageSource; + + } + + /** + * Get a Tyhmeleaf Template-Resolver with external configuration path. + * + * @return + */ + @Bean(name = "templateResolver") + public FileTemplateResolver templateResolver() { + final String staticResources = basicConfig + .getBasicConfiguration(MsEidasNodeConstants.PROP_CONFIG_WEBCONTENT_TEMPLATES_PATH); + try { + if (StringUtils.isNotEmpty(staticResources)) { + String absPath = + FileUtils.makeAbsoluteUrl(staticResources, basicConfig.getConfigurationRootDirectory()); + if (!absPath.endsWith("/")) { + absPath += "/"; + + } + + if (absPath.startsWith("file:")) { + absPath = absPath.substring("file:".length()); + + } + + final FileTemplateResolver viewResolver = new FileTemplateResolver(); + viewResolver.setPrefix(absPath); + viewResolver.setSuffix(".html"); + viewResolver.setTemplateMode("HTML"); + viewResolver.setCacheable(false); + + log.info("Add Ressourcefolder: {} for dynamic Web content templates", absPath); + return viewResolver; + + } else { + log.debug("No Ressourcefolder for dynamic Web content templates"); + + } + + } catch (final MalformedURLException e) { + log.warn("Can NOT initialize ressourcefolder for dynamic Web content templates", e); + + } + + throw new RuntimeException("Can NOT initialize HTML template resolver"); + + } +} diff --git a/connector_lib/src/main/resources/common_gui.beans.xml b/connector_lib/src/main/resources/common_gui.beans.xml index 969a40f7..fc19efdc 100644 --- a/connector_lib/src/main/resources/common_gui.beans.xml +++ b/connector_lib/src/main/resources/common_gui.beans.xml @@ -11,6 +11,9 @@ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.0.xsd"> + + -- cgit v1.2.3