-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
197 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
64 changes: 64 additions & 0 deletions
64
...src/main/java/de/governikus/eumw/configuration/wizard/web/model/GlobalModelAttribute.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
package de.governikus.eumw.configuration.wizard.web.model; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.springframework.web.bind.annotation.ControllerAdvice; | ||
import org.springframework.web.bind.annotation.ModelAttribute; | ||
|
||
import de.governikus.eumw.configuration.wizard.identifier.HSMTypeIdentifier; | ||
import de.governikus.eumw.configuration.wizard.web.utils.WizardPage; | ||
|
||
|
||
@ControllerAdvice | ||
public class GlobalModelAttribute | ||
{ | ||
|
||
@ModelAttribute("BASE_PATH_VIEW") | ||
public WizardPage basePathView() | ||
{ | ||
return WizardPage.BASE_PATH_VIEW; | ||
} | ||
|
||
@ModelAttribute("UPLOAD_CONFIG_PROPERTIES_VIEW") | ||
public WizardPage uploadConfigPropertiesView() | ||
{ | ||
return WizardPage.UPLOAD_CONFIG_PROPERTIES_VIEW; | ||
} | ||
|
||
@ModelAttribute("APPLICATION_PROPERTIES_VIEW") | ||
public WizardPage applicationPropertiesView() | ||
{ | ||
return WizardPage.APPLICATION_PROPERTIES_VIEW; | ||
} | ||
|
||
@ModelAttribute("POSEIDAS_CORE_VIEW") | ||
public WizardPage poseidasCoreView() | ||
{ | ||
return WizardPage.POSEIDAS_CORE_VIEW; | ||
} | ||
|
||
@ModelAttribute("EIDAS_PROPERTIES_VIEW") | ||
public WizardPage eidasPropertiesView() | ||
{ | ||
return WizardPage.EIDAS_PROPERTIES_VIEW; | ||
} | ||
|
||
@ModelAttribute("SAVE_LOCATION_VIEW") | ||
public WizardPage saveLocationView() | ||
{ | ||
return WizardPage.SAVE_LOCATION_VIEW; | ||
} | ||
|
||
@ModelAttribute("NUMBER_OF_PAGES") | ||
public int numberOfPages() | ||
{ | ||
return WizardPage.values().length; | ||
} | ||
|
||
@ModelAttribute("HSM_TYPE_IDENTIFIER") | ||
public List<HSMTypeIdentifier> hsmTypeIdentifier() | ||
{ | ||
return Arrays.asList(HSMTypeIdentifier.values()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
...izard/src/test/java/de/governikus/eumw/configuration/wizard/springboot/SessionFilter.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/* | ||
* Copyright (c) 2021 Governikus KG. Licensed under the EUPL, Version 1.2 or as soon they will be approved by the | ||
* European Commission - subsequent versions of the EUPL (the "Licence"); You may not use this work except in compliance | ||
* with the Licence. You may obtain a copy of the Licence at: http://joinup.ec.europa.eu/software/page/eupl Unless | ||
* required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an | ||
* "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence for the | ||
* specific language governing permissions and limitations under the Licence. | ||
*/ | ||
|
||
package de.governikus.eumw.configuration.wizard.springboot; | ||
|
||
import java.io.IOException; | ||
|
||
import javax.servlet.FilterChain; | ||
import javax.servlet.ServletException; | ||
import javax.servlet.http.HttpServletRequest; | ||
import javax.servlet.http.HttpServletResponse; | ||
|
||
import org.springframework.stereotype.Component; | ||
import org.springframework.web.filter.OncePerRequestFilter; | ||
|
||
|
||
/** | ||
* While testing with the HTMLUnit-Framework, sometimes the URL parameter JSESSIONID is appended to the RequestURL, | ||
* which leads to errors. This filter removes the JSESSIONID parameter. | ||
*/ | ||
@Component | ||
public class SessionFilter extends OncePerRequestFilter | ||
{ | ||
|
||
@Override | ||
protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain filterChain) | ||
throws ServletException, IOException | ||
{ | ||
logger.debug("In SessionFilter"); | ||
if (request.getRequestURI().contains("jsessionid")) | ||
{ | ||
String newURI = request.getRequestURI().substring(0, request.getRequestURI().indexOf(";")); | ||
logger.debug("New RequestURL: " + newURI); | ||
|
||
request.getRequestDispatcher(newURI).forward(request, response); | ||
return; | ||
} | ||
filterChain.doFilter(request, response); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.