-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from docker/4.1.2_20210611
minor change to tests
- Loading branch information
Showing
13 changed files
with
794 additions
and
9 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
73 changes: 73 additions & 0 deletions
73
test-compose/idp/container_files/config/shib-idp/views/admin/hello.vm
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,73 @@ | ||
## | ||
## Velocity Template for Hello World page. | ||
## | ||
## Velocity context will contain the following properties | ||
## flowRequestContext - the Spring Web Flow RequestContext | ||
## encoder - HTMLEncoder class | ||
## request - HttpServletRequest | ||
## response - HttpServletResponse | ||
## profileRequestContext - root of context tree | ||
## subjectContext - ProfileRequestContext -> SubjectContext | ||
## attributeContext - ProfileRequestContext -> AttributeContext | ||
## environment - Spring Environment object for property resolution | ||
## custom - arbitrary object injected by deployer | ||
## | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>#springMessageText("idp.title", "Web Login Service") - #springMessageText("hello-world.title", "Hello World")</title> | ||
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/main.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="wrapper"> | ||
<div class="container" style="width: 100%"> | ||
<header> | ||
<img src="$request.getContextPath()#springMessage("idp.logo")" alt="#springMessageText("idp.logo.alt-text", "logo")"> | ||
<h3>#springMessageText("idp.title", "Web Login Service")</h3> | ||
</header> | ||
|
||
<div class="content"> | ||
<h4>#springMessageText("hello-world.greeting", "Greetings"), <em>$encoder.encodeForHTML($subjectContext.getPrincipalName())</em></h4> | ||
<br/> | ||
<h4>Authenticated By</h4> | ||
#foreach ($result in $subjectContext.getAuthenticationResults().entrySet()) | ||
<blockquote>$encoder.encodeForHTML($result.getKey())</blockquote> | ||
#end | ||
<br/> | ||
<h4>Java Principals in Subjects</h4> | ||
#foreach ($s in $subjectContext.getSubjects()) | ||
#foreach ($p in $s.getPrincipals()) | ||
<blockquote>$encoder.encodeForHTML($p)<blockquote> | ||
#end | ||
#end | ||
#if ($attributeContext && !$attributeContext.getUnfilteredIdPAttributes().isEmpty()) | ||
<br/> | ||
<h4>Attributes:</h4> | ||
#foreach ($a in $attributeContext.getUnfilteredIdPAttributes()) | ||
#if (!$a.getValues().isEmpty()) | ||
<br/> | ||
<h5>$encoder.encodeForHTML($a.getId())</h5> | ||
#foreach ($v in $a.getValues()) | ||
<blockquote>$encoder.encodeForHTML($v.getDisplayValue())</blockquote> | ||
#end | ||
#end | ||
#end | ||
#end | ||
</div> | ||
|
||
<header> | ||
<h3><a href="$request.getContextPath()/profile/admin/hello">#springMessageText("hello-world.reload", "Reload the Page")</a></h3> | ||
</header> | ||
</div> | ||
|
||
<footer> | ||
<div class="container container-footer"> | ||
<p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p> | ||
</div> | ||
</footer> | ||
</div> | ||
</body> | ||
</html> |
53 changes: 53 additions & 0 deletions
53
test-compose/idp/container_files/config/shib-idp/views/client-storage/client-storage-read.vm
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,53 @@ | ||
## | ||
## Velocity template to read from local storage. | ||
## | ||
## Velocity context will contain the following properties | ||
## flowExecutionUrl - the form action location | ||
## flowRequestContext - the Spring Web Flow RequestContext | ||
## flowExecutionKey - the SWF execution key (this is built into the flowExecutionUrl) | ||
## profileRequestContext - root of context tree | ||
## loadContext - context with details about the storage keys to load | ||
## encoder - HTMLEncoder class | ||
## request - HttpServletRequest | ||
## response - HttpServletResponse | ||
## environment - Spring Environment object for property resolution | ||
#set ($title = $springMacroRequestContext.getMessage("idp.title", "Web Login Service")) | ||
#set ($titleSuffix = $springMacroRequestContext.getMessage("idp.client-storage-read.suffix", "Loading Session Information")) | ||
## | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>$title - $titleSuffix</title> | ||
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/main.css"> | ||
<script> | ||
<!-- | ||
#include( "client-storage/local-storage-read.js" ) | ||
// --> | ||
</script> | ||
</head> | ||
<body onload="doLoad()"> | ||
<div class="wrapper"> | ||
<div class="container"> | ||
<header> | ||
<h3>$title - $titleSuffix</h3> | ||
</header> | ||
<div class="content"> | ||
$springMacroRequestContext.getMessage("idp.client-storage-read.text", "Loading login session information from the browser...") | ||
</div> | ||
<noscript> | ||
<div class="content"> | ||
$springMacroRequestContext.getMessage("idp.client-storage.no-js", "Since your browser does not support JavaScript, you must press the Continue button once to proceed.") | ||
</div> | ||
</noscript> | ||
#parse( "client-storage/read.vm" ) | ||
</div> | ||
<footer> | ||
<div class="container container-footer"> | ||
<p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p> | ||
</div> | ||
</footer> | ||
</div> | ||
</body> | ||
</html> |
53 changes: 53 additions & 0 deletions
53
...-compose/idp/container_files/config/shib-idp/views/client-storage/client-storage-write.vm
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,53 @@ | ||
## | ||
## Velocity template to write to local storage. | ||
## | ||
## Velocity context will contain the following properties | ||
## flowExecutionUrl - the form action location | ||
## flowRequestContext - the Spring Web Flow RequestContext | ||
## flowExecutionKey - the SWF execution key (this is built into the flowExecutionUrl) | ||
## profileRequestContext - root of context tree | ||
## saveContext - context with details about the storage data to save | ||
## encoder - HTMLEncoder class | ||
## request - HttpServletRequest | ||
## response - HttpServletResponse | ||
## environment - Spring Environment object for property resolution | ||
#set ($title = $springMacroRequestContext.getMessage("idp.title", "Web Login Service")) | ||
#set ($titleSuffix = $springMacroRequestContext.getMessage("idp.client-storage-write.suffix", "Saving Session Information...")) | ||
## | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> | ||
<head> | ||
<meta charset="utf-8" /> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>$title - $titleSuffix</title> | ||
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/main.css"> | ||
<script> | ||
<!-- | ||
#include( "client-storage/local-storage-write.js" ) | ||
// --> | ||
</script> | ||
</head> | ||
<body onload="doSave()"> | ||
<div class="wrapper"> | ||
<div class="container"> | ||
<header> | ||
<h3>$title - $titleSuffix</h3> | ||
</header> | ||
<div class="content"> | ||
$springMacroRequestContext.getMessage("idp.client-storage-write.text", "Saving login session information to the browser...") | ||
</div> | ||
<noscript> | ||
<div class="content"> | ||
$springMacroRequestContext.getMessage("idp.client-storage.no-js", "Since your browser does not support JavaScript, you must press the Continue button once to proceed.") | ||
</div> | ||
</noscript> | ||
#parse( "client-storage/write.vm" ) | ||
</div> | ||
<footer> | ||
<div class="container container-footer"> | ||
<p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p> | ||
</div> | ||
</footer> | ||
</div> | ||
</body> | ||
</html> |
75 changes: 75 additions & 0 deletions
75
test-compose/idp/container_files/config/shib-idp/views/error.vm
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,75 @@ | ||
## | ||
## Velocity Template for error end-state | ||
## | ||
## Velocity context will contain the following properties | ||
## flowRequestContext - the Spring Web Flow RequestContext | ||
## profileRequestContext - root of context tree | ||
## encoder - HTMLEncoder class | ||
## request - HttpServletRequest | ||
## response - HttpServletResponse | ||
## environment - Spring Environment object for property resolution | ||
## custom - arbitrary object injected by deployer | ||
## | ||
#set ($title = $springMacroRequestContext.getMessage("idp.title", "Web Login Service")) | ||
#set ($defaultTitleSuffix = $springMacroRequestContext.getMessage("idp.title.suffix", "Error")) | ||
## | ||
#if ($flowRequestContext) | ||
## This handles flow events, the most common case. | ||
#set ($eventId = $flowRequestContext.getCurrentEvent().getId()) | ||
#set ($eventKey = $springMacroRequestContext.getMessage("$eventId", "error")) | ||
#set ($titleSuffix = $springMacroRequestContext.getMessage("${eventKey}.title", "$defaultTitleSuffix")) | ||
#set ($message = $springMacroRequestContext.getMessage("${eventKey}.message", "$defaultTitleSuffix: $eventId")) | ||
#if ($eventId == "AccessDenied" or $eventId == "ContextCheckDenied") | ||
$response.setStatus(403) | ||
#elseif ($eventId == "AttributeReleaseRejected" || $eventId == "TermsRejected") | ||
$response.setStatus(200) | ||
#elseif ($eventKey == "unexpected" || $eventKey == "runtime-error" || $eventKey == "error") | ||
$response.setStatus(500) | ||
#else | ||
$response.setStatus(400) | ||
#end | ||
#elseif ($exception) | ||
## This handles exceptions that reach the Spring-MVC exception handler. | ||
#set ($eventId = $exception.getClass().getSimpleName()) | ||
#set ($eventKey = $springMacroRequestContext.getMessage("$eventId", "error")) | ||
#set ($titleSuffix = $springMacroRequestContext.getMessage("${eventKey}.title", "$defaultTitleSuffix")) | ||
#set ($message = $springMacroRequestContext.getMessage("${eventKey}.message", "$defaultTitleSuffix: $eventId")) | ||
$response.setStatus(500) | ||
#else | ||
## This is a catch-all that theoretically shouldn't happen? | ||
#set ($titleSuffix = $defaultTitleSuffix) | ||
#set ($message = $springMacroRequestContext.getMessage("idp.message", "An unidentified error occurred.")) | ||
$response.setStatus(500) | ||
#end | ||
## | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> | ||
<title>$title - $titleSuffix</title> | ||
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/css/main.css"> | ||
</head> | ||
|
||
<body> | ||
<div class="wrapper"> | ||
<div class="container"> | ||
<header> | ||
<img src="$request.getContextPath()#springMessage("idp.logo")" alt="#springMessageText("idp.logo.alt-text", "logo")"> | ||
<h3>$title - $titleSuffix</h3> | ||
</header> | ||
|
||
<div class="content"> | ||
#evaluate($message) | ||
</div> | ||
</div> | ||
|
||
<footer> | ||
<div class="container container-footer"> | ||
<p class="footer-text">#springMessageText("idp.footer", "Insert your footer text here.")</p> | ||
</div> | ||
</footer> | ||
|
||
</div> | ||
</body> | ||
</html> |
26 changes: 26 additions & 0 deletions
26
test-compose/idp/container_files/config/shib-idp/views/login-error.vm
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,26 @@ | ||
## Velocity Template for login error message production, included by login.vm | ||
## | ||
## authenticationErrorContext - context containing error data, if available | ||
## | ||
#if ($authenticationErrorContext && $authenticationErrorContext.getClassifiedErrors().size() > 0) | ||
## This handles errors that are classified by the message maps in the authentication config. | ||
#set ($eventId = $authenticationErrorContext.getClassifiedErrors().iterator().next()) | ||
#if ($eventId != "ReselectFlow") | ||
#set ($eventKey = $springMacroRequestContext.getMessage("$eventId", "login")) | ||
#set ($message = $springMacroRequestContext.getMessage("${eventKey}.message", "Login Failure: $eventId")) | ||
#end | ||
#elseif ($authenticationErrorContext && $authenticationErrorContext.getExceptions().size() > 0) | ||
## This handles login exceptions that are left unclassified. | ||
#set ($loginException = $authenticationErrorContext.getExceptions().get(0)) | ||
#if ($loginException.getMessage()) | ||
#set ($message = "Login Failure: $loginException.getMessage()") | ||
#else | ||
#set ($message = $loginException.toString()) | ||
#end | ||
#end | ||
|
||
#if ($message) | ||
<section> | ||
<p class="form-element form-error">$encoder.encodeForHTML($message)</p> | ||
</section> | ||
#end |
Oops, something went wrong.