salted_login_generator 1.1.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/salted_login_generator.rb +16 -1
- data/templates/README +41 -23
- data/templates/_view_edit.rhtml +0 -1
- data/templates/controller.rb +43 -36
- data/templates/controller_test.new.rb +328 -0
- data/templates/controller_test.old.rb +303 -0
- data/templates/controller_test.rb +97 -78
- data/templates/done +28 -0
- data/templates/helper.rb +12 -6
- data/templates/login_system.rb +11 -11
- data/templates/migration.rb +27 -0
- data/templates/notify.rb +6 -1
- data/templates/notify_change_password.rhtml +0 -5
- data/templates/notify_signup.rhtml +0 -1
- data/templates/user.rb +7 -5
- data/templates/user_model.erbsql +0 -1
- data/templates/user_test.rb +7 -7
- data/templates/users.yml +5 -10
- data/templates/view_change_password.rhtml +3 -3
- data/templates/view_edit.rhtml +8 -8
- data/templates/view_forgot_password.rhtml +3 -3
- data/templates/view_login.rhtml +2 -2
- data/templates/view_signup.rhtml +4 -4
- metadata +79 -70
data/templates/user_test.rb
CHANGED
@@ -6,9 +6,9 @@ class <%= class_name %>Test < Test::Unit::TestCase
|
|
6
6
|
|
7
7
|
def test_auth
|
8
8
|
|
9
|
-
assert_equal @bob, <%= class_name %>.authenticate("bob", "atest")
|
10
9
|
assert_nil <%= class_name %>.authenticate("nonbob", "atest")
|
11
|
-
|
10
|
+
assert_equal @bob, <%= class_name %>.authenticate("bob@test.com", "atest")
|
11
|
+
|
12
12
|
end
|
13
13
|
|
14
14
|
|
@@ -16,12 +16,12 @@ class <%= class_name %>Test < Test::Unit::TestCase
|
|
16
16
|
|
17
17
|
@longbob.change_password("nonbobpasswd")
|
18
18
|
@longbob.save
|
19
|
-
assert_equal @longbob, <%= class_name %>.authenticate("longbob", "nonbobpasswd")
|
20
|
-
assert_nil <%= class_name %>.authenticate("longbob", "alongtest")
|
19
|
+
assert_equal @longbob, <%= class_name %>.authenticate("longbob@test.com", "nonbobpasswd")
|
20
|
+
assert_nil <%= class_name %>.authenticate("longbob@test.com", "alongtest")
|
21
21
|
@longbob.change_password("alongtest")
|
22
22
|
@longbob.save
|
23
|
-
assert_equal @longbob, <%= class_name %>.authenticate("longbob", "alongtest")
|
24
|
-
assert_nil <%= class_name %>.authenticate("longbob", "nonbobpasswd")
|
23
|
+
assert_equal @longbob, <%= class_name %>.authenticate("longbob@test.com", "alongtest")
|
24
|
+
assert_nil <%= class_name %>.authenticate("longbob@test.com", "nonbobpasswd")
|
25
25
|
|
26
26
|
end
|
27
27
|
|
@@ -74,7 +74,7 @@ class <%= class_name %>Test < Test::Unit::TestCase
|
|
74
74
|
|
75
75
|
def test_collision
|
76
76
|
u = <%= class_name %>.new
|
77
|
-
u.login = "existingbob"
|
77
|
+
u.login = "existingbob@test.com"
|
78
78
|
u.change_password("bobs_secure_password")
|
79
79
|
assert !u.save
|
80
80
|
end
|
data/templates/users.yml
CHANGED
@@ -2,40 +2,35 @@
|
|
2
2
|
|
3
3
|
bob:
|
4
4
|
id: 1000001
|
5
|
-
login: bob
|
5
|
+
login: bob@test.com
|
6
6
|
salted_password: ef94c16f6c124a4e84cc215c164767bfa25f6e92 # atest
|
7
7
|
salt: 7f8b036f9b647d46d22abdbfc8113f44a88f9889
|
8
|
-
email: bob@test.com
|
9
8
|
verified: 1
|
10
9
|
|
11
10
|
existingbob:
|
12
11
|
id: 1000002
|
13
|
-
login: existingbob
|
12
|
+
login: existingbob@test.com
|
14
13
|
salted_password: 99d6b680d4bfa81cbd383ffa0390bb03323a0b9a # atest
|
15
14
|
salt: fc76daa7bc4e4b7833375cf9deca38beee4c5581
|
16
|
-
email: existingbob@test.com
|
17
15
|
verified: 1
|
18
16
|
|
19
17
|
longbob:
|
20
18
|
id: 1000003
|
21
|
-
login: longbob
|
19
|
+
login: longbob@test.com
|
22
20
|
salted_password: c841391e1d29100a4920de7a8fbb4b0fd180c6c0 # alongtest
|
23
21
|
salt: c068e3671780f16898c0a8295ae8d82cc59713e2
|
24
|
-
email: longbob@test.com
|
25
22
|
verified: 1
|
26
23
|
|
27
24
|
deletebob1:
|
28
25
|
id: 1000004
|
29
|
-
login: deletebob1
|
26
|
+
login: deletebob1@test.com
|
30
27
|
salted_password: c841391e1d29100a4920de7a8fbb4b0fd180c6c0 # alongtest
|
31
28
|
salt: c068e3671780f16898c0a8295ae8d82cc59713e2
|
32
|
-
email: deletebob1@test.com
|
33
29
|
verified: 1
|
34
30
|
|
35
31
|
deletebob2:
|
36
32
|
id: 1000005
|
37
|
-
login: deletebob2
|
33
|
+
login: deletebob2@test.com
|
38
34
|
salted_password: c841391e1d29100a4920de7a8fbb4b0fd180c6c0 # alongtest
|
39
35
|
salt: c068e3671780f16898c0a8295ae8d82cc59713e2
|
40
|
-
email: deletebob2@test.com
|
41
36
|
verified: 1
|
@@ -4,12 +4,12 @@
|
|
4
4
|
<div class="form-padding">
|
5
5
|
<%%= message_helper 'change' %>
|
6
6
|
|
7
|
-
|
8
|
-
<%%=
|
7
|
+
<%% form_tag_helper do %>
|
8
|
+
<%%= render :partial => 'password', :locals => {:<%= singular_name %> => @<%= singular_name %>, :submit => false } %>
|
9
9
|
<div class="button-bar">
|
10
10
|
<%%= button_helper 'change_password' %>
|
11
11
|
<%%= link_helper 'change_cancel_welcome', :action => 'welcome' %>
|
12
12
|
</div>
|
13
|
-
|
13
|
+
<%% end %>
|
14
14
|
</div>
|
15
15
|
</div>
|
data/templates/view_edit.rhtml
CHANGED
@@ -1,20 +1,20 @@
|
|
1
1
|
<div title="<%%= title_helper %>" class="form">
|
2
2
|
<%%= head_helper :error => true %>
|
3
3
|
|
4
|
-
|
5
|
-
<%%=
|
6
|
-
|
4
|
+
<%% form_tag_helper do %>
|
5
|
+
<%%= render :partial => 'edit', :locals => {:<%= singular_name %> => @<%= singular_name %>, :submit => true } %>
|
6
|
+
<%% end %>
|
7
7
|
</br>
|
8
|
-
|
9
|
-
<%%=
|
10
|
-
|
8
|
+
<%% form_tag_helper do %>
|
9
|
+
<%%= render :partial => 'password', :locals => {:submit => true } %>
|
10
|
+
<%% end %>
|
11
11
|
|
12
|
-
|
12
|
+
<%% form_tag_helper do %>
|
13
13
|
<div class="<%= singular_name %>_delete">
|
14
14
|
<%%= form_input :hidden_field, 'form', :value => 'delete' %>
|
15
15
|
|
16
16
|
<%%= form_input :submit_button, 'delete_account' %>
|
17
17
|
</div>
|
18
|
-
|
18
|
+
<%% end %>
|
19
19
|
</div>
|
20
20
|
</div>
|
@@ -4,13 +4,13 @@
|
|
4
4
|
<div class="form-padding">
|
5
5
|
<p><%%= message_helper 'forgot_reset' %></p>
|
6
6
|
|
7
|
-
|
8
|
-
<%%= form_input :text_field, "
|
7
|
+
<%% form_tag_helper do %>
|
8
|
+
<%%= form_input :text_field, "login", :size => 30 %><br/>
|
9
9
|
|
10
10
|
<div class="button-bar">
|
11
11
|
<%%= button_helper 'forgot_reset' %>
|
12
12
|
<%%= link_helper 'forgot_cancel_login', :action => 'login' %>
|
13
13
|
</div>
|
14
|
-
|
14
|
+
<%% end %>
|
15
15
|
</div>
|
16
16
|
</div>
|
data/templates/view_login.rhtml
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
<%%= head_helper %>
|
3
3
|
|
4
4
|
<div class="form-padding">
|
5
|
-
|
5
|
+
<%% form_tag_helper do %>
|
6
6
|
<table>
|
7
7
|
<%%= form_input :text_field, "login", :size => 30 %><br/>
|
8
8
|
<%%= form_input :password_field, "password", :size => 30 %><br/>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<%%= button_helper 'login' %>
|
13
13
|
<%%= link_helper 'login_signup', :action => 'signup' %> |
|
14
14
|
<%%= link_helper 'login_forgot_password', :action => 'forgot_password' %> </div>
|
15
|
-
|
15
|
+
<%% end %>
|
16
16
|
</div>
|
17
17
|
</div>
|
18
18
|
|
data/templates/view_signup.rhtml
CHANGED
@@ -2,13 +2,13 @@
|
|
2
2
|
<%%= head_helper :error => true %>
|
3
3
|
|
4
4
|
<div class="form-padding">
|
5
|
-
|
6
|
-
<%%=
|
7
|
-
<%%=
|
5
|
+
<%% form_tag_helper do %>
|
6
|
+
<%%= render :partial => 'edit', :locals => {:<%= singular_name %> => @<%= singular_name %>, :submit => false } %>
|
7
|
+
<%%= render :partial => 'password', :locals => {:submit => false } %>
|
8
8
|
|
9
9
|
<div class="button-bar">
|
10
10
|
<%%= button_helper 'signup' %>
|
11
11
|
</div>
|
12
|
-
|
12
|
+
<%% end %>
|
13
13
|
</div>
|
14
14
|
</div>
|
metadata
CHANGED
@@ -1,78 +1,87 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
|
-
rubygems_version: 0.8.8
|
3
|
-
specification_version: 1
|
4
2
|
name: salted_login_generator
|
5
3
|
version: !ruby/object:Gem::Version
|
6
|
-
version:
|
7
|
-
date: 2005-08-02
|
8
|
-
summary: "[Rails] Login generator with salted passwords."
|
9
|
-
require_paths:
|
10
|
-
- "."
|
11
|
-
email: jhosteny@mac.com
|
12
|
-
homepage:
|
13
|
-
rubyforge_project:
|
14
|
-
description: Generates Rails code implementing a login system for your Rails app.
|
15
|
-
autorequire:
|
16
|
-
default_executable:
|
17
|
-
bindir: bin
|
18
|
-
has_rdoc: false
|
19
|
-
required_ruby_version: !ruby/object:Gem::Version::Requirement
|
20
|
-
requirements:
|
21
|
-
-
|
22
|
-
- ">"
|
23
|
-
- !ruby/object:Gem::Version
|
24
|
-
version: 0.0.0
|
25
|
-
version:
|
4
|
+
version: 2.0.0
|
26
5
|
platform: ruby
|
27
6
|
authors:
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
- templates/user_test.rb
|
40
|
-
- templates/users.yml
|
41
|
-
- templates/view_login.rhtml
|
42
|
-
- templates/view_logout.rhtml
|
43
|
-
- templates/view_signup.rhtml
|
44
|
-
- templates/view_edit.rhtml
|
45
|
-
- templates/_view_edit.rhtml
|
46
|
-
- templates/_view_password.rhtml
|
47
|
-
- templates/view_welcome.rhtml
|
48
|
-
- templates/user_model.erbsql
|
49
|
-
- templates/notify.rb
|
50
|
-
- templates/view_forgot_password.rhtml
|
51
|
-
- templates/view_change_password.rhtml
|
52
|
-
- templates/notify_signup.rhtml
|
53
|
-
- templates/notify_forgot_password.rhtml
|
54
|
-
- templates/notify_pending_delete.rhtml
|
55
|
-
- templates/notify_delete.rhtml
|
56
|
-
- templates/notify_change_password.rhtml
|
57
|
-
- templates/mock_notify.rb
|
58
|
-
- templates/mock_time.rb
|
59
|
-
- templates/login_environment.rb
|
60
|
-
- templates/create_db
|
61
|
-
- templates/en.yaml
|
62
|
-
test_files: []
|
63
|
-
rdoc_options: []
|
64
|
-
extra_rdoc_files: []
|
7
|
+
- Tobias Luetke, Joe Hosteny, Deirdre Saoirse Moen, Francois Lagunas
|
8
|
+
autorequire: salted_login_generator
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2008-02-15 00:00:00 +01:00
|
13
|
+
default_executable:
|
14
|
+
dependencies: []
|
15
|
+
|
16
|
+
description: Generates Rails code implementing a login system for your Rails app.
|
17
|
+
email: francois dot lagunas at gmail dot com
|
65
18
|
executables: []
|
19
|
+
|
66
20
|
extensions: []
|
21
|
+
|
22
|
+
extra_rdoc_files: []
|
23
|
+
|
24
|
+
files:
|
25
|
+
- templates/_view_edit.rhtml
|
26
|
+
- templates/_view_password.rhtml
|
27
|
+
- templates/controller.rb
|
28
|
+
- templates/controller_test.new.rb
|
29
|
+
- templates/controller_test.old.rb
|
30
|
+
- templates/controller_test.rb
|
31
|
+
- templates/create_db
|
32
|
+
- templates/done
|
33
|
+
- templates/en.yaml
|
34
|
+
- templates/helper.rb
|
35
|
+
- templates/login_environment.rb
|
36
|
+
- templates/login_system.rb
|
37
|
+
- templates/migration.rb
|
38
|
+
- templates/mock_notify.rb
|
39
|
+
- templates/mock_time.rb
|
40
|
+
- templates/notify.rb
|
41
|
+
- templates/notify_change_password.rhtml
|
42
|
+
- templates/notify_delete.rhtml
|
43
|
+
- templates/notify_forgot_password.rhtml
|
44
|
+
- templates/notify_pending_delete.rhtml
|
45
|
+
- templates/notify_signup.rhtml
|
46
|
+
- templates/README
|
47
|
+
- templates/user.rb
|
48
|
+
- templates/user_model.erbsql
|
49
|
+
- templates/user_test.rb
|
50
|
+
- templates/users.yml
|
51
|
+
- templates/view_change_password.rhtml
|
52
|
+
- templates/view_edit.rhtml
|
53
|
+
- templates/view_forgot_password.rhtml
|
54
|
+
- templates/view_login.rhtml
|
55
|
+
- templates/view_logout.rhtml
|
56
|
+
- templates/view_signup.rhtml
|
57
|
+
- templates/view_welcome.rhtml
|
58
|
+
- USAGE
|
59
|
+
- salted_login_generator.rb
|
60
|
+
has_rdoc: false
|
61
|
+
homepage: http://rubyforge.org/projects/salted-login/
|
62
|
+
post_install_message:
|
63
|
+
rdoc_options: []
|
64
|
+
|
65
|
+
require_paths:
|
66
|
+
- lib
|
67
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
version: "0"
|
72
|
+
version:
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - ">="
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: "0"
|
78
|
+
version:
|
67
79
|
requirements: []
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
- !ruby/object:Gem::Version
|
77
|
-
version: 0.13.1
|
78
|
-
version:
|
80
|
+
|
81
|
+
rubyforge_project:
|
82
|
+
rubygems_version: 0.9.5
|
83
|
+
signing_key:
|
84
|
+
specification_version: 2
|
85
|
+
summary: Login generator with salted passwords.
|
86
|
+
test_files: []
|
87
|
+
|