cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niclas Hedhman <>
Subject ClientAddressChooser
Date Wed, 05 Jul 2000 07:32:47 GMT

My first try to put together a Chooser, and I selected to do one for
ClientAddress validation.

There is one thing that comes into view though.
IMO, this should not be aware of Http being the transport. But there is
no parameter or method in Request that gives me this, so I have taken
the liberty (awaiting something else) to define that "client-address"
parameter is known by the Request object, and that it returns a String
with the hostname followed by the ipnumber, separated by a slash. eg.
If the slash is not present, it assumes it to be an IP number is the
first character is a digit, otherwise a host name.

Hostnames are matched to the domain/host names in the allow and deny
sections, by check-and-remove-left sequence, and IP number is by
check-and-remove-right. It means that if you give;
<host>202.190.60</host>, all hosts from to
is matched true.

In the Sitemap;

   <map:chooser type="clientaddress"
     <param name="order" value="allow,deny" />
     <param name="all" value="false" />

and usage
<map:choose type="clientaddress" >
  <map:when test="allow()" >

I hope I have attacked this in the proper way, and awaiting some

There is a test part at the bottom for the Chooser, which is not
prudently written...


View raw message