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.
- checksums.yaml +4 -4
- data/.gitignore +6 -0
- data/.ruby-gemset +1 -1
- data/CONTRIBUTORS.txt +1 -0
- data/README.md +2 -2
- data/Rakefile +3 -3
- data/app/controllers/devise/{oauth2_providable → oauth2}/authorizations_controller.rb +8 -2
- data/app/controllers/devise/oauth2/tokens_controller.rb +23 -0
- data/app/models/devise/oauth2/access_token.rb +39 -0
- data/app/models/devise/oauth2/authorization_code.rb +3 -0
- data/app/models/devise/oauth2/client.rb +29 -0
- data/app/models/devise/{oauth2_providable → oauth2}/refresh_token.rb +1 -1
- data/app/views/devise/{oauth2_providable → oauth2}/authorizations/_form.html.erb +1 -0
- data/app/views/devise/{oauth2_providable → oauth2}/authorizations/error.html.erb +0 -0
- data/app/views/devise/oauth2/authorizations/new.html.erb +8 -0
- data/config/routes.rb +2 -1
- data/db/migrate/20111014160714_create_devise_oauth2_providable_schema.rb +13 -8
- data/devise_oauth2_rails4.gemspec +32 -0
- data/lib/devise/oauth2/engine.rb +16 -0
- data/lib/devise/{oauth2_providable → oauth2}/expirable_token.rb +4 -4
- data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_authorization_code_grantable.rb +0 -0
- data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_password_grantable.rb +0 -0
- data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_providable.rb +3 -3
- data/lib/devise/{oauth2_providable → oauth2}/models/oauth2_refresh_token_grantable.rb +0 -0
- data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_authorization_code_grant_type_strategy.rb +1 -1
- data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_grant_type_strategy.rb +1 -1
- data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_password_grant_type_strategy.rb +1 -1
- data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_providable_strategy.rb +3 -3
- data/lib/devise/{oauth2_providable → oauth2}/strategies/oauth2_refresh_token_grant_type_strategy.rb +2 -2
- data/lib/devise/oauth2/version.rb +5 -0
- data/lib/devise_oauth2_rails4.rb +41 -0
- data/lib/generators/devise/oauth2/migrations_generator.rb +16 -0
- data/lib/generators/devise/oauth2/views_generator.rb +11 -0
- data/rails/tasks/engine.rake +17 -0
- data/spec/controllers/authorizations_controller_spec.rb +1 -1
- data/spec/controllers/protected_controller_spec.rb +1 -1
- data/spec/dummy/app/models/user.rb +1 -1
- data/spec/dummy/app/views/devise/confirmations/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/spec/dummy/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/spec/dummy/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/spec/dummy/app/views/devise/passwords/edit.html.erb +16 -0
- data/spec/dummy/app/views/devise/passwords/new.html.erb +12 -0
- data/spec/dummy/app/views/devise/registrations/edit.html.erb +29 -0
- data/spec/dummy/app/views/devise/registrations/new.html.erb +18 -0
- data/spec/dummy/app/views/devise/sessions/new.html.erb +17 -0
- data/spec/dummy/app/views/devise/shared/_links.erb +25 -0
- data/spec/dummy/app/views/devise/unlocks/new.html.erb +12 -0
- data/spec/dummy/config/application.rb +1 -1
- data/spec/dummy/config/initializers/devise.rb +86 -42
- data/spec/dummy/config/locales/devise.en.yml +49 -48
- data/spec/dummy/config/routes.rb +1 -1
- data/spec/dummy/db/migrate/{20111014161437_create_devise_oauth2_providable_schema.rb → 20140306063000_create_devise_oauth2_providable_schema.rb} +14 -9
- data/spec/dummy/db/schema.rb +34 -28
- data/spec/factories/client_factory.rb +6 -4
- data/spec/factories/user_factory.rb +4 -4
- data/spec/integration/oauth2_authorization_token_grant_type_strategy_spec.rb +2 -2
- data/spec/integration/oauth2_password_grant_type_strategy_spec.rb +2 -2
- data/spec/integration/oauth2_refresh_token_grant_type_strategy_spec.rb +2 -2
- data/spec/lib/devise_oauth2_providable_spec.rb +1 -1
- data/spec/models/access_token_spec.rb +5 -5
- data/spec/models/authorization_code_spec.rb +2 -2
- data/spec/models/client_spec.rb +2 -2
- data/spec/models/refresh_token_spec.rb +3 -3
- data/spec/routing/authorizations_routing_spec.rb +1 -1
- data/spec/routing/tokens_routing_spec.rb +1 -1
- metadata +70 -45
- data/app/controllers/devise/oauth2_providable/tokens_controller.rb +0 -19
- data/app/models/devise/oauth2_providable/access_token.rb +0 -25
- data/app/models/devise/oauth2_providable/authorization_code.rb +0 -3
- data/app/models/devise/oauth2_providable/client.rb +0 -25
- data/app/views/devise/oauth2_providable/authorizations/new.html.erb +0 -4
- data/lib/devise/oauth2_providable/engine.rb +0 -16
- data/lib/devise/oauth2_providable/version.rb +0 -5
- data/lib/devise_oauth2_providable.rb +0 -41
- data/lib/generators/devise_oauth2/views_generator.rb +0 -7
@@ -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')
|