[java-identity-provider] branch master updated: IDP-1126 - Validation and testing features focused on new deployers

Scott Cantor cantor.2 at osu.edu
Fri Jun 19 18:32:47 UTC 2020


This is an automated email from the git hooks/post-receive script.

scantor pushed a commit to branch master
in repository java-identity-provider.

View the commit online:
http://git.shibboleth.net/view/?p=java-identity-provider.git;a=commit;h=42572080f64af867813f0f9e29109f9f28e4896f

The following commit(s) were added to refs/heads/master by this push:
       new  42572080f IDP-1126 - Validation and testing features focused on new deployers
42572080f is described below

commit 42572080f64af867813f0f9e29109f9f28e4896f
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Jun 19 14:32:44 2020 -0400

    IDP-1126 - Validation and testing features focused on new deployers
    
    https://issues.shibboleth.net/jira/browse/IDP-1126
    
    New hello world admin flow for testing authn.
---
 .../main/resources/conf/admin/general-admin.xml    | 27 ++++++++----
 .../main/resources/system/conf/webflow-config.xml  |  1 +
 .../resources/system/flows/admin/hello-beans.xml   | 49 ++++++++++++++++++++++
 .../resources/system/flows/admin/hello-flow.xml    | 44 +++++++++++++++++++
 .../resources/system/messages/messages.properties  |  5 +++
 idp-conf/src/main/resources/views/admin/hello.vm   | 48 +++++++++++++++++++++
 6 files changed, 166 insertions(+), 8 deletions(-)

diff --git a/idp-conf/src/main/resources/conf/admin/general-admin.xml b/idp-conf/src/main/resources/conf/admin/general-admin.xml
index 2814bf629..cdb4110a9 100644
--- a/idp-conf/src/main/resources/conf/admin/general-admin.xml
+++ b/idp-conf/src/main/resources/conf/admin/general-admin.xml
@@ -41,25 +41,36 @@
             c:id="http://shibboleth.net/ns/profiles/mdquery"
             p:loggingId="MetadataQuery"
             p:policyName="AccessByIPAddress" />
+    
+        <!-- REST Interface to Metrics -->
+        <bean parent="shibboleth.AdminFlow"
+            c:id="http://shibboleth.net/ns/profiles/metrics"
+            p:loggingId="Metrics"
+            p:policyNameLookupStrategy-ref="shibboleth.metrics.AccessPolicyStrategy" />
+
+        <!-- Hello World -->
+        <bean parent="shibboleth.AdminFlow"
+            c:id="http://shibboleth.net/ns/profiles/hello"
+            p:loggingId="Hello"
+            p:authenticated="true"
+            p:policyName="AccessByAdminUser" />
 
         <!-- REST AccountLockoutManager Access -->
+        <!--
         <bean parent="shibboleth.AdminFlow"
             c:id="http://shibboleth.net/ns/profiles/lockout-manager"
             p:loggingId="Lockout"
             p:policyName="AccessByIPAddress" />
-
+        -->
+        
         <!-- REST StorageService Access -->
+        <!--
         <bean parent="shibboleth.AdminFlow"
             c:id="http://shibboleth.net/ns/profiles/storage"
             p:loggingId="Storage"
             p:policyName="AccessByIPAddress" />
-    
-        <!-- REST Interface to Metrics -->
-        <bean parent="shibboleth.AdminFlow"
-            c:id="http://shibboleth.net/ns/profiles/metrics"
-            p:loggingId="Metrics"
-            p:policyNameLookupStrategy-ref="shibboleth.metrics.AccessPolicyStrategy" />
-
+        -->
+        
         <!-- Attended Startup Unlock -->
         <!--
         <bean parent="shibboleth.OneTimeAdminFlow"
diff --git a/idp-conf/src/main/resources/system/conf/webflow-config.xml b/idp-conf/src/main/resources/system/conf/webflow-config.xml
index 69b5757ea..4cac85aeb 100644
--- a/idp-conf/src/main/resources/system/conf/webflow-config.xml
+++ b/idp-conf/src/main/resources/system/conf/webflow-config.xml
@@ -23,6 +23,7 @@
                 <entry key="status" value="../system/flows/admin/status-flow.xml" />
         
                 <!-- Administrative and debugging flows. -->
+                <entry key="admin/hello" value="../system/flows/admin/hello-flow.xml" />
                 <entry key="admin/resolvertest" value="../system/flows/admin/resolvertest-flow.xml" />
                 <entry key="admin/reload-service" value="../system/flows/admin/reload-service-flow.xml" />
                 <entry key="admin/reload-metadata" value="../system/flows/admin/reload-metadata-flow.xml" />
diff --git a/idp-conf/src/main/resources/system/flows/admin/hello-beans.xml b/idp-conf/src/main/resources/system/flows/admin/hello-beans.xml
new file mode 100644
index 000000000..f8f6d34f3
--- /dev/null
+++ b/idp-conf/src/main/resources/system/flows/admin/hello-beans.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans
+    xmlns="http://www.springframework.org/schema/beans"
+    xmlns:c="http://www.springframework.org/schema/c"
+    xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:p="http://www.springframework.org/schema/p"
+    xmlns:util="http://www.springframework.org/schema/util"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+                           http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
+                           http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"
+    default-init-method="initialize"
+    default-destroy-method="destroy">
+
+    <bean class="org.springframework.context.support.PropertySourcesPlaceholderConfigurer"
+        p:placeholderPrefix="%{" p:placeholderSuffix="}" />
+
+    <import resource="admin-abstract-beans.xml" />
+
+    <!-- Profile ID for flow. -->    
+    <bean id="shibboleth.AdminProfileId" class="java.lang.String" c:_0="http://shibboleth.net/ns/profiles/hello" />
+    
+    <!-- Default operation/resource suppliers for access checks. -->
+
+    <bean id="shibboleth.AdminOperationLookupStrategy" parent="shibboleth.Functions.Constant" c:target="hello" />
+        
+    <bean id="shibboleth.AdminResourceLookupStrategy"
+        class="net.shibboleth.idp.profile.context.navigate.SpringExpressionContextLookupFunction"
+        c:inClass="#{T(org.opensaml.profile.context.ProfileRequestContext)}"
+        c:outputType="#{T(java.lang.String)}"
+        c:expression="'subject/' + #custom.apply(#input)">
+        <property name="customObject">
+            <bean parent="shibboleth.Functions.Compose"
+                c:g-ref="shibboleth.PrincipalNameLookup.Subject"
+                c:f-ref="shibboleth.ChildLookup.SubjectContext" />
+        </property>    
+    </bean>
+    
+    <!--  Work beans. -->
+    
+    <bean id="ScriptedAction" class="net.shibboleth.idp.profile.ScriptedAction" factory-method="resourceScript" scope="prototype">
+        <constructor-arg>
+            <bean class="net.shibboleth.ext.spring.resource.ConditionalResource"
+                c:_0="%{idp.home}/conf/admin/hello-world.js"
+                p:defaultContent="null;" />
+        </constructor-arg>
+    </bean>
+
+</beans>
diff --git a/idp-conf/src/main/resources/system/flows/admin/hello-flow.xml b/idp-conf/src/main/resources/system/flows/admin/hello-flow.xml
new file mode 100644
index 000000000..4fec0671b
--- /dev/null
+++ b/idp-conf/src/main/resources/system/flows/admin/hello-flow.xml
@@ -0,0 +1,44 @@
+<flow xmlns="http://www.springframework.org/schema/webflow"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://www.springframework.org/schema/webflow http://www.springframework.org/schema/webflow/spring-webflow.xsd"
+    parent="admin.abstract">
+
+    <!-- Start action. -->
+        
+    <action-state id="InitializeProfileRequestContext">
+        <evaluate expression="InitializeProfileRequestContext" />
+        <evaluate expression="FlowStartPopulateAuditContext" />
+        <evaluate expression="'proceed'" />
+        
+        <!-- Branch to determine if authentication is required. -->
+        <transition on="proceed" to="DoAdminPreamble" />
+    </action-state>
+
+    <!-- Resume actual flow processing. -->
+
+    <action-state id="DoProfileWork">
+        <evaluate expression="CheckAccess" />
+        <evaluate expression="ScriptedAction" />
+        <evaluate expression="'proceed'" />
+        
+        <transition on="proceed" to="end" />
+    </action-state>
+
+    <!-- Terminus -->
+
+    <end-state id="end" view="admin/hello">
+        <on-entry>
+            <evaluate expression="WriteAuditLog" />
+            <evaluate expression="environment" result="requestScope.environment" />
+            <evaluate expression="opensamlProfileRequestContext" result="requestScope.profileRequestContext" />
+            <evaluate expression="opensamlProfileRequestContext.getSubcontext(T(net.shibboleth.idp.authn.context.SubjectContext))" result="requestScope.subjectContext" />
+            <evaluate expression="T(net.shibboleth.utilities.java.support.codec.HTMLEncoder)" result="requestScope.encoder" />
+            <evaluate expression="flowRequestContext.getExternalContext().getNativeRequest()" result="requestScope.request" />
+            <evaluate expression="flowRequestContext.getExternalContext().getNativeResponse()" result="requestScope.response" />
+            <evaluate expression="flowRequestContext.getActiveFlow().getApplicationContext().containsBean('shibboleth.CustomViewContext') ? flowRequestContext.getActiveFlow().getApplicationContext().getBean('shibboleth.CustomViewContext') : null" result="requestScope.custom" />
+        </on-entry>
+    </end-state>
+    
+    <bean-import resource="hello-beans.xml" />
+
+</flow>
diff --git a/idp-conf/src/main/resources/system/messages/messages.properties b/idp-conf/src/main/resources/system/messages/messages.properties
index 78b20fb66..a20a987ce 100644
--- a/idp-conf/src/main/resources/system/messages/messages.properties
+++ b/idp-conf/src/main/resources/system/messages/messages.properties
@@ -202,6 +202,11 @@ idp.unlock-keys.cancel = Cancel
 idp.unlock-keys.complete = The system is unlocked and ready for use.
 idp.unlock-keys.error = Unlock failed; check log for specific message.
 
+# General messages related to Hello World admin flow
+idp.hello-world.title = Hello World
+idp.hello-world.greeting = Greetings
+idp.hello-world.reload = Reload the Page
+
 # Triples consisting of a TOU key, and a title and text for each set of terms.
 # The default implementation uses the SP name as the key, but this can be overriden.
 
diff --git a/idp-conf/src/main/resources/views/admin/hello.vm b/idp-conf/src/main/resources/views/admin/hello.vm
new file mode 100644
index 000000000..c2898f37d
--- /dev/null
+++ b/idp-conf/src/main/resources/views/admin/hello.vm
@@ -0,0 +1,48 @@
+##
+## 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
+## 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">
+        <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">
+          <p>#springMessageText("hello-world.greeting", "Greetings"), $encoder.encodeForHTML($subjectContext.getPrincipalName())</p>
+          
+        </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>

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the commits mailing list