devise_oauth2_rails4 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +6 -0
  3. data/.ruby-gemset +1 -1
  4. data/CONTRIBUTORS.txt +1 -0
  5. data/README.md +2 -2
  6. data/Rakefile +3 -3
  7. data/app/controllers/devise/{oauth2_providable → oauth2}/authorizations_controller.rb +8 -2
  8. data/app/controllers/devise/oauth2/tokens_controller.rb +23 -0
  9. data/app/models/devise/oauth2/access_token.rb +39 -0
  10. data/app/models/devise/oauth2/authorization_code.rb +3 -0
  11. data/app/models/devise/oauth2/client.rb +29 -0
  12. data/app/models/devise/{oauth2_providable → oauth2}/refresh_token.rb +1 -1
  13. data/app/views/devise/{oauth2_providable → oauth2}/authorizations/_form.html.erb +1 -0
  14. data/app/views/devise/{oauth2_providable → oauth2}/authorizations/error.html.erb +0 -0
  15. data/app/views/devise/oauth2/authorizations/new.html.erb +8 -0
  16. data/config/routes.rb +2 -1
  17. data/db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb +13 -8
  18. data/devise_oauth2_rails4.gemspec +32 -0
  19. data/lib/devise/oauth2/engine.rb +16 -0
  20. data/lib/devise/{oauth2_providable → oauth2}/expirable_token.rb +4 -4
  21. data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_authorization_code_grantable.rb +0 -0
  22. data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_password_grantable.rb +0 -0
  23. data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_providable.rb +3 -3
  24. data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_refresh_token_grantable.rb +0 -0
  25. data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_authorization_code_grant_type_strategy.rb +1 -1
  26. data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_grant_type_strategy.rb +1 -1
  27. data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_password_grant_type_strategy.rb +1 -1
  28. data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_providable_strategy.rb +3 -3
  29. data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_refresh_token_grant_type_strategy.rb +2 -2
  30. data/lib/devise/oauth2/version.rb +5 -0
  31. data/lib/devise_oauth2_rails4.rb +41 -0
  32. data/lib/generators/devise/oauth2/migrations_generator.rb +16 -0
  33. data/lib/generators/devise/oauth2/views_generator.rb +11 -0
  34. data/rails/tasks/engine.rake +17 -0
  35. data/spec/controllers/authorizations_controller_spec.rb +1 -1
  36. data/spec/controllers/protected_controller_spec.rb +1 -1
  37. data/spec/dummy/app/models/user.rb +1 -1
  38. data/spec/dummy/app/views/devise/confirmations/new.html.erb +12 -0
  39. data/spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  40. data/spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  41. data/spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  42. data/spec/dummy/app/views/devise/passwords/edit.html.erb +16 -0
  43. data/spec/dummy/app/views/devise/passwords/new.html.erb +12 -0
  44. data/spec/dummy/app/views/devise/registrations/edit.html.erb +29 -0
  45. data/spec/dummy/app/views/devise/registrations/new.html.erb +18 -0
  46. data/spec/dummy/app/views/devise/sessions/new.html.erb +17 -0
  47. data/spec/dummy/app/views/devise/shared/_links.erb +25 -0
  48. data/spec/dummy/app/views/devise/unlocks/new.html.erb +12 -0
  49. data/spec/dummy/config/application.rb +1 -1
  50. data/spec/dummy/config/initializers/devise.rb +86 -42
  51. data/spec/dummy/config/locales/devise.en.yml +49 -48
  52. data/spec/dummy/config/routes.rb +1 -1
  53. data/spec/dummy/db/migrate/{20111014161437_create_devise_oauth2_providable_schema.rb → 20140306063000_create_devise_oauth2_providable_schema.rb} +14 -9
  54. data/spec/dummy/db/schema.rb +34 -28
  55. data/spec/factories/client_factory.rb +6 -4
  56. data/spec/factories/user_factory.rb +4 -4
  57. data/spec/integration/oauth2_authorization_token_grant_type_strategy_spec.rb +2 -2
  58. data/spec/integration/oauth2_password_grant_type_strategy_spec.rb +2 -2
  59. data/spec/integration/oauth2_refresh_token_grant_type_strategy_spec.rb +2 -2
  60. data/spec/lib/devise_oauth2_providable_spec.rb +1 -1
  61. data/spec/models/access_token_spec.rb +5 -5
  62. data/spec/models/authorization_code_spec.rb +2 -2
  63. data/spec/models/client_spec.rb +2 -2
  64. data/spec/models/refresh_token_spec.rb +3 -3
  65. data/spec/routing/authorizations_routing_spec.rb +1 -1
  66. data/spec/routing/tokens_routing_spec.rb +1 -1
  67. metadata +70 -45
  68. data/app/controllers/devise/oauth2_providable/tokens_controller.rb +0 -19
  69. data/app/models/devise/oauth2_providable/access_token.rb +0 -25
  70. data/app/models/devise/oauth2_providable/authorization_code.rb +0 -3
  71. data/app/models/devise/oauth2_providable/client.rb +0 -25
  72. data/app/views/devise/oauth2_providable/authorizations/new.html.erb +0 -4
  73. data/lib/devise/oauth2_providable/engine.rb +0 -16
  74. data/lib/devise/oauth2_providable/version.rb +0 -5
  75. data/lib/devise_oauth2_providable.rb +0 -41
  76. data/lib/generators/devise_oauth2/views_generator.rb +0 -7
@@ -1,5 +0,0 @@
1
- module Devise
2
- module Oauth2Providable
3
- VERSION = "1.1.2"
4
- end
5
- end
@@ -1,41 +0,0 @@
1
- require 'devise'
2
- require 'rack/oauth2'
3
- require 'devise/oauth2_providable/engine'
4
- require 'devise/oauth2_providable/expirable_token'
5
- require 'devise/oauth2_providable/strategies/oauth2_providable_strategy'
6
- require 'devise/oauth2_providable/strategies/oauth2_password_grant_type_strategy'
7
- require 'devise/oauth2_providable/strategies/oauth2_refresh_token_grant_type_strategy'
8
- require 'devise/oauth2_providable/strategies/oauth2_authorization_code_grant_type_strategy'
9
- require 'devise/oauth2_providable/models/oauth2_providable'
10
- require 'devise/oauth2_providable/models/oauth2_password_grantable'
11
- require 'devise/oauth2_providable/models/oauth2_refresh_token_grantable'
12
- require 'devise/oauth2_providable/models/oauth2_authorization_code_grantable'
13
-
14
- module Devise
15
- module Oauth2Providable
16
- CLIENT_ENV_REF = 'oauth2.client'
17
- REFRESH_TOKEN_ENV_REF = "oauth2.refresh_token"
18
-
19
- class << self
20
- def random_id
21
- SecureRandom.hex
22
- end
23
- def table_name_prefix
24
- 'oauth2_'
25
- end
26
- end
27
- end
28
- end
29
-
30
- Devise.add_module(:oauth2_providable,
31
- :strategy => true,
32
- :model => 'devise/oauth2_providable/models/oauth2_providable')
33
- Devise.add_module(:oauth2_password_grantable,
34
- :strategy => true,
35
- :model => 'devise/oauth2_providable/models/oauth2_password_grantable')
36
- Devise.add_module(:oauth2_refresh_token_grantable,
37
- :strategy => true,
38
- :model => 'devise/oauth2_providable/models/oauth2_refresh_token_grantable')
39
- Devise.add_module(:oauth2_authorization_code_grantable,
40
- :strategy => true,
41
- :model => 'devise/oauth2_providable/models/oauth2_authorization_code_grantable')
@@ -1,7 +0,0 @@
1
- class ViewsGenerator < Rails::Generators::Base
2
-
3
- File.open(File.expand_path('../../../../app/views/devise_outh/authorize.html.haml', __FILE__), 'w+') do f
4
- f << 'helo'
5
- end
6
-
7
- end