authgasm 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (87) hide show
  1. data/MIT-LICENSE +20 -0
  2. data/Manifest +85 -0
  3. data/README.rdoc +164 -0
  4. data/Rakefile +15 -0
  5. data/authgasm.gemspec +183 -0
  6. data/init.rb +2 -0
  7. data/lib/authgasm.rb +18 -0
  8. data/lib/authgasm/acts_as_authentic.rb +200 -0
  9. data/lib/authgasm/controller.rb +16 -0
  10. data/lib/authgasm/session/active_record_trickery.rb +30 -0
  11. data/lib/authgasm/session/base.rb +365 -0
  12. data/lib/authgasm/session/callbacks.rb +47 -0
  13. data/lib/authgasm/session/config.rb +193 -0
  14. data/lib/authgasm/session/errors.rb +12 -0
  15. data/lib/authgasm/sha256_crypto_provider.rb +13 -0
  16. data/lib/authgasm/version.rb +56 -0
  17. data/test_app/README +256 -0
  18. data/test_app/Rakefile +10 -0
  19. data/test_app/app/controllers/application.rb +46 -0
  20. data/test_app/app/controllers/user_sessions_controller.rb +25 -0
  21. data/test_app/app/controllers/users_controller.rb +37 -0
  22. data/test_app/app/helpers/application_helper.rb +3 -0
  23. data/test_app/app/helpers/user_sessions_helper.rb +2 -0
  24. data/test_app/app/helpers/users_helper.rb +2 -0
  25. data/test_app/app/models/user.rb +3 -0
  26. data/test_app/app/models/user_session.rb +3 -0
  27. data/test_app/app/views/asses/edit.html.erb +12 -0
  28. data/test_app/app/views/asses/index.html.erb +18 -0
  29. data/test_app/app/views/asses/new.html.erb +11 -0
  30. data/test_app/app/views/asses/show.html.erb +3 -0
  31. data/test_app/app/views/layouts/application.html.erb +25 -0
  32. data/test_app/app/views/user_sessions/new.html.erb +13 -0
  33. data/test_app/app/views/users/_form.erb +15 -0
  34. data/test_app/app/views/users/edit.html.erb +8 -0
  35. data/test_app/app/views/users/new.html.erb +8 -0
  36. data/test_app/app/views/users/show.html.erb +19 -0
  37. data/test_app/config/boot.rb +109 -0
  38. data/test_app/config/database.yml +19 -0
  39. data/test_app/config/environment.rb +69 -0
  40. data/test_app/config/environments/development.rb +17 -0
  41. data/test_app/config/environments/production.rb +22 -0
  42. data/test_app/config/environments/test.rb +22 -0
  43. data/test_app/config/initializers/inflections.rb +10 -0
  44. data/test_app/config/initializers/mime_types.rb +5 -0
  45. data/test_app/config/initializers/new_rails_defaults.rb +17 -0
  46. data/test_app/config/routes.rb +7 -0
  47. data/test_app/db/development.sqlite3 +0 -0
  48. data/test_app/db/migrate/20081023040052_create_users.rb +17 -0
  49. data/test_app/db/schema.rb +25 -0
  50. data/test_app/db/test.sqlite3 +0 -0
  51. data/test_app/doc/README_FOR_APP +2 -0
  52. data/test_app/public/404.html +30 -0
  53. data/test_app/public/422.html +30 -0
  54. data/test_app/public/500.html +30 -0
  55. data/test_app/public/dispatch.cgi +10 -0
  56. data/test_app/public/dispatch.fcgi +24 -0
  57. data/test_app/public/dispatch.rb +10 -0
  58. data/test_app/public/favicon.ico +0 -0
  59. data/test_app/public/images/rails.png +0 -0
  60. data/test_app/public/javascripts/application.js +2 -0
  61. data/test_app/public/javascripts/controls.js +963 -0
  62. data/test_app/public/javascripts/dragdrop.js +972 -0
  63. data/test_app/public/javascripts/effects.js +1120 -0
  64. data/test_app/public/javascripts/prototype.js +4225 -0
  65. data/test_app/public/robots.txt +5 -0
  66. data/test_app/public/stylesheets/scaffold.css +62 -0
  67. data/test_app/script/about +4 -0
  68. data/test_app/script/console +3 -0
  69. data/test_app/script/dbconsole +3 -0
  70. data/test_app/script/destroy +3 -0
  71. data/test_app/script/generate +3 -0
  72. data/test_app/script/performance/benchmarker +3 -0
  73. data/test_app/script/performance/profiler +3 -0
  74. data/test_app/script/performance/request +3 -0
  75. data/test_app/script/plugin +3 -0
  76. data/test_app/script/process/inspector +3 -0
  77. data/test_app/script/process/reaper +3 -0
  78. data/test_app/script/process/spawner +3 -0
  79. data/test_app/script/runner +3 -0
  80. data/test_app/script/server +3 -0
  81. data/test_app/test/fixtures/users.yml +6 -0
  82. data/test_app/test/functional/user_sessions_controller_test.rb +15 -0
  83. data/test_app/test/functional/users_controller_test.rb +8 -0
  84. data/test_app/test/test_helper.rb +38 -0
  85. data/test_app/test/unit/ass_test.rb +8 -0
  86. data/test_app/test/unit/user_test.rb +8 -0
  87. metadata +182 -0
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/wc/norobots.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-Agent: *
5
+ # Disallow: /
@@ -0,0 +1,62 @@
1
+ body { background-color: #fff; color: #333; }
2
+
3
+ body, p, ol, ul, td {
4
+ font-family: verdana, arial, helvetica, sans-serif;
5
+ font-size: 13px;
6
+ line-height: 18px;
7
+ }
8
+
9
+ pre {
10
+ background-color: #eee;
11
+ padding: 10px;
12
+ font-size: 11px;
13
+ }
14
+
15
+ p {
16
+ margin: 0 0 15px 0;
17
+ }
18
+
19
+ a { color: #000; }
20
+ a:visited { color: #666; }
21
+ a:hover { color: #fff; background-color:#000; }
22
+
23
+ .fieldWithErrors {
24
+ padding: 2px;
25
+ background-color: red;
26
+ display: inline;
27
+ }
28
+
29
+ .fieldWithErrors label {
30
+ color: white;
31
+ }
32
+
33
+ #errorExplanation {
34
+ width: 400px;
35
+ border: 2px solid red;
36
+ padding: 7px;
37
+ padding-bottom: 12px;
38
+ margin-bottom: 20px;
39
+ background-color: #f0f0f0;
40
+ }
41
+
42
+ #errorExplanation h2 {
43
+ text-align: left;
44
+ font-weight: bold;
45
+ padding: 5px 5px 5px 15px;
46
+ font-size: 12px;
47
+ margin: -7px;
48
+ background-color: #c00;
49
+ color: #fff;
50
+ }
51
+
52
+ #errorExplanation p {
53
+ color: #333;
54
+ margin-bottom: 0;
55
+ padding: 5px;
56
+ }
57
+
58
+ #errorExplanation ul li {
59
+ font-size: 12px;
60
+ list-style: square;
61
+ }
62
+
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ $LOAD_PATH.unshift "#{RAILTIES_PATH}/builtin/rails_info"
4
+ require 'commands/about'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/console'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/dbconsole'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/destroy'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/generate'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/benchmarker'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/profiler'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/performance/request'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/plugin'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/inspector'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/reaper'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../../config/boot'
3
+ require 'commands/process/spawner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/runner'
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ require File.dirname(__FILE__) + '/../config/boot'
3
+ require 'commands/server'
@@ -0,0 +1,6 @@
1
+ ben:
2
+ id: 1
3
+ login: bjohnson
4
+ crypted_password: <%= Authgasm::Sha256CryptoProvider.encrypt("benrocks") %>
5
+ first_name: Ben
6
+ last_name: Johnson
@@ -0,0 +1,15 @@
1
+ require 'test_helper'
2
+
3
+ class UserSessionsControllerTest < ActionController::TestCase
4
+ def setup
5
+ @controller = UserSessionsController.new
6
+ @request = ActionController::TestRequest.new
7
+ @response = ActionController::TestResponse.new
8
+ end
9
+
10
+ def test_truth
11
+ get :create, {:user_session => {:login => "bjohnson", :password => "benrocks"}}
12
+ assert_equal 1, session[:user_id]
13
+ assert_equal ["YmpvaG5zb24=\n:::2e8884187c71ff39af9ac05ebcaa0f40ab2432de51035aff8b0f491f890314d0"], cookies["user_credentials"]
14
+ end
15
+ end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class UsersControllerTest < ActionController::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,38 @@
1
+ ENV["RAILS_ENV"] = "test"
2
+ require File.expand_path(File.dirname(__FILE__) + "/../config/environment")
3
+ require 'test_help'
4
+
5
+ class Test::Unit::TestCase
6
+ # Transactional fixtures accelerate your tests by wrapping each test method
7
+ # in a transaction that's rolled back on completion. This ensures that the
8
+ # test database remains unchanged so your fixtures don't have to be reloaded
9
+ # between every test method. Fewer database queries means faster tests.
10
+ #
11
+ # Read Mike Clark's excellent walkthrough at
12
+ # http://clarkware.com/cgi/blosxom/2005/10/24#Rails10FastTesting
13
+ #
14
+ # Every Active Record database supports transactions except MyISAM tables
15
+ # in MySQL. Turn off transactional fixtures in this case; however, if you
16
+ # don't care one way or the other, switching from MyISAM to InnoDB tables
17
+ # is recommended.
18
+ #
19
+ # The only drawback to using transactional fixtures is when you actually
20
+ # need to test transactions. Since your test is bracketed by a transaction,
21
+ # any transactions started in your code will be automatically rolled back.
22
+ self.use_transactional_fixtures = true
23
+
24
+ # Instantiated fixtures are slow, but give you @david where otherwise you
25
+ # would need people(:david). If you don't want to migrate your existing
26
+ # test cases which use the @david style and don't mind the speed hit (each
27
+ # instantiated fixtures translates to a database query per test method),
28
+ # then set this back to true.
29
+ self.use_instantiated_fixtures = false
30
+
31
+ # Setup all fixtures in test/fixtures/*.(yml|csv) for all tests in alphabetical order.
32
+ #
33
+ # Note: You'll currently still have to declare fixtures explicitly in integration tests
34
+ # -- they do not yet inherit this setting
35
+ fixtures :all
36
+
37
+ # Add more helper methods to be used by all tests here...
38
+ end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class AssTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ class UserTest < ActiveSupport::TestCase
4
+ # Replace this with your real tests.
5
+ def test_truth
6
+ assert true
7
+ end
8
+ end
metadata ADDED
@@ -0,0 +1,182 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: authgasm
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.0
5
+ platform: ruby
6
+ authors:
7
+ - Ben Johnson of Binary Logic
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2008-10-24 00:00:00 -04:00
13
+ default_executable:
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: activesupport
17
+ type: :runtime
18
+ version_requirement:
19
+ version_requirements: !ruby/object:Gem::Requirement
20
+ requirements:
21
+ - - ">="
22
+ - !ruby/object:Gem::Version
23
+ version: "0"
24
+ version:
25
+ - !ruby/object:Gem::Dependency
26
+ name: activerecord
27
+ type: :runtime
28
+ version_requirement:
29
+ version_requirements: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: "0"
34
+ version:
35
+ - !ruby/object:Gem::Dependency
36
+ name: echoe
37
+ type: :development
38
+ version_requirement:
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: "0"
44
+ version:
45
+ description: Rails authentication done right
46
+ email: bjohnson@binarylogic.com
47
+ executables: []
48
+
49
+ extensions: []
50
+
51
+ extra_rdoc_files:
52
+ - lib/authgasm/acts_as_authentic.rb
53
+ - lib/authgasm/controller.rb
54
+ - lib/authgasm/session/active_record_trickery.rb
55
+ - lib/authgasm/session/base.rb
56
+ - lib/authgasm/session/callbacks.rb
57
+ - lib/authgasm/session/config.rb
58
+ - lib/authgasm/session/errors.rb
59
+ - lib/authgasm/sha256_crypto_provider.rb
60
+ - lib/authgasm/version.rb
61
+ - lib/authgasm.rb
62
+ - README.rdoc
63
+ files:
64
+ - init.rb
65
+ - lib/authgasm/acts_as_authentic.rb
66
+ - lib/authgasm/controller.rb
67
+ - lib/authgasm/session/active_record_trickery.rb
68
+ - lib/authgasm/session/base.rb
69
+ - lib/authgasm/session/callbacks.rb
70
+ - lib/authgasm/session/config.rb
71
+ - lib/authgasm/session/errors.rb
72
+ - lib/authgasm/sha256_crypto_provider.rb
73
+ - lib/authgasm/version.rb
74
+ - lib/authgasm.rb
75
+ - Manifest
76
+ - MIT-LICENSE
77
+ - Rakefile
78
+ - README.rdoc
79
+ - test_app/app/controllers/application.rb
80
+ - test_app/app/controllers/user_sessions_controller.rb
81
+ - test_app/app/controllers/users_controller.rb
82
+ - test_app/app/helpers/application_helper.rb
83
+ - test_app/app/helpers/user_sessions_helper.rb
84
+ - test_app/app/helpers/users_helper.rb
85
+ - test_app/app/models/user.rb
86
+ - test_app/app/models/user_session.rb
87
+ - test_app/app/views/asses/edit.html.erb
88
+ - test_app/app/views/asses/index.html.erb
89
+ - test_app/app/views/asses/new.html.erb
90
+ - test_app/app/views/asses/show.html.erb
91
+ - test_app/app/views/layouts/application.html.erb
92
+ - test_app/app/views/user_sessions/new.html.erb
93
+ - test_app/app/views/users/_form.erb
94
+ - test_app/app/views/users/edit.html.erb
95
+ - test_app/app/views/users/new.html.erb
96
+ - test_app/app/views/users/show.html.erb
97
+ - test_app/config/boot.rb
98
+ - test_app/config/database.yml
99
+ - test_app/config/environment.rb
100
+ - test_app/config/environments/development.rb
101
+ - test_app/config/environments/production.rb
102
+ - test_app/config/environments/test.rb
103
+ - test_app/config/initializers/inflections.rb
104
+ - test_app/config/initializers/mime_types.rb
105
+ - test_app/config/initializers/new_rails_defaults.rb
106
+ - test_app/config/routes.rb
107
+ - test_app/db/development.sqlite3
108
+ - test_app/db/migrate/20081023040052_create_users.rb
109
+ - test_app/db/schema.rb
110
+ - test_app/db/test.sqlite3
111
+ - test_app/doc/README_FOR_APP
112
+ - test_app/public/404.html
113
+ - test_app/public/422.html
114
+ - test_app/public/500.html
115
+ - test_app/public/dispatch.cgi
116
+ - test_app/public/dispatch.fcgi
117
+ - test_app/public/dispatch.rb
118
+ - test_app/public/favicon.ico
119
+ - test_app/public/images/rails.png
120
+ - test_app/public/javascripts/application.js
121
+ - test_app/public/javascripts/controls.js
122
+ - test_app/public/javascripts/dragdrop.js
123
+ - test_app/public/javascripts/effects.js
124
+ - test_app/public/javascripts/prototype.js
125
+ - test_app/public/robots.txt
126
+ - test_app/public/stylesheets/scaffold.css
127
+ - test_app/Rakefile
128
+ - test_app/README
129
+ - test_app/script/about
130
+ - test_app/script/console
131
+ - test_app/script/dbconsole
132
+ - test_app/script/destroy
133
+ - test_app/script/generate
134
+ - test_app/script/performance/benchmarker
135
+ - test_app/script/performance/profiler
136
+ - test_app/script/performance/request
137
+ - test_app/script/plugin
138
+ - test_app/script/process/inspector
139
+ - test_app/script/process/reaper
140
+ - test_app/script/process/spawner
141
+ - test_app/script/runner
142
+ - test_app/script/server
143
+ - test_app/test/fixtures/users.yml
144
+ - test_app/test/functional/user_sessions_controller_test.rb
145
+ - test_app/test/functional/users_controller_test.rb
146
+ - test_app/test/test_helper.rb
147
+ - test_app/test/unit/ass_test.rb
148
+ - test_app/test/unit/user_test.rb
149
+ - authgasm.gemspec
150
+ has_rdoc: true
151
+ homepage: http://github.com/binarylogic/authgasm
152
+ post_install_message:
153
+ rdoc_options:
154
+ - --line-numbers
155
+ - --inline-source
156
+ - --title
157
+ - Authgasm
158
+ - --main
159
+ - README.rdoc
160
+ require_paths:
161
+ - lib
162
+ required_ruby_version: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: "0"
167
+ version:
168
+ required_rubygems_version: !ruby/object:Gem::Requirement
169
+ requirements:
170
+ - - ">="
171
+ - !ruby/object:Gem::Version
172
+ version: "1.2"
173
+ version:
174
+ requirements: []
175
+
176
+ rubyforge_project: authgasm
177
+ rubygems_version: 1.2.0
178
+ signing_key:
179
+ specification_version: 2
180
+ summary: Rails authentication done right
181
+ test_files: []
182
+