omniauth-aai 0.5.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (245) hide show
  1. checksums.yaml +7 -0
  2. data/.DS_Store +0 -0
  3. data/.rspec +2 -0
  4. data/Gemfile +1 -1
  5. data/Gemfile.lock +153 -123
  6. data/LICENSE.txt +21 -0
  7. data/README.md +8 -33
  8. data/lib/.DS_Store +0 -0
  9. data/lib/generators/aai/setup_generator.rb +44 -0
  10. data/lib/generators/aai/templates/migration.rb +18 -2
  11. data/lib/generators/aai/templates/omniauth.rb +18 -6
  12. data/lib/generators/aai/templates/session_controller.rb +6 -8
  13. data/lib/generators/aai/templates/user.rb +25 -9
  14. data/lib/omniauth-aai.rb +2 -1
  15. data/lib/omniauth-aai/version.rb +1 -1
  16. data/lib/omniauth/has_current_user.rb +57 -0
  17. data/lib/omniauth/strategies/aai.rb +117 -88
  18. data/omniauth-aai.gemspec +23 -17
  19. data/spec/example_rails3_app/.DS_Store +0 -0
  20. data/spec/{example_rails_app → example_rails3_app}/.gitignore +0 -0
  21. data/spec/{example_rails_app → example_rails3_app}/Gemfile +2 -4
  22. data/spec/example_rails3_app/Gemfile.lock +123 -0
  23. data/spec/{example_rails_app → example_rails3_app}/Rakefile +0 -0
  24. data/spec/{example_rails_app → example_rails3_app}/app/assets/images/rails.png +0 -0
  25. data/spec/{example_rails_app → example_rails3_app}/app/assets/javascripts/application.js +0 -0
  26. data/spec/{example_rails_app → example_rails3_app}/app/assets/javascripts/welcome.js.coffee +0 -0
  27. data/spec/{example_rails_app → example_rails3_app}/app/assets/stylesheets/application.css +0 -0
  28. data/spec/{example_rails_app → example_rails3_app}/app/assets/stylesheets/welcome.css.scss +0 -0
  29. data/spec/{example_rails_app → example_rails3_app}/app/controllers/application_controller.rb +0 -0
  30. data/spec/{example_rails_app → example_rails3_app}/app/controllers/welcome_controller.rb +4 -2
  31. data/spec/{example_rails_app → example_rails3_app}/app/helpers/application_helper.rb +0 -0
  32. data/spec/{example_rails_app → example_rails3_app}/app/helpers/welcome_helper.rb +0 -0
  33. data/spec/{example_rails_app → example_rails3_app}/app/mailers/.gitkeep +0 -0
  34. data/spec/{example_rails_app → example_rails3_app}/app/models/.gitkeep +0 -0
  35. data/spec/example_rails3_app/app/views/.DS_Store +0 -0
  36. data/spec/{example_rails_app → example_rails3_app}/app/views/layouts/application.html.erb +0 -0
  37. data/spec/{example_rails_app → example_rails3_app}/app/views/welcome/index.html.erb +0 -0
  38. data/spec/{example_rails_app → example_rails3_app}/app/views/welcome/protected.html.erb +0 -0
  39. data/spec/{example_rails_app → example_rails3_app}/change_application_controller.rb +0 -0
  40. data/spec/{example_rails_app → example_rails3_app}/config.ru +0 -0
  41. data/spec/{example_rails_app → example_rails3_app}/config/application.rb +1 -6
  42. data/spec/{example_rails_app → example_rails3_app}/config/boot.rb +0 -0
  43. data/spec/{example_rails_app → example_rails3_app}/config/database.yml +0 -0
  44. data/spec/{example_rails_app → example_rails3_app}/config/environment.rb +0 -0
  45. data/spec/{example_rails_app → example_rails3_app}/config/environments/development.rb +1 -6
  46. data/spec/{example_rails_app → example_rails3_app}/config/environments/production.rb +0 -3
  47. data/spec/{example_rails_app → example_rails3_app}/config/environments/test.rb +2 -3
  48. data/spec/{example_rails_app → example_rails3_app}/config/initializers/backtrace_silencers.rb +0 -0
  49. data/spec/{example_rails_app → example_rails3_app}/config/initializers/inflections.rb +0 -0
  50. data/spec/{example_rails_app → example_rails3_app}/config/initializers/mime_types.rb +0 -0
  51. data/spec/{example_rails_app → example_rails3_app}/config/initializers/secret_token.rb +1 -0
  52. data/spec/{example_rails_app → example_rails3_app}/config/initializers/session_store.rb +0 -0
  53. data/spec/{example_rails_app → example_rails3_app}/config/initializers/wrap_parameters.rb +0 -0
  54. data/spec/{example_rails_app → example_rails3_app}/config/locales/en.yml +0 -0
  55. data/spec/{example_rails_app → example_rails3_app}/config/routes.rb +2 -2
  56. data/spec/example_rails3_app/db/development.sqlite3 +0 -0
  57. data/spec/example_rails3_app/db/schema.rb +16 -0
  58. data/spec/{example_rails_app → example_rails3_app}/db/seeds.rb +0 -0
  59. data/spec/example_rails3_app/db/test.sqlite3 +0 -0
  60. data/spec/{example_rails_app → example_rails3_app}/doc/README_FOR_APP +0 -0
  61. data/spec/{example_rails_app → example_rails3_app}/lib/assets/.gitkeep +0 -0
  62. data/spec/{example_rails_app → example_rails3_app}/lib/tasks/.gitkeep +0 -0
  63. data/spec/{example_rails_app → example_rails3_app}/log/.gitkeep +0 -0
  64. data/spec/example_rails3_app/log/development.log +741 -0
  65. data/spec/example_rails3_app/log/test.log +24 -0
  66. data/spec/{example_rails_app → example_rails3_app}/public/404.html +0 -0
  67. data/spec/{example_rails_app → example_rails3_app}/public/422.html +0 -0
  68. data/spec/{example_rails_app → example_rails3_app}/public/500.html +0 -0
  69. data/spec/{example_rails_app → example_rails3_app}/public/favicon.ico +0 -0
  70. data/spec/{example_rails_app → example_rails3_app}/public/robots.txt +0 -0
  71. data/spec/{example_rails_app → example_rails3_app}/script/rails +0 -0
  72. data/spec/{example_rails_app → example_rails3_app}/test/fixtures/.gitkeep +0 -0
  73. data/spec/{example_rails_app → example_rails3_app}/test/functional/.gitkeep +0 -0
  74. data/spec/{example_rails_app → example_rails3_app}/test/functional/welcome_controller_test.rb +0 -0
  75. data/spec/{example_rails_app → example_rails3_app}/test/integration/.gitkeep +0 -0
  76. data/spec/{example_rails_app → example_rails3_app}/test/performance/browsing_test.rb +0 -0
  77. data/spec/{example_rails_app → example_rails3_app}/test/test_helper.rb +0 -0
  78. data/spec/{example_rails_app → example_rails3_app}/test/unit/.gitkeep +0 -0
  79. data/spec/{example_rails_app → example_rails3_app}/test/unit/helpers/welcome_helper_test.rb +0 -0
  80. data/spec/example_rails3_app/tmp/cache/assets/C26/690/sprockets%2F93708cb34051f3000884905e8669d74a +0 -0
  81. data/spec/example_rails3_app/tmp/cache/assets/C30/B40/sprockets%2Ff006fa583c943775b96596827195b022 +0 -0
  82. data/spec/example_rails3_app/tmp/cache/assets/C5C/B50/sprockets%2F7a556208881f6d893d11269bf2a09158 +0 -0
  83. data/spec/example_rails3_app/tmp/cache/assets/C83/640/sprockets%2F3233432f81669b9bd10ef726c526d348 +0 -0
  84. data/spec/example_rails3_app/tmp/cache/assets/CD0/AB0/sprockets%2F2211190fb757d05874e2b25fc37a31ad +0 -0
  85. data/spec/example_rails3_app/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  86. data/spec/example_rails3_app/tmp/cache/assets/CE2/AD0/sprockets%2Fbd71546009ab5e606b3f27b4c6a79856 +0 -0
  87. data/spec/example_rails3_app/tmp/cache/assets/D14/000/sprockets%2Fffd7643b7c429e23bdb2281097a5e096 +0 -0
  88. data/spec/example_rails3_app/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  89. data/spec/example_rails3_app/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  90. data/spec/example_rails3_app/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  91. data/spec/example_rails3_app/tmp/cache/assets/D5E/170/sprockets%2F2f2229c70dcf195564d4d0fd6a12ac1a +0 -0
  92. data/spec/example_rails3_app/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  93. data/spec/example_rails3_app/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  94. data/spec/example_rails3_app/tmp/cache/assets/E29/9D0/sprockets%2Fea5ba88ffb1f831008ba38ed70bd8cfa +0 -0
  95. data/spec/example_rails3_app/tmp/cache/assets/E3F/0C0/sprockets%2F9addc9febe49c19a6eee9360f156afe3 +0 -0
  96. data/spec/{example_rails_app → example_rails3_app}/vendor/assets/javascripts/.gitkeep +0 -0
  97. data/spec/{example_rails_app → example_rails3_app}/vendor/assets/stylesheets/.gitkeep +0 -0
  98. data/spec/{example_rails_app → example_rails3_app}/vendor/plugins/.gitkeep +0 -0
  99. data/spec/example_rails4_app/.gitignore +17 -0
  100. data/spec/example_rails4_app/Gemfile +46 -0
  101. data/spec/example_rails4_app/Gemfile.lock +171 -0
  102. data/spec/example_rails4_app/README.rdoc +28 -0
  103. data/spec/example_rails4_app/Rakefile +6 -0
  104. data/spec/example_rails4_app/app/assets/images/.keep +0 -0
  105. data/spec/example_rails4_app/app/assets/javascripts/application.js +16 -0
  106. data/spec/example_rails4_app/app/assets/stylesheets/application.css +15 -0
  107. data/spec/example_rails4_app/app/controllers/application_controller.rb +4 -0
  108. data/spec/example_rails4_app/app/controllers/concerns/.keep +0 -0
  109. data/spec/example_rails4_app/app/controllers/session_controller.rb +38 -0
  110. data/spec/example_rails4_app/app/controllers/welcome_controller.rb +11 -0
  111. data/spec/example_rails4_app/app/helpers/application_helper.rb +2 -0
  112. data/spec/example_rails4_app/app/mailers/.keep +0 -0
  113. data/spec/example_rails4_app/app/models/.keep +0 -0
  114. data/spec/example_rails4_app/app/models/concerns/.keep +0 -0
  115. data/spec/example_rails4_app/app/models/user.rb +57 -0
  116. data/spec/example_rails4_app/app/views/.DS_Store +0 -0
  117. data/spec/example_rails4_app/app/views/layouts/application.html.erb +14 -0
  118. data/spec/example_rails4_app/app/views/welcome/index.html.erb +3 -0
  119. data/spec/example_rails4_app/app/views/welcome/protected.html.erb +2 -0
  120. data/spec/example_rails4_app/bin/bundle +3 -0
  121. data/spec/example_rails4_app/bin/rails +8 -0
  122. data/spec/example_rails4_app/bin/rake +8 -0
  123. data/spec/example_rails4_app/bin/setup +29 -0
  124. data/spec/example_rails4_app/bin/spring +15 -0
  125. data/spec/example_rails4_app/config.ru +4 -0
  126. data/spec/example_rails4_app/config/application.rb +26 -0
  127. data/spec/example_rails4_app/config/boot.rb +3 -0
  128. data/spec/example_rails4_app/config/database.yml +25 -0
  129. data/spec/example_rails4_app/config/environment.rb +5 -0
  130. data/spec/example_rails4_app/config/environments/development.rb +41 -0
  131. data/spec/example_rails4_app/config/environments/production.rb +79 -0
  132. data/spec/example_rails4_app/config/environments/test.rb +42 -0
  133. data/spec/example_rails4_app/config/initializers/assets.rb +11 -0
  134. data/spec/example_rails4_app/config/initializers/backtrace_silencers.rb +7 -0
  135. data/spec/example_rails4_app/config/initializers/cookies_serializer.rb +3 -0
  136. data/spec/example_rails4_app/config/initializers/filter_parameter_logging.rb +4 -0
  137. data/spec/example_rails4_app/config/initializers/inflections.rb +16 -0
  138. data/spec/example_rails4_app/config/initializers/mime_types.rb +4 -0
  139. data/spec/example_rails4_app/config/initializers/omniauth.rb +23 -0
  140. data/spec/example_rails4_app/config/initializers/session_store.rb +3 -0
  141. data/spec/example_rails4_app/config/initializers/wrap_parameters.rb +14 -0
  142. data/spec/example_rails4_app/config/locales/en.yml +23 -0
  143. data/spec/example_rails4_app/config/routes.rb +10 -0
  144. data/spec/example_rails4_app/config/secrets.yml +22 -0
  145. data/spec/example_rails4_app/db/development.sqlite3 +0 -0
  146. data/spec/example_rails4_app/db/migrate/20150528142303_aai_create_user.rb +20 -0
  147. data/spec/example_rails4_app/db/migrate/20150609094544_create_aai_user.rb +26 -0
  148. data/spec/example_rails4_app/db/schema.rb +33 -0
  149. data/spec/example_rails4_app/db/seeds.rb +7 -0
  150. data/spec/example_rails4_app/lib/assets/.keep +0 -0
  151. data/spec/example_rails4_app/lib/tasks/.keep +0 -0
  152. data/spec/example_rails4_app/log/.keep +0 -0
  153. data/spec/example_rails4_app/log/development.log +7189 -0
  154. data/spec/example_rails4_app/log/test.log +0 -0
  155. data/spec/example_rails4_app/public/404.html +67 -0
  156. data/spec/example_rails4_app/public/422.html +67 -0
  157. data/spec/example_rails4_app/public/500.html +66 -0
  158. data/spec/example_rails4_app/public/favicon.ico +0 -0
  159. data/spec/example_rails4_app/public/robots.txt +5 -0
  160. data/spec/example_rails4_app/test/controllers/.keep +0 -0
  161. data/spec/example_rails4_app/test/fixtures/.keep +0 -0
  162. data/spec/example_rails4_app/test/helpers/.keep +0 -0
  163. data/spec/example_rails4_app/test/integration/.keep +0 -0
  164. data/spec/example_rails4_app/test/mailers/.keep +0 -0
  165. data/spec/example_rails4_app/test/models/.keep +0 -0
  166. data/spec/example_rails4_app/test/test_helper.rb +10 -0
  167. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/1s_XCxu5Ta3ZrQVnXIYvLyRMXFQo20cDx9dOl2Z2iF8.cache +1 -0
  168. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/29DyBLYZiyJ3FlvLIMPsG2-7J8nAW42idLjWLEVdB_k.cache +0 -0
  169. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/3QbXCZJvxomnkCnjUWHuRcr1GygZ_h2BHAvxwpDe8_s.cache +1 -0
  170. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/4DpD3QisvkI9coAiaW5J81R3QEdauKikO3Gh5M8mwWo.cache +1 -0
  171. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/6NLgJvQ8d_2Hvs_dsIe78tpsALlFUB02E_yBe-2E5cA.cache +0 -0
  172. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/6jHw85RU0ldd0Q9aN-7rANpT7g1-koNDbSenv-m7smI.cache +1 -0
  173. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/7BAbDbQvvxI5tyXDU4FFEVqkskvwpwBb-Okv_3k7m_A.cache +0 -0
  174. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/9wp0IZ0iih5-OpulhDQiwTcivSJ1B0NGGT3E0QqfUvY.cache +1 -0
  175. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/BNSnmei4pmTUWNUSAxEsb0MthlP4aMS69DOMLpxnO1w.cache +0 -0
  176. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/CuDbyYCWFI80xf5TcM_YGo4vs7XDrDT2uGZbXL1CNlU.cache +1 -0
  177. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/E7vUl62-SGsQ8YapPcF158Pt1JkBL-9rifcB_9dP8Dk.cache +1 -0
  178. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/Gb8DbxW8LZBtcLvB3DaLNTXt5D0MNezSV797OaoPY9Q.cache +1 -0
  179. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/GgQIx53L-9pWadlFfRd5NlAqwNFKf7DLPkPnsnQ7bNk.cache +1 -0
  180. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/GjsYHKbT8fxMeVlnpmarx6Xi-_Ph0QMuk1BHoU4JDrQ.cache +2 -0
  181. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/H4FEyyRC4IJsChOdu1cf9NDgg8w6J1YBVNHaKN92h9o.cache +0 -0
  182. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/If5Lvqrq1tySO8vBUqp2xvRY_mnDfGebBxBP2mxZbZY.cache +0 -0
  183. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/IoT_x37i_0kSKYgLgbJR5-i6lvuoyNhOt9FSw-yILiQ.cache +0 -0
  184. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/JUseOAL-WHjhDijGjAaXwOvZEJUVhMs_jFSMbXunViY.cache +1 -0
  185. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/KJcDzapXqjQsiil8Z8og8g_9qX88kXR8p3pMopsauA8.cache +1 -0
  186. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/KZpDQ14WKjcnWnLxlL99qFCd6ARfk0MsdegUfI30RMk.cache +1 -0
  187. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/KZxCQPT4Q2wX3rHnJZcFGWZPTtq7oNH9llxBAALh43s.cache +1 -0
  188. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/LgV_5lRim8CeylWertau64VwyRxtI51id8BtgIok58g.cache +1 -0
  189. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/Nt-6pBlTra27ZPWSp2yTZSKBAePHJHgDlIoxWTgF9i8.cache +1 -0
  190. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/PHhC5vQizTPXEkJAiD_q9ESL7UlJW-l8Ua2aoWOhv_o.cache +0 -0
  191. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/QRU43JksZxXfCsqux8aCe2yyWueGiamUDi18N8gDA1Q.cache +1 -0
  192. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/RECBJfTHjk7obOczR_QxMkSagYRkmidf_ZawDoZTR8A.cache +1 -0
  193. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/RanHbvC55zjJip0GoEuKsXCXGiMAnd9n7zr67BIqBSw.cache +1 -0
  194. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/S5179qXMIYo2z-pYHnXOtD2IYoz5ac8moYSK7pNt7m8.cache +2 -0
  195. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/SO9WJ6f1sF18HRfzSmwkLdVZZwRBNz1DxAaYtGbOTrE.cache +1 -0
  196. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/SPlj-pwirc-AB3GMeOqDR5gSAiu3j6C7QnAZfGmE9_I.cache +0 -0
  197. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/TGEldewczDNL-pNPKYkePKZe3ySFo2sisfkbnD19W4s.cache +2 -0
  198. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/TdlxPZJxUr_7HWj7CrC81yJyV0-40_Ogqo_1NTaEoIU.cache +1 -0
  199. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/TowmqkMiUGEwvy7lnHQ_88ROBl0yb2D4yH0ugiNjvfA.cache +1 -0
  200. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/Tp7wu_U3u6gFUnDoUHA40bWXyFOSSxNiXK6XPRwYmYU.cache +1 -0
  201. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/TqgWeb7o7Z23teWSLaSdF-f3_8aYzRVbBVZhQUHuZVc.cache +1 -0
  202. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/VOp0pIv_pTt1jyD5JQn5Ee721CyQFQTGdnz4ODw38i4.cache +0 -0
  203. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/W8O66kikznV0XXIhsnH-3dHWm24NyxyK2BbzZvEssto.cache +0 -0
  204. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/YLGfTegl3aFlYlDF7dfyQ5OuL6B6D3l-mcGVqtWnVQ8.cache +1 -0
  205. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/YngNHAn-McYDpn3H2vj5Cfs7jvy6y0xXgV2lm-QqytU.cache +0 -0
  206. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/_J-JFAM5KZ8G3xUcVV9ht5vdsdH3wHg737JhiRTNl30.cache +1 -0
  207. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/apXOQCHHr7toaELV0vOhGpGHp0qsm15GmPpb-6SA6GI.cache +0 -0
  208. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/c5jVOyypWys4L2Hoyc4U84gCAJg3tGepalH4_wvPjag.cache +1 -0
  209. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/c8Xfpa8RSionpn-Hbvc5pDqvktT2tZDhvRCrUD1V_Oo.cache +1 -0
  210. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/cihMJr_YPzjx-OxZT97hhVuVpY1rkTjbZmXFd8XHCaU.cache +3 -0
  211. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/dHMPXPs1sOQ-fiWIOHBlX15A53Jm0CIPz2F_hNdtS3M.cache +1 -0
  212. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/e99bn4nHgVDcocbTGKcEmDNK9c_hXbgX6QjCJFCZHJM.cache +0 -0
  213. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/fLv1zUMqDQeVn2AWONn1mWotZV-MKGL2VWCOWalnPkg.cache +0 -0
  214. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/fWQJziLu4L1W29En3opeg-1CsjRQBWmvxu9pCs4bXj8.cache +1 -0
  215. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/gLKErIDcQk5SB5QrsCeFTLyCw5500orRLwYeVdZdKMc.cache +1 -0
  216. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/gr63R85vyTqHHJZQ-17HzBTVQzxNIG5ioLBJIG7ylUI.cache +0 -0
  217. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/h94CfaFE7uxKkjg9ok-t1VaNrmPtIlflckdFHhn8HQs.cache +0 -0
  218. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/hE4vknoiDD4JODeZCrqVQJsqIprogjXMLmC8OwA_Jr0.cache +1 -0
  219. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/hS0tOwqtQJaZQ94vExFzOIkbAuInPL-qbhJ_ehyAIdA.cache +0 -0
  220. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/jRTlxo8OfNbF2UFI9yARZfikVm2L6tckGljgpdPKJAE.cache +0 -0
  221. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/jWzKY7vp1V-gp2DIoaBUf6FHlXy64u51evJE2HTEmHw.cache +1 -0
  222. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/qzBkjnl32lQWbp5TzPSAUL1ai7Di46nMpBx4F7m6x5s.cache +1 -0
  223. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/r77JGKq0Pw_xiSzw2prNjqaAF6alyTiTyCsdnbipthY.cache +0 -0
  224. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/rJ0exYcGrKT54S-78fIu6vNCgQs3mDufsDxQ14gI_8E.cache +0 -0
  225. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/rx80cSLfrwi0ZB09RMu0y303mn2cqY0n-HVvX4OZSvg.cache +1 -0
  226. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/t86ZINxINr8OvlNbaSMwdIJCEKNwBO6brBig2BlQM14.cache +0 -0
  227. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/tXvI8895yJKqfChNv65cTiwS7lytvZHFz1fXzFbzVeM.cache +1 -0
  228. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/ueBgJWdtY_h7B_DpJgfhaB1zK-p3TTKWfXHuoog1ee0.cache +1 -0
  229. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/umu0vtYbA7uPY--szPF2GZOzRsafL6YLGkxCLx52t0c.cache +3 -0
  230. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/wRYMTVh2J03EQY8OmShoXFHM5q_wkCsogrHuAv8CR6g.cache +1 -0
  231. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/xSK_JYmeNOLhG9YlWG_YGYarb8YLyIeMXHahwRIyhZY.cache +0 -0
  232. data/spec/example_rails4_app/tmp/cache/assets/development/sprockets/v3.0/yLpEexUzUtWqrKQPCErdaCnJUUkxgSLIOShi9XNRKlM.cache +0 -0
  233. data/spec/example_rails4_app/vendor/assets/javascripts/.keep +0 -0
  234. data/spec/example_rails4_app/vendor/assets/stylesheets/.keep +0 -0
  235. data/spec/omniauth/has_current_user_spec.rb +9 -0
  236. data/spec/omniauth/strategies/aai_spec.rb +83 -20
  237. data/spec/omniauth/strategies/brute_force_spec.rb +6 -6
  238. data/spec/spec_helper.rb +12 -6
  239. data/spec/support/omniauth_macros.rb +13 -0
  240. metadata +486 -195
  241. data/lib/action_controller/has_current_user.rb +0 -44
  242. data/lib/generators/aai/install_generator.rb +0 -41
  243. data/omniauth-aai-0.3.gem +0 -0
  244. data/omniauth-aai-0.4.gem +0 -0
  245. data/omniauth-aai-0.5.1.gem +0 -0
@@ -0,0 +1,11 @@
1
+ class WelcomeController < ApplicationController
2
+
3
+ before_filter :authenticate!, except: :index
4
+
5
+ def index
6
+ end
7
+
8
+ def protected
9
+ end
10
+
11
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
File without changes
File without changes
File without changes
@@ -0,0 +1,57 @@
1
+ class User < ActiveRecord::Base
2
+
3
+ # attr_accessible :uid
4
+ attr_accessor :aai
5
+ PERSISTENT = true
6
+
7
+ def self.update_or_create_with_omniauth_aai(omniauth_aai)
8
+ user = find_or_build_with_uid(omniauth_aai['uid'])
9
+ user.attributes = {
10
+ unique_id: omniauth_aai.info.unique_id,
11
+ persistent_id: omniauth_aai.info.persistent_id,
12
+ email: omniauth_aai.info.email,
13
+ first_name: omniauth_aai.info.first_name,
14
+ last_name: omniauth_aai.info.last_name,
15
+ home_organization: omniauth_aai.info.home_organization,
16
+ # affiliation: omniauth_aai.info.affiliation,
17
+ raw_data: omniauth_aai.respond_to?(:to_hash) ? omniauth_aai.to_hash : omniauth_aai.inspect
18
+ }
19
+ user.save
20
+ user
21
+ end
22
+
23
+ def self.find_or_build_with_uid(aai_uid)
24
+ if aai_uid.present?
25
+ where(uid: aai_uid).first || new(uid: aai_uid)
26
+ else
27
+ new
28
+ end
29
+ end
30
+
31
+
32
+ def name
33
+ aai[:info][:name]
34
+ rescue
35
+ nil
36
+ end
37
+
38
+ def email
39
+ aai[:info][:email]
40
+ rescue
41
+ nil
42
+ end
43
+
44
+
45
+ def marshal
46
+ self.uid
47
+ end
48
+
49
+ def self.unmarshal(session_data)
50
+ user = User.find_by_uid(session_data)
51
+ end
52
+
53
+ def unmarshal(session_data)
54
+ self.reload
55
+ end
56
+
57
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>ExampleRails4App</title>
5
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
6
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
7
+ <%= csrf_meta_tags %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,3 @@
1
+ <h1>Welcome#index</h1>
2
+ <p><%= current_user.inspect %></p>
3
+ <%= link_to "protected", welcome_protected_path()%>
@@ -0,0 +1,2 @@
1
+ <h1>AAI Views</h1>
2
+ <p><%= current_user.inspect %></p>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ APP_PATH = File.expand_path('../../config/application', __FILE__)
7
+ require_relative '../config/boot'
8
+ require 'rails/commands'
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env ruby
2
+ begin
3
+ load File.expand_path("../spring", __FILE__)
4
+ rescue LoadError
5
+ end
6
+ require_relative '../config/boot'
7
+ require 'rake'
8
+ Rake.application.run
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+
4
+ # path to your application root.
5
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
6
+
7
+ Dir.chdir APP_ROOT do
8
+ # This script is a starting point to setup your application.
9
+ # Add necessary setup steps to this file:
10
+
11
+ puts "== Installing dependencies =="
12
+ system "gem install bundler --conservative"
13
+ system "bundle check || bundle install"
14
+
15
+ # puts "\n== Copying sample files =="
16
+ # unless File.exist?("config/database.yml")
17
+ # system "cp config/database.yml.sample config/database.yml"
18
+ # end
19
+
20
+ puts "\n== Preparing database =="
21
+ system "bin/rake db:setup"
22
+
23
+ puts "\n== Removing old logs and tempfiles =="
24
+ system "rm -f log/*"
25
+ system "rm -rf tmp/cache"
26
+
27
+ puts "\n== Restarting application server =="
28
+ system "touch tmp/restart.txt"
29
+ end
@@ -0,0 +1,15 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # This file loads spring without using Bundler, in order to be fast.
4
+ # It gets overwritten when you run the `spring binstub` command.
5
+
6
+ unless defined?(Spring)
7
+ require "rubygems"
8
+ require "bundler"
9
+
10
+ if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
11
+ Gem.paths = { "GEM_PATH" => [Bundler.bundle_path.to_s, *Gem.path].uniq }
12
+ gem "spring", match[1]
13
+ require "spring/binstub"
14
+ end
15
+ end
@@ -0,0 +1,4 @@
1
+ # This file is used by Rack-based servers to start the application.
2
+
3
+ require ::File.expand_path('../config/environment', __FILE__)
4
+ run Rails.application
@@ -0,0 +1,26 @@
1
+ require File.expand_path('../boot', __FILE__)
2
+
3
+ require 'rails/all'
4
+
5
+ # Require the gems listed in Gemfile, including any gems
6
+ # you've limited to :test, :development, or :production.
7
+ Bundler.require(*Rails.groups)
8
+
9
+ module ExampleRails4App
10
+ class Application < Rails::Application
11
+ # Settings in config/environments/* take precedence over those specified here.
12
+ # Application configuration should go into files in config/initializers
13
+ # -- all .rb files in that directory are automatically loaded.
14
+
15
+ # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
16
+ # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
17
+ # config.time_zone = 'Central Time (US & Canada)'
18
+
19
+ # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
20
+ # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
21
+ # config.i18n.default_locale = :de
22
+
23
+ # Do not swallow errors in after_commit/after_rollback callbacks.
24
+ config.active_record.raise_in_transactional_callbacks = true
25
+ end
26
+ end
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,25 @@
1
+ # SQLite version 3.x
2
+ # gem install sqlite3
3
+ #
4
+ # Ensure the SQLite 3 gem is defined in your Gemfile
5
+ # gem 'sqlite3'
6
+ #
7
+ default: &default
8
+ adapter: sqlite3
9
+ pool: 5
10
+ timeout: 5000
11
+
12
+ development:
13
+ <<: *default
14
+ database: db/development.sqlite3
15
+
16
+ # Warning: The database defined as "test" will be erased and
17
+ # re-generated from your development database when you run "rake".
18
+ # Do not set this db to the same as development or production.
19
+ test:
20
+ <<: *default
21
+ database: db/test.sqlite3
22
+
23
+ production:
24
+ <<: *default
25
+ database: db/production.sqlite3
@@ -0,0 +1,5 @@
1
+ # Load the Rails application.
2
+ require File.expand_path('../application', __FILE__)
3
+
4
+ # Initialize the Rails application.
5
+ Rails.application.initialize!
@@ -0,0 +1,41 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # In the development environment your application's code is reloaded on
5
+ # every request. This slows down response time but is perfect for development
6
+ # since you don't have to restart the web server when you make code changes.
7
+ config.cache_classes = false
8
+
9
+ # Do not eager load code on boot.
10
+ config.eager_load = false
11
+
12
+ # Show full error reports and disable caching.
13
+ config.consider_all_requests_local = true
14
+ config.action_controller.perform_caching = false
15
+
16
+ # Don't care if the mailer can't send.
17
+ config.action_mailer.raise_delivery_errors = false
18
+
19
+ # Print deprecation notices to the Rails logger.
20
+ config.active_support.deprecation = :log
21
+
22
+ # Raise an error on page load if there are pending migrations.
23
+ config.active_record.migration_error = :page_load
24
+
25
+ # Debug mode disables concatenation and preprocessing of assets.
26
+ # This option may cause significant delays in view rendering with a large
27
+ # number of complex assets.
28
+ config.assets.debug = true
29
+
30
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
31
+ # yet still be able to expire them through the digest params.
32
+ config.assets.digest = true
33
+
34
+ # Adds additional error checking when serving assets at runtime.
35
+ # Checks for improperly declared sprockets dependencies.
36
+ # Raises helpful error messages.
37
+ config.assets.raise_runtime_errors = true
38
+
39
+ # Raises error for missing translations
40
+ # config.action_view.raise_on_missing_translations = true
41
+ end
@@ -0,0 +1,79 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # Code is not reloaded between requests.
5
+ config.cache_classes = true
6
+
7
+ # Eager load code on boot. This eager loads most of Rails and
8
+ # your application in memory, allowing both threaded web servers
9
+ # and those relying on copy on write to perform better.
10
+ # Rake tasks automatically ignore this option for performance.
11
+ config.eager_load = true
12
+
13
+ # Full error reports are disabled and caching is turned on.
14
+ config.consider_all_requests_local = false
15
+ config.action_controller.perform_caching = true
16
+
17
+ # Enable Rack::Cache to put a simple HTTP cache in front of your application
18
+ # Add `rack-cache` to your Gemfile before enabling this.
19
+ # For large-scale production use, consider using a caching reverse proxy like
20
+ # NGINX, varnish or squid.
21
+ # config.action_dispatch.rack_cache = true
22
+
23
+ # Disable serving static files from the `/public` folder by default since
24
+ # Apache or NGINX already handles this.
25
+ config.serve_static_files = ENV['RAILS_SERVE_STATIC_FILES'].present?
26
+
27
+ # Compress JavaScripts and CSS.
28
+ config.assets.js_compressor = :uglifier
29
+ # config.assets.css_compressor = :sass
30
+
31
+ # Do not fallback to assets pipeline if a precompiled asset is missed.
32
+ config.assets.compile = false
33
+
34
+ # Asset digests allow you to set far-future HTTP expiration dates on all assets,
35
+ # yet still be able to expire them through the digest params.
36
+ config.assets.digest = true
37
+
38
+ # `config.assets.precompile` and `config.assets.version` have moved to config/initializers/assets.rb
39
+
40
+ # Specifies the header that your server uses for sending files.
41
+ # config.action_dispatch.x_sendfile_header = 'X-Sendfile' # for Apache
42
+ # config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for NGINX
43
+
44
+ # Force all access to the app over SSL, use Strict-Transport-Security, and use secure cookies.
45
+ # config.force_ssl = true
46
+
47
+ # Use the lowest log level to ensure availability of diagnostic information
48
+ # when problems arise.
49
+ config.log_level = :debug
50
+
51
+ # Prepend all log lines with the following tags.
52
+ # config.log_tags = [ :subdomain, :uuid ]
53
+
54
+ # Use a different logger for distributed setups.
55
+ # config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
56
+
57
+ # Use a different cache store in production.
58
+ # config.cache_store = :mem_cache_store
59
+
60
+ # Enable serving of images, stylesheets, and JavaScripts from an asset server.
61
+ # config.action_controller.asset_host = 'http://assets.example.com'
62
+
63
+ # Ignore bad email addresses and do not raise email delivery errors.
64
+ # Set this to true and configure the email server for immediate delivery to raise delivery errors.
65
+ # config.action_mailer.raise_delivery_errors = false
66
+
67
+ # Enable locale fallbacks for I18n (makes lookups for any locale fall back to
68
+ # the I18n.default_locale when a translation cannot be found).
69
+ config.i18n.fallbacks = true
70
+
71
+ # Send deprecation notices to registered listeners.
72
+ config.active_support.deprecation = :notify
73
+
74
+ # Use default logging formatter so that PID and timestamp are not suppressed.
75
+ config.log_formatter = ::Logger::Formatter.new
76
+
77
+ # Do not dump schema after migrations.
78
+ config.active_record.dump_schema_after_migration = false
79
+ end
@@ -0,0 +1,42 @@
1
+ Rails.application.configure do
2
+ # Settings specified here will take precedence over those in config/application.rb.
3
+
4
+ # The test environment is used exclusively to run your application's
5
+ # test suite. You never need to work with it otherwise. Remember that
6
+ # your test database is "scratch space" for the test suite and is wiped
7
+ # and recreated between test runs. Don't rely on the data there!
8
+ config.cache_classes = true
9
+
10
+ # Do not eager load code on boot. This avoids loading your whole application
11
+ # just for the purpose of running a single test. If you are using a tool that
12
+ # preloads Rails for running tests, you may have to set it to true.
13
+ config.eager_load = false
14
+
15
+ # Configure static file server for tests with Cache-Control for performance.
16
+ config.serve_static_files = true
17
+ config.static_cache_control = 'public, max-age=3600'
18
+
19
+ # Show full error reports and disable caching.
20
+ config.consider_all_requests_local = true
21
+ config.action_controller.perform_caching = false
22
+
23
+ # Raise exceptions instead of rendering exception templates.
24
+ config.action_dispatch.show_exceptions = false
25
+
26
+ # Disable request forgery protection in test environment.
27
+ config.action_controller.allow_forgery_protection = false
28
+
29
+ # Tell Action Mailer not to deliver emails to the real world.
30
+ # The :test delivery method accumulates sent emails in the
31
+ # ActionMailer::Base.deliveries array.
32
+ config.action_mailer.delivery_method = :test
33
+
34
+ # Randomize the order test cases are executed.
35
+ config.active_support.test_order = :random
36
+
37
+ # Print deprecation notices to the stderr.
38
+ config.active_support.deprecation = :stderr
39
+
40
+ # Raises error for missing translations
41
+ # config.action_view.raise_on_missing_translations = true
42
+ end
@@ -0,0 +1,11 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Version of your assets, change this if you want to expire all your assets.
4
+ Rails.application.config.assets.version = '1.0'
5
+
6
+ # Add additional assets to the asset load path
7
+ # Rails.application.config.assets.paths << Emoji.images_path
8
+
9
+ # Precompile additional assets.
10
+ # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
+ # Rails.application.config.assets.precompile += %w( search.js )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!