From: <bsc...@us...> - 2009-02-06 09:57:03
|
Revision: 4147 http://unicore.svn.sourceforge.net/unicore/?rev=4147&view=rev Author: bschuller Date: 2009-02-06 09:56:58 +0000 (Fri, 06 Feb 2009) Log Message: ----------- disable link to HTML registration form if registration feature is disabled; caseinsensitive aliases Modified Paths: -------------- gateway/trunk/Changes.txt gateway/trunk/src/main/java/eu/unicore/gateway/GatewayHandler.java gateway/trunk/src/main/java/eu/unicore/gateway/base/Servlet.java gateway/trunk/src/main/java/eu/unicore/gateway/client/AuthSSLProtocolSocketFactory.java gateway/trunk/src/main/resources/eu/unicore/gateway/resources/register.html Modified: gateway/trunk/Changes.txt =================================================================== --- gateway/trunk/Changes.txt 2009-02-05 23:29:00 UTC (rev 4146) +++ gateway/trunk/Changes.txt 2009-02-06 09:56:58 UTC (rev 4147) @@ -8,7 +8,9 @@ - bugfix: gateway will now listen only on the specified network interface, or, if "0.0.0.0" is used as host, on all interfaces - documentation on AJP/httpd configuration (contributed by Xavier Delaruelle) - + - remove link to registration HTML form if registration is disabled + - bugfix in keystore handling: use case-insensitive comparison of aliases + 6.1.3 - experimental support for "gateway plugins", for tunneling other protocols through the established SSL connection to the gateway Modified: gateway/trunk/src/main/java/eu/unicore/gateway/GatewayHandler.java =================================================================== --- gateway/trunk/src/main/java/eu/unicore/gateway/GatewayHandler.java 2009-02-05 23:29:00 UTC (rev 4146) +++ gateway/trunk/src/main/java/eu/unicore/gateway/GatewayHandler.java 2009-02-06 09:56:58 UTC (rev 4147) @@ -123,7 +123,7 @@ parseHeaders(exchange); //get the certpath of the ssl connection (null if not ssl connection) - final X509Certificate[] certa = (X509Certificate[])exchange.getProperty(MessageExchange.X509); + final X509Certificate[] certs = (X509Certificate[])exchange.getProperty(MessageExchange.X509); String destination = null; try @@ -142,7 +142,7 @@ { try { - writeToOutputStream(exchange, os, certa); + writeToOutputStream(exchange, os, certs); } catch (XMLStreamException e) { @@ -157,7 +157,7 @@ { // cache the request first ... slower but sometimes safer?! ByteArrayOutputStream baos = new ByteArrayOutputStream(); - writeToOutputStream(exchange, baos, certa); + writeToOutputStream(exchange, baos, certs); requestentity = new ByteArrayRequestEntity(baos.toByteArray()); } @@ -285,7 +285,7 @@ VSite vsite = this.organiser.match(address); if (vsite == null) { - throw new SoapFault("3",address + " destination not recognised"); + throw new SoapFault("3","Cannot send message to "+address + ", such a site is not registered with this gateway."); } return vsite.resolve(address); } Modified: gateway/trunk/src/main/java/eu/unicore/gateway/base/Servlet.java =================================================================== --- gateway/trunk/src/main/java/eu/unicore/gateway/base/Servlet.java 2009-02-05 23:29:00 UTC (rev 4146) +++ gateway/trunk/src/main/java/eu/unicore/gateway/base/Servlet.java 2009-02-06 09:56:58 UTC (rev 4147) @@ -156,16 +156,16 @@ PrintWriter out=res.getWriter(); //else show the gw default page res.setContentType("text/html"); - X509Certificate[] certa = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate"); + X509Certificate[] certs = (X509Certificate[]) req.getAttribute("javax.servlet.request.X509Certificate"); out.println("<html><link rel='stylesheet' type='text/css' href='resources/gateway.css'/>"+ "<title>UNICORE 6 Gateway</title><body>"); String top="<div id='header'><a href='http://www.unicore.eu'><img src='resources/unicore_logo.gif' border='0'/></a>" + "<br/> Gateway <br/>"; - if (certa != null) + if (certs != null) { - top+=("<p class='username'>You are authenticated as: <br/>"+certa[0].getSubjectDN() + "</p>"); + top+=("<p class='username'>You are authenticated as: <br/>"+certs[0].getSubjectDN() + "</p>"); } top+="</div>"; @@ -320,11 +320,13 @@ } private String getFooter(){ - String s="<div id='footer'><hr/> Up since: "+Gateway.upSince()+" " + - "<a href='resources/register.html'>register a site</a>" + - "</div>"; - return s; + StringBuilder sb=new StringBuilder(); + sb.append("<div id='footer'><hr/> Up since: ").append(Gateway.upSince()); + if(Gateway.isDynamicRegistrationEnabled()){ + sb.append(" <a href='resources/register.html'>register a site</a>"); + } + sb.append("</div>"); + return sb.toString(); } - } Modified: gateway/trunk/src/main/java/eu/unicore/gateway/client/AuthSSLProtocolSocketFactory.java =================================================================== --- gateway/trunk/src/main/java/eu/unicore/gateway/client/AuthSSLProtocolSocketFactory.java 2009-02-05 23:29:00 UTC (rev 4146) +++ gateway/trunk/src/main/java/eu/unicore/gateway/client/AuthSSLProtocolSocketFactory.java 2009-02-06 09:56:58 UTC (rev 4147) @@ -109,7 +109,7 @@ List<String> delete=new ArrayList<String>(); while(en.hasMoreElements()){ String a=en.nextElement(); - if(!alias.equals(a) && keystore.isKeyEntry(a)){ + if(!alias.equalsIgnoreCase(a) && keystore.isKeyEntry(a)){ LOG.debug("Deleting non-needed key "+a); delete.add(a); } Modified: gateway/trunk/src/main/resources/eu/unicore/gateway/resources/register.html =================================================================== --- gateway/trunk/src/main/resources/eu/unicore/gateway/resources/register.html 2009-02-05 23:29:00 UTC (rev 4146) +++ gateway/trunk/src/main/resources/eu/unicore/gateway/resources/register.html 2009-02-06 09:56:58 UTC (rev 4147) @@ -1,12 +1,9 @@ <html><link rel='stylesheet' type='text/css' href='/resources/gateway.css'/> <body><title>UNICORE 6 Gateway: Register a site</title> - <div id='content'> <b class='rtop'><b class='r1'></b><b class='r2'> </b> <b class='r3'></b> <b class='r4'></b></b> - <h1>Register a Vsite</h1> - <form method="POST" action="/VSITE_REGISTRATION_REQUEST"> <table> <tr><td> Name: </td><td><input type="text" name="name" size="80"/> </td></tr> @@ -16,13 +13,10 @@ </form> <b class=<'rbottom'><b class='r4'></b> <b class='r3'></b> <b class='r2'></b> <b class='r1'></b></b> </div> - <div id='content'> <b class='rtop'><b class='r1'></b><b class='r2'> </b> <b class='r3'></b> <b class='r4'></b></b> <b>Note</b> This registration is temporary, and will be deleted when the gateway is restarted! - <b class=<'rbottom'><b class='r4'></b> <b class='r3'></b> <b class='r2'></b> <b class='r1'></b></b> </div> - </body></html> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |