Merge lp:~cyphermox/pasaffe/password-length into lp:~mdeslaur/pasaffe/trunk

Proposed by Mathieu Trudel-Lapierre
Status: Merged
Merged at revision: 283
Proposed branch: lp:~cyphermox/pasaffe/password-length
Merge into: lp:~mdeslaur/pasaffe/trunk
Diff against target: 131 lines (+58/-4)
4 files modified
data/apps.pasaffe.gschema.xml (+5/-0)
data/ui/PreferencesPasaffeDialog.ui (+46/-2)
pasaffe/EditDetailsDialog.py (+5/-2)
pasaffe/PreferencesPasaffeDialog.py (+2/-0)
To merge this branch: bzr merge lp:~cyphermox/pasaffe/password-length
Reviewer Review Type Date Requested Status
Marc Deslauriers Approve
Review via email: mp+114322@code.launchpad.net

Description of the change

I'd really personally much rather not reduce password complexity on my systems. I've been using 20 characters now for a little while, grew accustomed to it, and given that the passwords generated by apg are pronounceable, only sometimes include special characters, I'd rather them be longer.

In all; I think the option should be given to users anyway, so this branch adds the necessary UI control and pieces of code to support changing the value.

To post a comment you must log in.
Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

The generated password used to be variable, between 8 and 12 characters. This changes the maximum, but leaves the minimum in place.

Since we're now exposing it in the GUI, perhaps we should make it a fixed number instead of having a variable length?

Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

On Wed, Jul 11, 2012 at 7:46 AM, Marc Deslauriers
<email address hidden> wrote:
> The generated password used to be variable, between 8 and 12 characters. This changes the maximum, but leaves the minimum in place.
>
> Since we're now exposing it in the GUI, perhaps we should make it a fixed number instead of having a variable length?

Ah, that explains the weird shorter passwords I'd see ;)

Yes, I think we should. I think people are free to remove a few
characters from a generated password if they're size-limited by
whatever password policy websites or services enforce.

Mathieu Trudel-Lapierre <email address hidden>
Freenode: cyphermox, Jabber: <email address hidden>
4096R/EE018C93 1967 8F7D 03A1 8F38 732E FF82 C126 33E1 EE01 8C93

Revision history for this message
Marc Deslauriers (mdeslaur) wrote :

Thanks for the patch, ACK!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'data/apps.pasaffe.gschema.xml'
2--- data/apps.pasaffe.gschema.xml 2012-02-04 21:45:53 +0000
3+++ data/apps.pasaffe.gschema.xml 2012-07-11 02:45:21 +0000
4@@ -31,5 +31,10 @@
5 <summary>Automatically save changes</summary>
6 <description>When this is true, Pasaffe will automatically save the database.</description>
7 </key>
8+ <key name="password-length" type="i">
9+ <default>12</default>
10+ <summary>Length of generated passwords</summary>
11+ <description>Number of characters to generate for random passwords.</description>
12+ </key>
13 </schema>
14 </schemalist>
15
16=== modified file 'data/ui/PreferencesPasaffeDialog.ui'
17--- data/ui/PreferencesPasaffeDialog.ui 2011-09-27 06:58:19 +0000
18+++ data/ui/PreferencesPasaffeDialog.ui 2012-07-11 02:45:21 +0000
19@@ -7,6 +7,11 @@
20 <property name="step_increment">1</property>
21 <property name="page_increment">10</property>
22 </object>
23+ <object class="GtkAdjustment" id="adjustment2">
24+ <property name="upper">100</property>
25+ <property name="step_increment">1</property>
26+ <property name="page_increment">10</property>
27+ </object>
28 <object class="PreferencesPasaffeDialog" id="preferences_pasaffe_dialog">
29 <property name="can_focus">False</property>
30 <property name="border_width">5</property>
31@@ -107,6 +112,45 @@
32 </packing>
33 </child>
34 <child>
35+ <object class="GtkHBox" id="hbox2">
36+ <property name="visible">True</property>
37+ <property name="can_focus">False</property>
38+ <child>
39+ <object class="GtkLabel" id="password-length-label">
40+ <property name="visible">True</property>
41+ <property name="can_focus">False</property>
42+ <property name="label" translatable="yes">Password length (characters)</property>
43+ </object>
44+ <packing>
45+ <property name="expand">True</property>
46+ <property name="fill">True</property>
47+ <property name="position">0</property>
48+ </packing>
49+ </child>
50+ <child>
51+ <object class="GtkSpinButton" id="password-length">
52+ <property name="visible">True</property>
53+ <property name="can_focus">True</property>
54+ <property name="invisible_char">•</property>
55+ <property name="invisible_char_set">True</property>
56+ <property name="primary_icon_activatable">False</property>
57+ <property name="secondary_icon_activatable">False</property>
58+ <property name="adjustment">adjustment2</property>
59+ <property name="numeric">True</property>
60+ </object>
61+ <packing>
62+ <property name="expand">True</property>
63+ <property name="fill">True</property>
64+ <property name="position">1</property>
65+ </packing>
66+ </child>
67+ </object>
68+ <packing>
69+ <property name="top_attach">4</property>
70+ <property name="bottom_attach">5</property>
71+ </packing>
72+ </child>
73+ <child>
74 <object class="GtkCheckButton" id="auto-save">
75 <property name="label" translatable="yes">Automatically save changes</property>
76 <property name="visible">True</property>
77@@ -117,8 +161,8 @@
78 <property name="draw_indicator">True</property>
79 </object>
80 <packing>
81- <property name="top_attach">4</property>
82- <property name="bottom_attach">5</property>
83+ <property name="top_attach">5</property>
84+ <property name="bottom_attach">6</property>
85 </packing>
86 </child>
87 </object>
88
89=== modified file 'pasaffe/EditDetailsDialog.py'
90--- pasaffe/EditDetailsDialog.py 2012-04-29 17:19:29 +0000
91+++ pasaffe/EditDetailsDialog.py 2012-07-11 02:45:21 +0000
92@@ -14,7 +14,7 @@
93 # with this program. If not, see <http://www.gnu.org/licenses/>.
94 ### END LICENSE
95
96-from gi.repository import Gtk # pylint: disable=E0611
97+from gi.repository import Gio, Gtk # pylint: disable=E0611
98
99 from pasaffe_lib.helpers import get_builder
100
101@@ -50,6 +50,9 @@
102 self.builder = builder
103 self.ui = builder.get_ui(self)
104
105+ settings = Gio.Settings("apps.pasaffe")
106+ self.password_length = settings.get_int("password-length")
107+
108 def on_btn_ok_clicked(self, widget, data=None):
109 """The user has elected to save the changes.
110
111@@ -75,7 +78,7 @@
112
113 def show_passwords_menu(self):
114 """Generate some new passwords"""
115- command = ["apg", "-n", "6", "-M", "sNC", "-m", "8", "-x", "12"]
116+ command = ["apg", "-n", "6", "-M", "sNC", "-m", "8", "-x", str(self.password_length)]
117 try:
118 passwords = subprocess.check_output(command).splitlines()
119 self.ui.password1.set_label(passwords[0])
120
121=== modified file 'pasaffe/PreferencesPasaffeDialog.py'
122--- pasaffe/PreferencesPasaffeDialog.py 2012-04-29 17:19:29 +0000
123+++ pasaffe/PreferencesPasaffeDialog.py 2012-07-11 02:45:21 +0000
124@@ -44,5 +44,7 @@
125 settings.bind("idle-timeout", widget, "value", Gio.SettingsBindFlags.DEFAULT)
126 widget = self.builder.get_object('auto-save')
127 settings.bind("auto-save", widget, "active", Gio.SettingsBindFlags.DEFAULT)
128+ widget = self.builder.get_object('password-length')
129+ settings.bind("password-length", widget, "value", Gio.SettingsBindFlags.DEFAULT)
130
131 # Code for other initialization actions should be added here.

Subscribers

People subscribed via source and target branches