opensesame 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/README.md +9 -8
  2. data/app/assets/stylesheets/open_sesame/{application.css → opensesame.css} +0 -1
  3. data/app/assets/stylesheets/open_sesame/{welcome.css.scss → welcome.css} +50 -1
  4. data/app/controllers/open_sesame/application_controller.rb +1 -1
  5. data/app/controllers/open_sesame/sessions_controller.rb +22 -5
  6. data/app/helpers/open_sesame/application_helper.rb +1 -1
  7. data/app/views/layouts/open_sesame/application.html.erb +1 -2
  8. data/config/routes.rb +2 -2
  9. data/lib/open_sesame/configuration.rb +10 -13
  10. data/lib/open_sesame/engine.rb +21 -22
  11. data/lib/open_sesame/failure/app.rb +10 -0
  12. data/lib/open_sesame/failure/devise_app.rb +17 -0
  13. data/lib/open_sesame/github_auth.rb +9 -0
  14. data/lib/open_sesame/github_warden.rb +26 -0
  15. data/lib/open_sesame/{controller_helper.rb → helpers/controller_helper.rb} +2 -1
  16. data/lib/open_sesame/{view_helper.rb → helpers/view_helper.rb} +4 -3
  17. data/lib/open_sesame/member.rb +65 -0
  18. data/lib/open_sesame/version.rb +2 -1
  19. data/lib/open_sesame.rb +16 -4
  20. data/spec/dummy/app/views/home/index.html.erb +3 -1
  21. data/spec/dummy/config/initializers/opensesame.rb +16 -2
  22. data/spec/dummy/config/initializers/session_store.rb +1 -1
  23. data/spec/dummy/config/initializers/wrap_parameters.rb +1 -1
  24. data/spec/dummy/config/routes.rb +1 -1
  25. data/spec/dummy/db/development.sqlite3 +0 -0
  26. data/spec/dummy/log/development.log +135 -6
  27. data/spec/dummy/log/test.log +41874 -530
  28. data/spec/dummy/tmp/cache/assets/C09/2F0/sprockets%2F76045b33d436a11b0156b36a91560651 +0 -0
  29. data/spec/dummy/tmp/cache/assets/C54/300/sprockets%2Fb83307a70e6040f817087f997dc73122 +0 -0
  30. data/spec/dummy/tmp/cache/assets/CAA/920/sprockets%2Ff2904820584f0723f5ab256dcf1a9225 +0 -0
  31. data/spec/dummy/tmp/cache/assets/CC2/790/sprockets%2F020f956f67983c52c9889ac9801ca4b4 +0 -0
  32. data/spec/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  33. data/spec/dummy/tmp/cache/assets/CEC/240/sprockets%2Fdec29f626939d38247d1745e057c6ab2 +0 -0
  34. data/spec/dummy/tmp/cache/assets/D0C/2A0/sprockets%2F04922c120a656b333dd5fcd28c9f8f53 +0 -0
  35. data/spec/dummy/tmp/cache/assets/D12/EF0/sprockets%2F98d5a511dcf32074eef97c372f294a20 +0 -0
  36. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  37. data/spec/dummy/tmp/cache/assets/D38/DB0/sprockets%2Fe4441bec5b04f6a4ad4bf7056181558e +0 -0
  38. data/spec/dummy/tmp/cache/assets/D45/CE0/sprockets%2F6c1b76a50b27d5e7485d41cef59eb427 +0 -0
  39. data/spec/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  40. data/spec/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  41. data/spec/dummy/tmp/cache/assets/D60/400/sprockets%2F1f456ac6c7c736a4407ead0832adb42c +0 -0
  42. data/spec/dummy/tmp/cache/assets/D72/880/sprockets%2Fe5615e8c12de3dbb5626aee43388cb39 +0 -0
  43. data/spec/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  44. data/spec/dummy/tmp/cache/assets/DDD/910/sprockets%2Ff8ed9a8d47ac232db51e9c7adb8377a9 +0 -0
  45. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  46. data/spec/dummy/tmp/cache/assets/E09/D90/sprockets%2Fd85890cff0dcafde74d69601baae198e +0 -0
  47. data/spec/dummy/tmp/cache/assets/E3C/B20/sprockets%2Fde9e6fc28cd2dfe38cc53fd0455b5b9e +0 -0
  48. data/spec/dummy/tmp/cache/sass/19921c2f5bb8eaa817ba254313d0f93dbf32f1df/opensesame.css.scssc +0 -0
  49. data/spec/dummy/tmp/cache/sass/19921c2f5bb8eaa817ba254313d0f93dbf32f1df/opensesame_bootstrap.css.scssc +0 -0
  50. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_accordion.scssc +0 -0
  51. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_alerts.scssc +0 -0
  52. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_breadcrumbs.scssc +0 -0
  53. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_button-groups.scssc +0 -0
  54. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_buttons.scssc +0 -0
  55. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_carousel.scssc +0 -0
  56. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_close.scssc +0 -0
  57. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_code.scssc +0 -0
  58. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_component-animations.scssc +0 -0
  59. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_dropdowns.scssc +0 -0
  60. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_forms.scssc +0 -0
  61. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_grid.scssc +0 -0
  62. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_hero-unit.scssc +0 -0
  63. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_labels-badges.scssc +0 -0
  64. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_layouts.scssc +0 -0
  65. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_mixins.scssc +0 -0
  66. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_modals.scssc +0 -0
  67. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_navbar.scssc +0 -0
  68. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_navs.scssc +0 -0
  69. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_pager.scssc +0 -0
  70. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_pagination.scssc +0 -0
  71. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_popovers.scssc +0 -0
  72. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_progress-bars.scssc +0 -0
  73. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_reset.scssc +0 -0
  74. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_scaffolding.scssc +0 -0
  75. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_sprites.scssc +0 -0
  76. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_tables.scssc +0 -0
  77. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_thumbnails.scssc +0 -0
  78. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_tooltip.scssc +0 -0
  79. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_type.scssc +0 -0
  80. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_utilities.scssc +0 -0
  81. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_variables.scssc +0 -0
  82. data/spec/dummy/tmp/cache/sass/bf8de80767f3492905bcacdfb6abfd679aef3272/_wells.scssc +0 -0
  83. data/spec/dummy/tmp/cache/sass/c0430781249a04c227e0b0aca38159d7478590b1/_bootstrap.scssc +0 -0
  84. data/spec/dummy/tmp/capybara/{capybara-201205020845417136358435.html → capybara-201208201553167621643394.html} +2 -0
  85. data/spec/lib/open_sesame/configuration_spec.rb +0 -40
  86. data/spec/lib/open_sesame/github_auth_spec.rb +30 -0
  87. data/spec/lib/open_sesame/github_warden_spec.rb +44 -0
  88. data/spec/lib/open_sesame/member_spec.rb +51 -0
  89. data/spec/lib/open_sesame/sessions_spec.rb +23 -8
  90. data/spec/lib/open_sesame_spec.rb +7 -2
  91. data/spec/spec_helper.rb +0 -3
  92. data/spec/support/capybara.rb +24 -0
  93. data/spec/support/request_helpers.rb +61 -0
  94. data/spec/support/vcr.rb +22 -0
  95. data/spec/vcr/member/retrieves_attributes_from_github.yml +46 -0
  96. data/spec/vcr/member/returns_nil_if_no_github_member_found.yml +46 -0
  97. data/spec/vcr/member/serialize_from_session_returns_member_from_given_member_id.yml +89 -0
  98. data/spec/vcr/member/serialize_into_session_returns_given_member_id_in_array.yml +46 -0
  99. data/spec/vcr/session/allows_auto_login.yml +132 -0
  100. data/spec/vcr/session/enforces_opensesame_login.yml +132 -0
  101. data/spec/vcr/session/skips_auto_login_if_just_logged_out.yml +175 -0
  102. data/spec/vcr/session/tries_auto_login_and_ends_up_on_opensesame_page_after_failure.yml +46 -0
  103. metadata +239 -41
  104. data/app/assets/javascripts/open_sesame/application.js +0 -15
  105. data/app/assets/stylesheets/open_sesame/opensesame_bootstrap.css.scss +0 -8
  106. data/lib/open_sesame/failure_app.rb +0 -14
  107. data/spec/dummy/tmp/capybara/capybara-201205020845084431324775.html +0 -14
  108. data/spec/dummy/tmp/capybara/capybara-201205020846032430049397.html +0 -14
  109. data/spec/dummy/tmp/capybara/capybara-201205020848165144257335.html +0 -26
  110. data/spec/dummy/tmp/capybara/capybara-201205020849371072293414.html +0 -26
  111. data/spec/dummy/tmp/capybara/capybara-201205020851069360249571.html +0 -26
@@ -1,6 +1,135 @@
1
-  (0.1ms) select sqlite_version(*)
2
-  (2.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
3
-  (0.0ms) PRAGMA index_list("schema_migrations")
4
-  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
5
-  (0.2ms) select sqlite_version(*)
6
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
1
+
2
+
3
+ Started GET "/" for 127.0.0.1 at 2012-08-14 19:08:04 -0400
4
+ Processing by HomeController#index as HTML
5
+ Completed in 0ms
6
+ Processing by OpenSesame::SessionsController#new as HTML
7
+ Rendered /Users/ross/dev/opensesame/app/views/open_sesame/sessions/new.html.erb within layouts/open_sesame/application (2.4ms)
8
+ Compiled open_sesame/opensesame_bootstrap.css (1661ms) (pid 96202)
9
+ Compiled open_sesame/opensesame.css (51ms) (pid 96202)
10
+ Compiled open_sesame/application.css (1731ms) (pid 96202)
11
+ Compiled jquery.js (2ms) (pid 96202)
12
+ Compiled jquery_ujs.js (0ms) (pid 96202)
13
+ Compiled open_sesame/application.js (52ms) (pid 96202)
14
+ Completed 200 OK in 1836ms (Views: 1836.1ms | ActiveRecord: 0.0ms)
15
+
16
+
17
+ Started GET "/assets/open_sesame/application.css?body=1" for 127.0.0.1 at 2012-08-14 19:08:06 -0400
18
+ Served asset /open_sesame/application.css - 200 OK (45ms)
19
+
20
+
21
+ Started GET "/assets/open_sesame/opensesame_bootstrap.css?body=1" for 127.0.0.1 at 2012-08-14 19:08:06 -0400
22
+ Served asset /open_sesame/opensesame_bootstrap.css - 200 OK (6ms)
23
+
24
+
25
+ Started GET "/assets/open_sesame/opensesame.css?body=1" for 127.0.0.1 at 2012-08-14 19:08:06 -0400
26
+ Served asset /open_sesame/opensesame.css - 200 OK (2ms)
27
+
28
+
29
+ Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2012-08-14 19:08:06 -0400
30
+ Served asset /jquery.js - 200 OK (2ms)
31
+
32
+
33
+ Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2012-08-14 19:08:06 -0400
34
+ Served asset /jquery_ujs.js - 200 OK (2ms)
35
+
36
+
37
+ Started GET "/assets/open_sesame/application.js?body=1" for 127.0.0.1 at 2012-08-14 19:08:06 -0400
38
+ Served asset /open_sesame/application.js - 200 OK (7ms)
39
+
40
+
41
+ Started GET "/opensesame/auth/request" for 127.0.0.1 at 2012-08-14 19:08:33 -0400
42
+ [OpenSesame] Request phase initiated.
43
+ [OpenSesame] site: http://localhost:3001
44
+
45
+
46
+ Started GET "/oauth/authorize?response_type=code&client_id=415c4bf9e98b5ee7d131aca970cb98315bafdae296d1fa6695efe4eb050bfda9&redirect_uri=http%3A%2F%2Flocalhost%3A3001%2Fopensesame%2Fauth%2Fcallback" for 127.0.0.1 at 2012-08-14 19:08:33 -0400
47
+
48
+ ActionController::RoutingError (No route matches [GET] "/oauth/authorize"):
49
+ actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
50
+ actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
51
+ railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
52
+ railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
53
+ actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
54
+ rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
55
+ rack (1.4.1) lib/rack/runtime.rb:17:in `call'
56
+ activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
57
+ rack (1.4.1) lib/rack/lock.rb:15:in `call'
58
+ actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
59
+ railties (3.2.3) lib/rails/engine.rb:479:in `call'
60
+ railties (3.2.3) lib/rails/application.rb:220:in `call'
61
+ rack (1.4.1) lib/rack/content_length.rb:14:in `call'
62
+ railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
63
+ rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
64
+ /Users/ross/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
65
+ /Users/ross/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
66
+ /Users/ross/.rvm/rubies/ruby-1.9.3-preview1/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'
67
+
68
+
69
+ Rendered /Users/ross/.rvm/gems/ruby-1.9.3-preview1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.6ms)
70
+
71
+
72
+ Started GET "/" for 127.0.0.1 at 2012-08-14 19:09:30 -0400
73
+ Processing by HomeController#index as HTML
74
+ Completed in 0ms
75
+ Processing by OpenSesame::SessionsController#new as HTML
76
+ Rendered /Users/ross/dev/opensesame/app/views/open_sesame/sessions/new.html.erb within layouts/open_sesame/application (17.6ms)
77
+ Completed 200 OK in 47ms (Views: 46.6ms | ActiveRecord: 0.0ms)
78
+
79
+
80
+ Started GET "/assets/open_sesame/application.css?body=1" for 127.0.0.1 at 2012-08-14 19:09:30 -0400
81
+ Served asset /open_sesame/application.css - 304 Not Modified (28ms)
82
+
83
+
84
+ Started GET "/assets/open_sesame/opensesame.css?body=1" for 127.0.0.1 at 2012-08-14 19:09:30 -0400
85
+ Served asset /open_sesame/opensesame.css - 304 Not Modified (2ms)
86
+
87
+
88
+ Started GET "/assets/open_sesame/opensesame_bootstrap.css?body=1" for 127.0.0.1 at 2012-08-14 19:09:30 -0400
89
+ Served asset /open_sesame/opensesame_bootstrap.css - 304 Not Modified (6ms)
90
+
91
+
92
+ Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2012-08-14 19:09:30 -0400
93
+ Served asset /jquery_ujs.js - 304 Not Modified (1ms)
94
+
95
+
96
+ Started GET "/assets/open_sesame/application.js?body=1" for 127.0.0.1 at 2012-08-14 19:09:30 -0400
97
+ Served asset /open_sesame/application.js - 304 Not Modified (5ms)
98
+
99
+
100
+ Started GET "/opensesame/auth/request" for 127.0.0.1 at 2012-08-14 19:09:39 -0400
101
+ [OpenSesame] Request phase initiated.
102
+ [OpenSesame] site: http://localhost:3000
103
+
104
+
105
+ Started GET "/opensesame/auth/callback?code=95a0c1d5d3ea56e24556185fd6748b97ce0a88aae85fb8bcbaeb376b76e14982" for 127.0.0.1 at 2012-08-14 19:09:55 -0400
106
+ [OpenSesame] Callback phase initiated.
107
+ [OpenSesame] site: http://localhost:3000
108
+ Processing by OpenSesame::SessionsController#create as HTML
109
+ Parameters: {"code"=>"95a0c1d5d3ea56e24556185fd6748b97ce0a88aae85fb8bcbaeb376b76e14982"}
110
+ Redirected to http://localhost:3001/
111
+ Completed 302 Found in 3ms (ActiveRecord: 0.0ms)
112
+
113
+
114
+ Started GET "/" for 127.0.0.1 at 2012-08-14 19:09:56 -0400
115
+ Processing by HomeController#index as HTML
116
+ Rendered home/index.html.erb within layouts/application (0.3ms)
117
+ Compiled application.css (0ms) (pid 96235)
118
+ Compiled application.js (23ms) (pid 96235)
119
+ Completed 200 OK in 58ms (Views: 58.2ms | ActiveRecord: 0.0ms)
120
+
121
+
122
+ Started GET "/assets/application.css?body=1" for 127.0.0.1 at 2012-08-14 19:09:56 -0400
123
+ Served asset /application.css - 200 OK (2ms)
124
+
125
+
126
+ Started GET "/assets/jquery.js?body=1" for 127.0.0.1 at 2012-08-14 19:09:56 -0400
127
+ Served asset /jquery.js - 304 Not Modified (6ms)
128
+
129
+
130
+ Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-08-14 19:09:56 -0400
131
+ Served asset /application.js - 200 OK (6ms)
132
+
133
+
134
+ Started GET "/assets/jquery_ujs.js?body=1" for 127.0.0.1 at 2012-08-14 19:09:56 -0400
135
+ Served asset /jquery_ujs.js - 304 Not Modified (0ms)