Merge lp:~wgrant/launchpad/purge-more-password into lp:launchpad

Proposed by William Grant
Status: Merged
Approved by: William Grant
Approved revision: no longer in the source branch.
Merged at revision: 14725
Proposed branch: lp:~wgrant/launchpad/purge-more-password
Merge into: lp:launchpad
Diff against target: 153 lines (+0/-68)
3 files modified
lib/lp/app/validators/validation.py (+0/-33)
lib/lp/services/fields/__init__.py (+0/-20)
lib/lp/services/verification/interfaces/authtoken.py (+0/-15)
To merge this branch: bzr merge lp:~wgrant/launchpad/purge-more-password
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+90061@code.launchpad.net

Commit message

Drop a few more unused password-related bits and pieces from around the tree.

Description of the change

Drop a few more unused password-related bits and pieces from around the tree.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/app/validators/validation.py'
2--- lib/lp/app/validators/validation.py 2012-01-17 03:49:38 +0000
3+++ lib/lp/app/validators/validation.py 2012-01-25 09:58:30 +0000
4@@ -12,7 +12,6 @@
5 'valid_cve_sequence',
6 'validate_new_team_email',
7 'validate_new_person_email',
8- 'valid_password',
9 'validate_date_interval',
10 ]
11
12@@ -132,38 +131,6 @@
13 return True
14
15
16-def valid_password(password):
17- """Return True if the argument is a valid password.
18-
19- A valid password contains only ASCII characters in range(32,127).
20- No ASCII control characters are allowed.
21-
22- password that contains only valid ASCII characters
23- >>> valid_password(u"All ascii password with spaces.:\\&/")
24- True
25-
26- password that contains some non-ASCII character (value > 127)
27- >>> valid_password(u"password with some non-ascii" + unichr(195))
28- False
29-
30- password that contains ASCII control characters (0 >= value >= 31)
31- >>> valid_password(u"password with control chars" + chr(20))
32- False
33-
34- empty password.
35- >>> valid_password(u"")
36- True
37-
38- """
39- assert isinstance(password, unicode)
40- valid_chars = [chr(x) for x in range(32, 127)]
41- invalid = set(password) - set(valid_chars)
42- if invalid:
43- return False
44- else:
45- return True
46-
47-
48 def validate_date_interval(start_date, end_date, error_msg=None):
49 """Check if start_date precedes end_date.
50
51
52=== modified file 'lib/lp/services/fields/__init__.py'
53--- lib/lp/services/fields/__init__.py 2012-01-01 02:58:52 +0000
54+++ lib/lp/services/fields/__init__.py 2012-01-25 09:58:30 +0000
55@@ -21,7 +21,6 @@
56 'IDescription',
57 'ILocationField',
58 'INoneableTextLine',
59- 'IPasswordField',
60 'IPersonChoice',
61 'IStrippedTextLine',
62 'ISummary',
63@@ -37,7 +36,6 @@
64 'MugshotImageUpload',
65 'NoneableDescription',
66 'NoneableTextLine',
67- 'PasswordField',
68 'PersonChoice',
69 'PillarAliases',
70 'PillarNameField',
71@@ -81,7 +79,6 @@
72 Field,
73 Float,
74 Int,
75- Password,
76 Text,
77 TextLine,
78 Tuple,
79@@ -94,7 +91,6 @@
80 IField,
81 Interface,
82 IObject,
83- IPassword,
84 IText,
85 ITextLine,
86 )
87@@ -152,11 +148,6 @@
88 """A field that allows entry of a Bug number or nickname"""
89
90
91-class IPasswordField(IPassword):
92- """A field that ensures we only use http basic authentication safe
93- ascii characters."""
94-
95-
96 class IAnnouncementDate(IDatetime):
97 """Marker interface for AnnouncementDate fields.
98
99@@ -418,17 +409,6 @@
100 return super(SearchTag, self).constraint(value)
101
102
103-class PasswordField(Password):
104- implements(IPasswordField)
105-
106- def _validate(self, value):
107- # Local import to avoid circular imports
108- from lp.app.validators.validation import valid_password
109- if not valid_password(value):
110- raise LaunchpadValidationError(_(
111- "The password provided contains non-ASCII characters."))
112-
113-
114 class UniqueField(TextLine):
115 """Base class for fields that are used for unique attributes."""
116
117
118=== modified file 'lib/lp/services/verification/interfaces/authtoken.py'
119--- lib/lp/services/verification/interfaces/authtoken.py 2012-01-05 00:23:45 +0000
120+++ lib/lp/services/verification/interfaces/authtoken.py 2012-01-25 09:58:30 +0000
121@@ -29,7 +29,6 @@
122 )
123
124 from lp import _
125-from lp.services.fields import PasswordField
126
127
128 class LoginTokenType(DBEnumeratedType):
129@@ -174,10 +173,6 @@
130 # used for launchpad page layout
131 title = Attribute('Title')
132
133- # Quick fix for Bug #2481
134- password = PasswordField(
135- title=_('Password'), required=True, readonly=False)
136-
137 def consume():
138 """Mark this token as consumed by setting date_consumed.
139
140@@ -188,13 +183,3 @@
141
142 def sendEmailValidationRequest():
143 """Send an email message with a magic URL to validate self.email."""
144-
145- def sendPasswordResetEmail():
146- """Send an email message to the requester with a magic URL that allows
147- him to reset his password.
148- """
149-
150- def sendNewUserEmail():
151- """Send an email message to the requester with a magic URL that allows
152- him to finish the Launchpad registration process.
153- """