[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GMG-Devel] CAPTCHA framework for your consideration
From: |
ayleph |
Subject: |
Re: [GMG-Devel] CAPTCHA framework for your consideration |
Date: |
Wed, 14 Jan 2015 13:31:45 -0800 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 |
On 01/14/2015 10:44 AM, Christopher Allan Webber wrote:
> Hey Ayleph!
>
> So, one way to do things is to use hook_transform to actually subclass
> the wtforms form into a *new* wtforms form, with the added fields. I
> think that's probably the cleanest method. What do you think?
Ah yes, I remember you mentioning hook_transform before. I couldn't ever
get it to work though. Maybe someone could give me some pointers and we
could try it again.
hook_transform also presents some questions in my mind that I haven't
been able to answer. I want to avoid creating new views for a CAPTCHA
plugin, as that would just duplicate code unnecessarily when all I want
to do is piggy-back off the original auth form/view and validate a
CAPTCHA. Could I subclass a wtforms form into a new CAPTCHA form, but
still use the views.py from say the basic_auth plugin? And I wasn't sure
about subclassing forms when I didn't know which form to subclass. For
example, say someone is using the openid or persona plugin with its own
registration form and they want to add a CAPTCHA do it. How does
hook_transform know I want to transform the openid or persona
registration form instead of the basic_auth registration form? Can I
make it generic enough to know which registration form it needs to
subclass, or do I have to operate on a specific form (eg, from
mediagoblin.plugins.basic_auth import RegistrationForm)?
> Again, all for adding the hooks. It would be good to have the same
> hooks that recaptcha works with and have a builtin free software only
> captcha solution. I have an idea for this... I will spit it out in a
> separate reply from this one though.
I'm definitely in favor of a free CAPTCHA solution. I started looking
into some alternatives to reCAPTCHA and then I got sidetracked with
trying to streamline the process of adding CAPTCHAs. I figured if we
added appropriate hooks, we could support any number of free or non-free
CAPTCHA plugins. I look forward to hearing your idea.
--
ayleph