Skip to content

Commit

Permalink
Merge pull request #95 from docker/4.1.2_20210611
Browse files Browse the repository at this point in the history
minor change to tests
  • Loading branch information
pcaskey authored Jun 11, 2021
2 parents 64553d2 + 518950f commit ff6d6ed
Show file tree
Hide file tree
Showing 13 changed files with 794 additions and 9 deletions.
2 changes: 1 addition & 1 deletion test-compose/idp/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ADD ${TOMCERT} /opt/certs
ADD ${TOMWWWROOT} /usr/local/tomcat/webapps/ROOT
ADD ${SHBCFG} /opt/shibboleth-idp/conf
ADD ${SHBCREDS} /opt/shibboleth-idp/credentials
#ADD ${SHBVIEWS} /opt/shibboleth-idp/views
ADD ${SHBVIEWS} /opt/shibboleth-idp/views
#ADD ${SHBEDWAPP} /opt/shibboleth-idp/edit-webapp
#ADD ${SHBMSGS} /opt/shibboleth-idp/messages
ADD ${SHBMD} /opt/shibboleth-idp/metadata
Expand Down
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>
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>
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 test-compose/idp/container_files/config/shib-idp/views/error.vm
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>
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
Loading

0 comments on commit ff6d6ed

Please sign in to comment.