svn commit: r528016 - in /ofbiz/trunk/framework/webtools: config/WebtoolsUiLabels.properties webapp/webtools/WEB-INF/controller.xml webapp/webtools/cert/ webapp/webtools/cert/viewbrowsercerts.ftl webapp/webtools/main.ftl widget/CommonScreens.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r528016 - in /ofbiz/trunk/framework/webtools: config/WebtoolsUiLabels.properties webapp/webtools/WEB-INF/controller.xml webapp/webtools/cert/ webapp/webtools/cert/viewbrowsercerts.ftl webapp/webtools/main.ftl widget/CommonScreens.xml

jaz-3
Author: jaz
Date: Thu Apr 12 09:32:48 2007
New Revision: 528016

URL: http://svn.apache.org/viewvc?view=rev&rev=528016
Log:
added view MY browser certs in webtools; helps to debug and check x509 issues

Added:
    ofbiz/trunk/framework/webtools/webapp/webtools/cert/
    ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl   (with props)
Modified:
    ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties
    ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
    ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl
    ofbiz/trunk/framework/webtools/widget/CommonScreens.xml

Modified: ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties?view=diff&rev=528016&r1=528015&r2=528016
==============================================================================
--- ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties (original)
+++ ofbiz/trunk/framework/webtools/config/WebtoolsUiLabels.properties Thu Apr 12 09:32:48 2007
@@ -191,6 +191,7 @@
 WebtoolsMissesSoftReference=Soft Reference
 WebtoolsMode=Mode
 WebtoolsMostlyInserts=Mostly Inserts?
+WebtoolsMyCertificates=My Certificates
 WebtoolsNameOrRole=Name or Role
 WebtoolsNoParametersDefined=No parameters defined
 WebtoolsNoServicesFound=No services found

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml?view=diff&rev=528016&r1=528015&r2=528016
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/WEB-INF/controller.xml Thu Apr 12 09:32:48 2007
@@ -484,6 +484,12 @@
         <response name="error" type="view" value="EntitySyncStatus"/>
     </request-map>
 
+    <!-- cert requests -->
+    <request-map uri="myCertificates">
+        <security https="true"/>
+        <response name="success" type="view" value="viewbrowsercerts"/>
+    </request-map>
+
     <!-- printing requests -->
     <request-map uri="print">
         <event type="java" path="org.ofbiz.webtools.print.rmi.FopPrintServer" invoke="readFopPrintServerSettings"/>
@@ -603,5 +609,8 @@
     <view-map name="EntityImportReaders" page="component://webtools/widget/EntityScreens.xml#EntityImportReaders" type="screen"/>
     
     <view-map name="ViewComponents" page="component://webtools/widget/MiscScreens.xml#ViewComponents" type="screen"/>
+
+    <!-- cert views -->
+    <view-map name="viewbrowsercerts" type="screen" page="component://webtools/widget/CommonScreens.xml#browsercerts"/>
     <!-- end of view mappings -->
 </site-conf>

Added: ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl?view=auto&rev=528016
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl (added)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl Thu Apr 12 09:32:48 2007
@@ -0,0 +1,52 @@
+<#--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+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.
+-->
+
+<#assign isSecure = request.isSecure()/>
+<#assign clientCerts = request.getAttribute("javax.servlet.request.X509Certificate")?if_exists/>
+<#if (!clientCerts?has_content)>
+    <#assign clientCerts = request.getAttribute("javax.net.ssl.peer_certificates")?if_exists/>
+</#if>
+
+<#if (isSecure)>
+    <#if (clientCerts?has_content)>
+        <#list clientCerts as cert>
+            <#assign certString = Static["org.ofbiz.base.util.KeyStoreUtil"].certToString(cert)?if_exists>
+            <#if (certString?has_content)>            
+                <div style="width: 60%">
+                    <div><b>Cert: ${cert.getType()} : ${cert.getSubjectX500Principal()}</b></div>
+                    <div><b>Serial Number: ${cert.getSerialNumber().toString(16)}</b></div>
+
+                    <textarea class="textBox" rows="4" cols="130">
+${certString}
+
+-----BEGIN PUBLIC KEY HEX-----
+${Static["org.ofbiz.base.util.KeyStoreUtil"].pemToPkHex(certString)}
+-----END PUBLIC KEY HEX-----
+
+                    </textarea>
+                </div>
+                <br>
+            </#if>
+        </#list>
+    <#else>
+         <p>No client certifications found.</p>
+    </#if>
+<#else>
+    <p>request can only obtain certifications when calls through SSL</p>
+</#if>
\ No newline at end of file

Propchange: ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/framework/webtools/webapp/webtools/cert/viewbrowsercerts.ftl
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl?view=diff&rev=528016&r1=528015&r2=528016
==============================================================================
--- ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl (original)
+++ ofbiz/trunk/framework/webtools/webapp/webtools/main.ftl Thu Apr 12 09:32:48 2007
@@ -125,6 +125,8 @@
           <li><h3>${uiLabelMap.WebtoolsServerHitStatisticsTools}</h3></li>
           <li><a href="<@ofbizUrl>StatsSinceStart</@ofbizUrl>">${uiLabelMap.WebtoolsStatsSinceServerStart}</a></li>
         </#if>
+        <li><h3>x.509 Certificates</h3></li>
+        <li><a href="<@ofbizUrl>myCertificates</@ofbizUrl>">${uiLabelMap.WebtoolsMyCertificates}</a></li>
       </ul>
     </#if>
     <br />

Modified: ofbiz/trunk/framework/webtools/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/CommonScreens.xml?view=diff&rev=528016&r1=528015&r2=528016
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/CommonScreens.xml Thu Apr 12 09:32:48 2007
@@ -88,4 +88,17 @@
             </widgets>
         </section>
     </screen>
+    <screen name="browsercerts">
+        <section>
+            <widgets>
+                <decorator-screen name="CommonWebtoolsDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <platform-specific>
+                            <html><html-template location="component://webtools/webapp/webtools/cert/viewbrowsercerts.ftl"/></html>
+                        </platform-specific>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
 </screens>