Simons,
I will look into that the problem now is my first thought was to add
the feature without touching existing code as much possible.
Looking at the
ASP.NET MVC we can't just copy it directly into
MonoRail especially I do not like when I had to deal with HttpContext
and had to detach the code from
ASP.NET MVC internal engine but that
is another story now when I tried to copy what
ASP.NET MVC does I came
up with the following file/class structure
Castle.MonoRail.Framework
+ Attributes
- AntiForgeryValidationFilterAttribute.cs
+ Filters
- AntiForgeryValidationFilter.cs
But I am not sure where AntiForgeryData and
AntiForgeryDataSerialization class would belong? Do we really need
these two class or not?
Because I AntiForgeryValidationFilterAttribute can have the Properties
exactly the same as AntiForgerData, or I miss something important
there.
Anyway AntiFogeryValidationFilter can apply both Class & Method level;
however strongly support the idea in this blog
http://weblogs.asp.net/dixin/archive/2010/05/22/anti-forgery-request-recipes-for-asp-net-mvc-and-ajax.aspx
the simplest way is to apply the filter to controller level ignore all
action request != POST.
Thanks,
Sokun
On Jun 1, 5:39 am, John Simons <
johnsimons...@yahoo.com.au> wrote:
> Gauthie,
> Action level filters work fine in Monorail actions. What problems are you having?
>
> Sokun,
> Regarding $FormHelper.ForgeryToken(), I actually don't think we need this.
> You can use the form parameters to configure it and then write a hidden tag as part of rendering the form tag.
> Eg.
> $Form.FormTag("%{ controller='myController', action='myAction', useAntiForgeryToken='true', antiForgeryTokenSalt='$^DF2x' }")
> and this would output:
>
> <form action="/myController/myAction" method="post">
> <input name="__RequestVerificationToken" type="hidden" value="saTFWpkKN0BYazFtN6c4YbZAmsEwG0srqlUqqloi/fVgeV2ciIFVmelvzwRZpArs" />
>
> What do u think?
>
> Cheers
> John
>
> ________________________________
> From: Gauthier Segay <
gauthier.se...@gmail.com>
> > > To unsubscribe from this group, send email to
castle-project-d...@googlegroups.com.
> To unsubscribe from this group, send email to
castle-project-d...@googlegroups.com.