[Catalyst] Encrypt /Decrypt URI
Harshal Shah
harshal.shah at gmail.com
Thu May 17 14:47:40 GMT 2007
Hello,
I am trying to encrypt / decrypt all the paths used in my application
for encrypting , i simply overloaded uri_for method to return encrypted
link..
however..I did not find any clean (simple) way to decrypt the same .
Heres what I am doing as of now..
sub prepare_path {
## overloading system method
my $c =3D shift;
$c->NEXT::prepare_path( @_ );
## define or get $crypt
$c->{request}->{path} =3D $crypt->decrypt($c->req->path , "my secret
key");
$c->log->debug( "after prepare_path" . $c->req->path );
return $c;
## continue the request flow
}
I am basically overwriting $c->{request}->{path} variable...its dirty but it
works...I do not know if it works with Apache or any other engine..as I have
tested only with the test server.
it also works with inline arguments ..viz /foo/arg1/arg2 ..I am not sure at
which point catalyst actually converts "arg1" and "arg2" into method
arguments ..
is there a better way to do this ??
-- =
Harshal Shah
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20070517/2e0ec=
15a/attachment.htm
More information about the Catalyst
mailing list