#24202: Implement a SensitiveTextInput widget for sensitive input fields
-----------------------------+--------------------------------------
Reporter: hakanw | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: 1.7
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+--------------------------------------
Changes (by hakanw):
* needs_better_patch: => 0
* component: Uncategorized => Forms
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => New feature
Old description:
> If you're implementing Stripe, Adyen, or other big payment solutions
> today, then you can use client side encryption, where form fields are
> used for inputting e.g. credit card number (etc), but that will be
> encrypted before the form is submitted to the server. These fields should
> not be sent raw to the server, so you usually remove the name attribute
> on the input fields.
>
> It would be really useful if django had a SensitiveTextInput widget that
> just removed its name attribute. This idea is from here:
> http://stackoverflow.com/questions/18116917/change-form-input-attribute-
> name-to-data-encrypted-name
>
> Suggested class:
>
> {{{python
> # a text input widget with no name attribute
> class SensitiveTextInput(forms.TextInput):
> def build_attrs(self, extra_attrs=None, **kwargs):
> attrs = super(SensitiveTextInput, self).build_attrs(extra_attrs,
> **kwargs)
> if 'name' in attrs:
> del attrs['name']
> return attrs
> }}}
New description:
If you're implementing Stripe, Adyen, or other big payment solutions
today, then you can use client side encryption, where form fields are used
for inputting e.g. credit card number (etc), but that will be encrypted
before the form is submitted to the server. These fields should not be
sent raw to the server, so you usually remove the name attribute on the
input fields.
It would be really great if django had a SensitiveTextInput widget for
purposes like this. This idea is from here:
http://stackoverflow.com/questions/18116917/change-form-input-attribute-
name-to-data-encrypted-name
Here's a suggested class:
{{{
#!python
# a text input widget with no name attribute
class SensitiveTextInput(forms.TextInput):
def build_attrs(self, extra_attrs=None, **kwargs):
attrs = super(SensitiveTextInput, self).build_attrs(extra_attrs,
**kwargs)
if 'name' in attrs:
del attrs['name']
return attrs
}}}
--
--
Ticket URL: <https://code.djangoproject.com/ticket/24202#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/064.8128b2f28691241d35699227397c319f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.