stormpath-rails 1.1.2.beta → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.rspec +1 -1
- data/.rubocop.yml +22 -0
- data/.travis.yml +6 -3
- data/Gemfile +10 -3
- data/README.md +139 -142
- data/Rakefile +9 -9
- data/app/assets/stylesheets/stormpath.css.scss +3 -2
- data/app/controllers/stormpath/rails/base_controller.rb +25 -6
- data/app/controllers/stormpath/rails/change_password/create_controller.rb +68 -0
- data/app/controllers/stormpath/rails/change_password/new_controller.rb +38 -0
- data/app/controllers/stormpath/rails/forgot_password/create_controller.rb +37 -0
- data/app/controllers/stormpath/rails/forgot_password/new_controller.rb +14 -0
- data/app/controllers/stormpath/rails/login/create_controller.rb +60 -0
- data/app/controllers/stormpath/rails/login/new_controller.rb +20 -0
- data/app/controllers/stormpath/rails/logout/create_controller.rb +61 -0
- data/app/controllers/stormpath/rails/oauth2/create_controller.rb +82 -0
- data/app/controllers/stormpath/rails/oauth2/new_controller.rb +11 -0
- data/app/controllers/stormpath/rails/profile/show_controller.rb +15 -0
- data/app/controllers/stormpath/rails/register/create_controller.rb +86 -0
- data/app/controllers/stormpath/rails/register/new_controller.rb +20 -0
- data/app/controllers/stormpath/rails/verify_email/create_controller.rb +37 -0
- data/app/controllers/stormpath/rails/verify_email/show_controller.rb +51 -0
- data/app/forms/stormpath/rails/login_form.rb +60 -0
- data/app/forms/stormpath/rails/registration_form.rb +106 -0
- data/app/forms/stormpath/rails/registration_form_fields.rb +71 -0
- data/app/helpers/social_helper.rb +2 -1
- data/app/serializers/stormpath/rails/account_serializer.rb +32 -0
- data/app/serializers/stormpath/rails/form_serializer.rb +37 -0
- data/app/serializers/stormpath/rails/login_new_serializer.rb +11 -0
- data/app/serializers/stormpath/rails/profile_serializer.rb +71 -0
- data/app/serializers/stormpath/rails/registration_form_serializer.rb +11 -0
- data/app/services/stormpath/rails/account_from_access_token/local_account_resolution.rb +48 -0
- data/app/services/stormpath/rails/account_from_access_token/stormpath_account_resolution.rb +27 -0
- data/app/services/stormpath/rails/account_from_access_token.rb +33 -0
- data/app/services/stormpath/rails/account_login.rb +28 -0
- data/app/services/stormpath/rails/account_login_with_stormpath_token.rb +32 -0
- data/app/services/stormpath/rails/client_credentials_authentication.rb +40 -0
- data/app/services/stormpath/rails/controller_authentication/from_basic_auth.rb +45 -0
- data/app/services/stormpath/rails/controller_authentication/from_bearer_auth.rb +34 -0
- data/app/services/stormpath/rails/controller_authentication/from_cookies.rb +71 -0
- data/app/services/stormpath/rails/controller_authentication.rb +44 -0
- data/app/services/stormpath/rails/delete_access_token.rb +48 -0
- data/app/services/stormpath/rails/delete_refresh_token.rb +11 -0
- data/app/services/stormpath/rails/forgot_password_token_verification.rb +31 -0
- data/app/services/stormpath/rails/password_change.rb +17 -0
- data/app/services/stormpath/rails/refresh_token_authentication.rb +28 -0
- data/app/services/stormpath/rails/resend_email_verification.rb +33 -0
- data/app/services/stormpath/rails/send_password_reset_email.rb +33 -0
- data/app/services/stormpath/rails/token_cookie_setter.rb +84 -0
- data/app/services/stormpath/rails/verify_email_token.rb +27 -0
- data/app/views/{passwords/forgot_change.html.erb → stormpath/rails/change_password/new.html.erb} +4 -10
- data/app/views/{passwords/forgot.html.erb → stormpath/rails/forgot_password/new.html.erb} +14 -4
- data/app/views/{layouts → stormpath/rails/layouts}/stormpath.html.erb +3 -3
- data/app/views/stormpath/rails/login/_form.html.erb +45 -0
- data/app/views/stormpath/rails/login/new.html.erb +12 -0
- data/app/views/stormpath/rails/register/_form.html.erb +19 -0
- data/app/views/{users → stormpath/rails/register}/new.html.erb +3 -3
- data/app/views/stormpath/rails/shared/_input.html.erb +15 -0
- data/app/views/stormpath/rails/verify_email/new.html.erb +49 -0
- data/bin/console +3 -3
- data/bin/rails +1 -1
- data/bin/rake +2 -2
- data/bin/rspec +2 -2
- data/config/initializers/assets.rb +3 -1
- data/lib/generators/stormpath/install/install_generator.rb +1 -92
- data/lib/generators/stormpath/install/templates/default_config.yml +229 -0
- data/lib/generators/stormpath/views/USAGE +0 -0
- data/lib/generators/stormpath/views/views_generator.rb +2 -2
- data/lib/stormpath/rails/client.rb +8 -85
- data/lib/stormpath/rails/config/account_store_verification.rb +45 -0
- data/lib/stormpath/rails/config/application_resolution.rb +76 -0
- data/lib/stormpath/rails/config/dynamic_configuration.rb +50 -0
- data/lib/stormpath/rails/config/read_file.rb +35 -0
- data/lib/stormpath/rails/configuration.rb +30 -35
- data/lib/stormpath/rails/content_type_negotiator.rb +50 -0
- data/lib/stormpath/rails/controller.rb +36 -5
- data/lib/stormpath/rails/errors/invalid_sptoken_error.rb +9 -0
- data/lib/stormpath/rails/errors/no_sptoken_error.rb +13 -0
- data/lib/stormpath/rails/router.rb +75 -0
- data/lib/stormpath/rails/routing_constraint.rb +9 -0
- data/lib/stormpath/rails/social.rb +6 -6
- data/lib/stormpath/rails/version.rb +2 -1
- data/lib/stormpath/rails.rb +9 -19
- data/lib/stormpath-rails.rb +1 -0
- data/stormpath-rails.gemspec +13 -11
- metadata +96 -54
- data/app/controllers/stormpath/rails/omniauth_controller.rb +0 -11
- data/app/controllers/stormpath/rails/passwords_controller.rb +0 -56
- data/app/controllers/stormpath/rails/sessions_controller.rb +0 -52
- data/app/controllers/stormpath/rails/users_controller.rb +0 -65
- data/app/views/passwords/edit.html.erb +0 -0
- data/app/views/passwords/email_sent.html.erb +0 -15
- data/app/views/passwords/forgot_change_failed.html.erb +0 -14
- data/app/views/passwords/forgot_complete.html.erb +0 -19
- data/app/views/sessions/_facebook_login_form.erb +0 -31
- data/app/views/sessions/_form.html.erb +0 -31
- data/app/views/sessions/_google_login_form.html.erb +0 -3
- data/app/views/sessions/_social_auth.html.erb +0 -7
- data/app/views/sessions/new.html.erb +0 -21
- data/app/views/users/_form.html.erb +0 -43
- data/app/views/users/verification_complete.html.erb +0 -20
- data/app/views/users/verification_email_sent.html.erb +0 -15
- data/app/views/users/verification_failed.html.erb +0 -14
- data/app/views/users/verification_resend.html.erb +0 -14
- data/config/routes.rb +0 -16
- data/lib/generators/stormpath/install/templates/db/migrate/add_stormpath_to_users.rb +0 -21
- data/lib/generators/stormpath/install/templates/db/migrate/create_users.rb +0 -12
- data/lib/generators/stormpath/install/templates/stormpath.rb +0 -4
- data/lib/generators/stormpath/install/templates/user.rb +0 -3
- data/lib/generators/stormpath/routes/routes_generator.rb +0 -23
- data/lib/generators/stormpath/routes/templates/routes.rb +0 -5
- data/lib/stormpath/rails/account.rb +0 -6
- data/lib/stormpath/rails/account_status.rb +0 -28
- data/lib/stormpath/rails/authentication.rb +0 -72
- data/lib/stormpath/rails/authentication_status.rb +0 -22
- data/lib/stormpath/rails/session.rb +0 -37
- data/lib/stormpath/rails/user.rb +0 -25
- data/lib/stormpath/rails/user_config/api_key.rb +0 -17
- data/lib/stormpath/rails/user_config/application.rb +0 -12
- data/lib/stormpath/rails/user_config/facebook.rb +0 -16
- data/lib/stormpath/rails/user_config/forgot_password.rb +0 -12
- data/lib/stormpath/rails/user_config/google.rb +0 -16
- data/lib/stormpath/rails/user_config/id_site.rb +0 -13
- data/lib/stormpath/rails/user_config/login.rb +0 -13
- data/lib/stormpath/rails/user_config/logout.rb +0 -13
- data/lib/stormpath/rails/user_config/register.rb +0 -13
- data/lib/stormpath/rails/user_config/verify_email.rb +0 -14
- data/lib/stormpath/testing/helpers.rb +0 -49
@@ -1,56 +1,51 @@
|
|
1
1
|
module Stormpath
|
2
2
|
module Rails
|
3
|
+
InvalidConfiguration = Class.new(ArgumentError)
|
4
|
+
DEFAULT_CONFIG_RELATIVE_FILE_PATH =
|
5
|
+
'../../../../lib/generators/stormpath/install/templates/default_config.yml'.freeze
|
6
|
+
|
3
7
|
class Configuration
|
4
|
-
|
8
|
+
attr_reader :user_defined_config_hash
|
5
9
|
|
6
|
-
def initialize
|
7
|
-
@
|
10
|
+
def initialize(user_defined_config_hash)
|
11
|
+
@user_defined_config_hash = user_defined_config_hash
|
8
12
|
end
|
9
13
|
|
10
|
-
def
|
11
|
-
|
14
|
+
def application
|
15
|
+
config_object.stormpath.application
|
12
16
|
end
|
13
17
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
klass = user_config_class(action)
|
18
|
-
instance_variable_set("@#{action}", klass.new(options))
|
19
|
-
end
|
20
|
-
|
21
|
-
define_method("#{action}") do |&block|
|
22
|
-
action_value = instance_variable_get("@#{action}")
|
23
|
-
|
24
|
-
if action_value.nil?
|
25
|
-
klass = user_config_class(action)
|
26
|
-
instance_variable_set("@#{action}", klass.new())
|
27
|
-
end
|
18
|
+
def web
|
19
|
+
config_object.stormpath.web
|
20
|
+
end
|
28
21
|
|
29
|
-
|
30
|
-
|
31
|
-
|
22
|
+
def config_object
|
23
|
+
@config_object ||= RecursiveOpenStruct.new(merged_config_hashes).tap do |config|
|
24
|
+
dynamic_config = Config::DynamicConfiguration.new(config)
|
32
25
|
|
33
|
-
|
26
|
+
config.stormpath.application.href = dynamic_config.app.href
|
27
|
+
config.stormpath.web.forgot_password.enabled = dynamic_config.forgot_password_enabled?
|
28
|
+
config.stormpath.web.change_password.enabled = dynamic_config.change_password_enabled?
|
34
29
|
end
|
35
30
|
end
|
36
31
|
|
37
|
-
|
32
|
+
def merged_config_hashes
|
33
|
+
default_config_hash.deep_merge(user_defined_config_hash)
|
34
|
+
end
|
38
35
|
|
39
|
-
def
|
40
|
-
|
36
|
+
def default_config_hash
|
37
|
+
Config::ReadFile.new(
|
38
|
+
File.expand_path(DEFAULT_CONFIG_RELATIVE_FILE_PATH, __FILE__)
|
39
|
+
).hash
|
41
40
|
end
|
42
41
|
end
|
43
42
|
|
44
|
-
# Return a single instance of Configuration class
|
45
|
-
# @return [Stormpath::Configuration] single instance
|
46
43
|
def self.config
|
47
|
-
@configuration ||= Configuration.new
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
def self.configure
|
53
|
-
yield(config)
|
44
|
+
@configuration ||= Configuration.new(
|
45
|
+
Config::ReadFile.new(
|
46
|
+
::Rails.application.root.join('config/stormpath.yml')
|
47
|
+
).hash
|
48
|
+
)
|
54
49
|
end
|
55
50
|
end
|
56
51
|
end
|
@@ -0,0 +1,50 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module Stormpath
|
3
|
+
module Rails
|
4
|
+
class ContentTypeNegotiator
|
5
|
+
attr_accessor :accept_header
|
6
|
+
|
7
|
+
HTTP_ACCEPT_WILDCARD = '*/*'.freeze
|
8
|
+
HTTP_ACCEPT_JSON = 'application/json'.freeze
|
9
|
+
HTTP_ACCEPT_HTML = 'text/html'.freeze
|
10
|
+
|
11
|
+
FULL_NAME_TO_SYMBOL = {
|
12
|
+
HTTP_ACCEPT_JSON => :json,
|
13
|
+
HTTP_ACCEPT_HTML => :html
|
14
|
+
}.freeze
|
15
|
+
|
16
|
+
def initialize(accept_header)
|
17
|
+
accept_header = accept_header.presence || HTTP_ACCEPT_WILDCARD
|
18
|
+
@accept_header = normalize(accept_header)
|
19
|
+
end
|
20
|
+
|
21
|
+
def convert
|
22
|
+
if accept_header == HTTP_ACCEPT_WILDCARD
|
23
|
+
Stormpath::Rails.config.web.produces.first
|
24
|
+
elsif accept_header.in?(Stormpath::Rails.config.web.produces)
|
25
|
+
accept_header
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def convert_to_symbol
|
30
|
+
FULL_NAME_TO_SYMBOL[convert]
|
31
|
+
end
|
32
|
+
|
33
|
+
def handle_by_stormpath?
|
34
|
+
accept_header.in?([HTTP_ACCEPT_WILDCARD] + Stormpath::Rails.config.web.produces)
|
35
|
+
end
|
36
|
+
|
37
|
+
private
|
38
|
+
|
39
|
+
def normalize(accept_header)
|
40
|
+
return accept_header unless accept_header.include?(',')
|
41
|
+
|
42
|
+
if accept_header.include?(HTTP_ACCEPT_JSON)
|
43
|
+
HTTP_ACCEPT_JSON
|
44
|
+
elsif accept_header.include?(HTTP_ACCEPT_HTML)
|
45
|
+
HTTP_ACCEPT_HTML
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
@@ -1,13 +1,44 @@
|
|
1
|
-
require 'stormpath/rails/authentication'
|
2
|
-
|
3
1
|
module Stormpath
|
4
2
|
module Rails
|
5
3
|
module Controller
|
6
4
|
extend ActiveSupport::Concern
|
7
|
-
|
8
|
-
include Stormpath::Rails::Authentication
|
9
|
-
include Stormpath::Rails::Session
|
10
5
|
include Stormpath::Rails::Social
|
6
|
+
|
7
|
+
included do
|
8
|
+
if respond_to?(:helper_method)
|
9
|
+
helper_method :current_account, :signed_in?
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def current_account
|
16
|
+
@current_account ||= begin
|
17
|
+
ControllerAuthentication.new(cookies, request.headers['Authorization']).authenticate!
|
18
|
+
rescue ControllerAuthentication::UnauthenticatedRequest
|
19
|
+
nil
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def signed_in?
|
24
|
+
current_account.present?
|
25
|
+
end
|
26
|
+
|
27
|
+
def require_authentication!
|
28
|
+
return if signed_in?
|
29
|
+
respond_to do |format|
|
30
|
+
format.html { redirect_to "#{stormpath_config.web.login.uri}?next=#{request.path}" }
|
31
|
+
format.json { render nothing: true, status: 401 }
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def require_no_authentication!
|
36
|
+
redirect_to root_path if signed_in?
|
37
|
+
end
|
38
|
+
|
39
|
+
def stormpath_config
|
40
|
+
Stormpath::Rails.config
|
41
|
+
end
|
11
42
|
end
|
12
43
|
end
|
13
44
|
end
|
@@ -0,0 +1,75 @@
|
|
1
|
+
module Stormpath
|
2
|
+
module Rails
|
3
|
+
module Router
|
4
|
+
STORMPATH_DEFAULT_ACTIONS_MAP = {
|
5
|
+
'register#new' => 'stormpath/rails/register/new#call',
|
6
|
+
'register#create' => 'stormpath/rails/register/create#call',
|
7
|
+
'login#new' => 'stormpath/rails/login/new#call',
|
8
|
+
'login#create' => 'stormpath/rails/login/create#call',
|
9
|
+
'logout#create' => 'stormpath/rails/logout/create#call',
|
10
|
+
'forgot_password#new' => 'stormpath/rails/forgot_password/new#call',
|
11
|
+
'forgot_password#create' => 'stormpath/rails/forgot_password/create#call',
|
12
|
+
'change_password#new' => 'stormpath/rails/change_password/new#call',
|
13
|
+
'change_password#create' => 'stormpath/rails/change_password/create#call',
|
14
|
+
'profile#show' => 'stormpath/rails/profile/show#call',
|
15
|
+
'oauth2#new' => 'stormpath/rails/oauth2/new#call',
|
16
|
+
'oauth2#create' => 'stormpath/rails/oauth2/create#call',
|
17
|
+
'verify_email#show' => 'stormpath/rails/verify_email/show#call',
|
18
|
+
'verify_email#create' => 'stormpath/rails/verify_email/create#call'
|
19
|
+
}.freeze
|
20
|
+
|
21
|
+
def stormpath_rails_routes(actions: {})
|
22
|
+
actions = STORMPATH_DEFAULT_ACTIONS_MAP.merge(actions)
|
23
|
+
|
24
|
+
constraints Stormpath::Rails::RoutingConstraint do
|
25
|
+
if Stormpath::Rails.config.web.register.enabled
|
26
|
+
get Stormpath::Rails.config.web.register.uri => actions['register#new'], as: :new_register
|
27
|
+
post Stormpath::Rails.config.web.register.uri => actions['register#create'], as: :register
|
28
|
+
end
|
29
|
+
|
30
|
+
# LOGIN
|
31
|
+
if Stormpath::Rails.config.web.login.enabled
|
32
|
+
get Stormpath::Rails.config.web.login.uri => actions['login#new'], as: :new_login
|
33
|
+
post Stormpath::Rails.config.web.login.uri => actions['login#create'], as: :login
|
34
|
+
end
|
35
|
+
|
36
|
+
# LOGOUT
|
37
|
+
if Stormpath::Rails.config.web.logout.enabled
|
38
|
+
post Stormpath::Rails.config.web.logout.uri => actions['logout#create'], as: :logout
|
39
|
+
end
|
40
|
+
|
41
|
+
# FORGOT PASSWORD
|
42
|
+
if Stormpath::Rails.config.web.forgot_password.enabled
|
43
|
+
get Stormpath::Rails.config.web.forgot_password.uri => actions['forgot_password#new'], as: :new_forgot_password
|
44
|
+
post Stormpath::Rails.config.web.forgot_password.uri => actions['forgot_password#create'], as: :forgot_password
|
45
|
+
end
|
46
|
+
|
47
|
+
# CHANGE PASSWORD
|
48
|
+
if Stormpath::Rails.config.web.change_password.enabled
|
49
|
+
get Stormpath::Rails.config.web.change_password.uri => actions['change_password#new'], as: :new_change_password
|
50
|
+
post Stormpath::Rails.config.web.change_password.uri => actions['change_password#create'], as: :change_password
|
51
|
+
end
|
52
|
+
|
53
|
+
# ME
|
54
|
+
if Stormpath::Rails.config.web.me.enabled
|
55
|
+
get Stormpath::Rails.config.web.me.uri => actions['profile#show']
|
56
|
+
end
|
57
|
+
|
58
|
+
# OAUTH2
|
59
|
+
if Stormpath::Rails.config.web.oauth2.enabled
|
60
|
+
get Stormpath::Rails.config.web.oauth2.uri => actions['oauth2#new']
|
61
|
+
post Stormpath::Rails.config.web.oauth2.uri => actions['oauth2#create']
|
62
|
+
end
|
63
|
+
|
64
|
+
# VERIFY EMAIL
|
65
|
+
if Stormpath::Rails.config.web.verify_email.enabled
|
66
|
+
get Stormpath::Rails.config.web.verify_email.uri => actions['verify_email#show']
|
67
|
+
post Stormpath::Rails.config.web.verify_email.uri => actions['verify_email#create'], as: :verify_email
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
ActionDispatch::Routing::Mapper.include(Stormpath::Rails::Router)
|
@@ -5,25 +5,25 @@ module Stormpath
|
|
5
5
|
|
6
6
|
included do
|
7
7
|
helper_method :facebook_login_enabled?, :facebook_app_id,
|
8
|
-
|
8
|
+
:google_login_enabled?, :google_client_id, :social_auth?
|
9
9
|
end
|
10
|
-
|
10
|
+
|
11
11
|
private
|
12
12
|
|
13
13
|
def facebook_login_enabled?
|
14
|
-
|
14
|
+
false # facebook_app_id.present?
|
15
15
|
end
|
16
16
|
|
17
17
|
def google_login_enabled?
|
18
|
-
|
18
|
+
false # google_client_id.present?
|
19
19
|
end
|
20
20
|
|
21
21
|
def facebook_app_id
|
22
|
-
|
22
|
+
ENV['STORMPATH_FACEBOOK_APP_ID']
|
23
23
|
end
|
24
24
|
|
25
25
|
def google_client_id
|
26
|
-
|
26
|
+
ENV['STORMPATH_GOOGLE_CLIENT_ID']
|
27
27
|
end
|
28
28
|
|
29
29
|
def social_auth?
|
data/lib/stormpath/rails.rb
CHANGED
@@ -1,32 +1,22 @@
|
|
1
1
|
require 'stormpath-sdk'
|
2
2
|
require 'stormpath/rails/engine'
|
3
|
+
require 'stormpath/rails/config/read_file'
|
4
|
+
require 'stormpath/rails/config/application_resolution'
|
5
|
+
require 'stormpath/rails/config/account_store_verification'
|
6
|
+
require 'stormpath/rails/config/dynamic_configuration'
|
3
7
|
require 'stormpath/rails/configuration'
|
8
|
+
require 'stormpath/rails/router'
|
4
9
|
require 'virtus'
|
5
10
|
|
6
11
|
module Stormpath
|
7
12
|
module Rails
|
8
13
|
autoload :Client, 'stormpath/rails/client'
|
9
|
-
autoload :Authentication, 'stormpath/rails/authentication'
|
10
|
-
autoload :Session, 'stormpath/rails/session'
|
11
14
|
autoload :Controller, 'stormpath/rails/controller'
|
12
|
-
autoload :Account, 'stormpath/rails/account'
|
13
15
|
autoload :Version, 'stormpath/rails/version'
|
14
|
-
autoload :User, 'stormpath/rails/user'
|
15
|
-
autoload :AuthenticationStatus, 'stormpath/rails/authentication_status'
|
16
|
-
autoload :AccountStatus, 'stormpath/rails/account_status'
|
17
16
|
autoload :Social, 'stormpath/rails/social'
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
autoload :ForgotPassword, 'stormpath/rails/user_config/forgot_password'
|
23
|
-
autoload :IdSite, 'stormpath/rails/user_config/id_site'
|
24
|
-
autoload :VerifyEmail, 'stormpath/rails/user_config/verify_email'
|
25
|
-
autoload :Facebook, 'stormpath/rails/user_config/facebook'
|
26
|
-
autoload :Google, 'stormpath/rails/user_config/google'
|
27
|
-
autoload :Login, 'stormpath/rails/user_config/login'
|
28
|
-
autoload :Logout, 'stormpath/rails/user_config/logout'
|
29
|
-
autoload :Register, 'stormpath/rails/user_config/register'
|
30
|
-
end
|
17
|
+
autoload :ContentTypeNegotiator, 'stormpath/rails/content_type_negotiator'
|
18
|
+
autoload :RoutingConstraint, 'stormpath/rails/routing_constraint'
|
19
|
+
autoload :InvalidSptokenError, 'stormpath/rails/errors/invalid_sptoken_error'
|
20
|
+
autoload :NoSptokenError, 'stormpath/rails/errors/no_sptoken_error'
|
31
21
|
end
|
32
22
|
end
|
data/lib/stormpath-rails.rb
CHANGED
data/stormpath-rails.gemspec
CHANGED
@@ -4,27 +4,29 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
require 'stormpath/rails/version'
|
5
5
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
|
-
spec.name =
|
7
|
+
spec.name = 'stormpath-rails'
|
8
8
|
spec.version = Stormpath::Rails::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Nenad Nikolic']
|
10
|
+
spec.email = ['nenad.nikolic@infinum.hr']
|
11
11
|
|
12
|
-
spec.summary =
|
13
|
-
spec.description =
|
12
|
+
spec.summary = 'TODO: Write a short summary, because Rubygems requires one.'
|
13
|
+
spec.description = 'TODO: Write a longer description or delete this line.'
|
14
14
|
spec.homepage = "TODO: Put your gem's website or public repo URL here."
|
15
15
|
|
16
|
-
spec.summary =
|
17
|
-
spec.description =
|
16
|
+
spec.summary = 'Stormpath Rails integration'
|
17
|
+
spec.description = 'Stormpath Rails integration'
|
18
18
|
spec.homepage = 'http://www.stormpath.com'
|
19
19
|
|
20
20
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
-
spec.bindir =
|
21
|
+
spec.bindir = 'exe'
|
22
22
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
-
spec.require_paths = [
|
23
|
+
spec.require_paths = ['lib']
|
24
24
|
|
25
|
-
spec.add_dependency 'stormpath-sdk', '>= 1.
|
25
|
+
spec.add_dependency 'stormpath-sdk', '>= 1.1.5'
|
26
26
|
spec.add_dependency 'virtus'
|
27
27
|
spec.add_dependency 'rails', '>= 3.1'
|
28
|
+
spec.add_dependency 'recursive-open-struct'
|
28
29
|
|
29
|
-
spec.add_development_dependency
|
30
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
31
|
+
spec.add_development_dependency 'rubocop'
|
30
32
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: stormpath-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nenad Nikolic
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-08-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: stormpath-sdk
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.1.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.1.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: virtus
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.1'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: recursive-open-struct
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: rake
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +80,20 @@ dependencies:
|
|
66
80
|
- - "~>"
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '10.0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: rubocop
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
69
97
|
description: Stormpath Rails integration
|
70
98
|
email:
|
71
99
|
- nenad.nikolic@infinum.hr
|
@@ -75,76 +103,91 @@ extra_rdoc_files: []
|
|
75
103
|
files:
|
76
104
|
- ".gitignore"
|
77
105
|
- ".rspec"
|
106
|
+
- ".rubocop.yml"
|
78
107
|
- ".travis.yml"
|
79
108
|
- Gemfile
|
80
109
|
- README.md
|
81
110
|
- Rakefile
|
82
111
|
- app/assets/stylesheets/stormpath.css.scss
|
83
112
|
- app/controllers/stormpath/rails/base_controller.rb
|
84
|
-
- app/controllers/stormpath/rails/
|
85
|
-
- app/controllers/stormpath/rails/
|
86
|
-
- app/controllers/stormpath/rails/
|
87
|
-
- app/controllers/stormpath/rails/
|
113
|
+
- app/controllers/stormpath/rails/change_password/create_controller.rb
|
114
|
+
- app/controllers/stormpath/rails/change_password/new_controller.rb
|
115
|
+
- app/controllers/stormpath/rails/forgot_password/create_controller.rb
|
116
|
+
- app/controllers/stormpath/rails/forgot_password/new_controller.rb
|
117
|
+
- app/controllers/stormpath/rails/login/create_controller.rb
|
118
|
+
- app/controllers/stormpath/rails/login/new_controller.rb
|
119
|
+
- app/controllers/stormpath/rails/logout/create_controller.rb
|
120
|
+
- app/controllers/stormpath/rails/oauth2/create_controller.rb
|
121
|
+
- app/controllers/stormpath/rails/oauth2/new_controller.rb
|
122
|
+
- app/controllers/stormpath/rails/profile/show_controller.rb
|
123
|
+
- app/controllers/stormpath/rails/register/create_controller.rb
|
124
|
+
- app/controllers/stormpath/rails/register/new_controller.rb
|
125
|
+
- app/controllers/stormpath/rails/verify_email/create_controller.rb
|
126
|
+
- app/controllers/stormpath/rails/verify_email/show_controller.rb
|
127
|
+
- app/forms/stormpath/rails/login_form.rb
|
128
|
+
- app/forms/stormpath/rails/registration_form.rb
|
129
|
+
- app/forms/stormpath/rails/registration_form_fields.rb
|
88
130
|
- app/helpers/social_helper.rb
|
89
|
-
- app/
|
90
|
-
- app/
|
91
|
-
- app/
|
92
|
-
- app/
|
93
|
-
- app/
|
94
|
-
- app/
|
95
|
-
- app/
|
96
|
-
- app/
|
97
|
-
- app/
|
98
|
-
- app/
|
99
|
-
- app/
|
100
|
-
- app/
|
101
|
-
- app/
|
102
|
-
- app/
|
103
|
-
- app/
|
104
|
-
- app/
|
105
|
-
- app/
|
106
|
-
- app/
|
131
|
+
- app/serializers/stormpath/rails/account_serializer.rb
|
132
|
+
- app/serializers/stormpath/rails/form_serializer.rb
|
133
|
+
- app/serializers/stormpath/rails/login_new_serializer.rb
|
134
|
+
- app/serializers/stormpath/rails/profile_serializer.rb
|
135
|
+
- app/serializers/stormpath/rails/registration_form_serializer.rb
|
136
|
+
- app/services/stormpath/rails/account_from_access_token.rb
|
137
|
+
- app/services/stormpath/rails/account_from_access_token/local_account_resolution.rb
|
138
|
+
- app/services/stormpath/rails/account_from_access_token/stormpath_account_resolution.rb
|
139
|
+
- app/services/stormpath/rails/account_login.rb
|
140
|
+
- app/services/stormpath/rails/account_login_with_stormpath_token.rb
|
141
|
+
- app/services/stormpath/rails/client_credentials_authentication.rb
|
142
|
+
- app/services/stormpath/rails/controller_authentication.rb
|
143
|
+
- app/services/stormpath/rails/controller_authentication/from_basic_auth.rb
|
144
|
+
- app/services/stormpath/rails/controller_authentication/from_bearer_auth.rb
|
145
|
+
- app/services/stormpath/rails/controller_authentication/from_cookies.rb
|
146
|
+
- app/services/stormpath/rails/delete_access_token.rb
|
147
|
+
- app/services/stormpath/rails/delete_refresh_token.rb
|
148
|
+
- app/services/stormpath/rails/forgot_password_token_verification.rb
|
149
|
+
- app/services/stormpath/rails/password_change.rb
|
150
|
+
- app/services/stormpath/rails/refresh_token_authentication.rb
|
151
|
+
- app/services/stormpath/rails/resend_email_verification.rb
|
152
|
+
- app/services/stormpath/rails/send_password_reset_email.rb
|
153
|
+
- app/services/stormpath/rails/token_cookie_setter.rb
|
154
|
+
- app/services/stormpath/rails/verify_email_token.rb
|
155
|
+
- app/views/stormpath/rails/change_password/new.html.erb
|
156
|
+
- app/views/stormpath/rails/forgot_password/new.html.erb
|
157
|
+
- app/views/stormpath/rails/layouts/stormpath.html.erb
|
158
|
+
- app/views/stormpath/rails/login/_form.html.erb
|
159
|
+
- app/views/stormpath/rails/login/new.html.erb
|
160
|
+
- app/views/stormpath/rails/register/_form.html.erb
|
161
|
+
- app/views/stormpath/rails/register/new.html.erb
|
162
|
+
- app/views/stormpath/rails/shared/_input.html.erb
|
163
|
+
- app/views/stormpath/rails/verify_email/new.html.erb
|
107
164
|
- bin/console
|
108
165
|
- bin/rails
|
109
166
|
- bin/rake
|
110
167
|
- bin/rspec
|
111
168
|
- bin/setup
|
112
169
|
- config/initializers/assets.rb
|
113
|
-
- config/routes.rb
|
114
170
|
- lib/generators/stormpath/install/install_generator.rb
|
115
|
-
- lib/generators/stormpath/install/templates/
|
116
|
-
- lib/generators/stormpath/install/templates/db/migrate/create_users.rb
|
117
|
-
- lib/generators/stormpath/install/templates/stormpath.rb
|
118
|
-
- lib/generators/stormpath/install/templates/user.rb
|
119
|
-
- lib/generators/stormpath/routes/routes_generator.rb
|
120
|
-
- lib/generators/stormpath/routes/templates/routes.rb
|
171
|
+
- lib/generators/stormpath/install/templates/default_config.yml
|
121
172
|
- lib/generators/stormpath/views/USAGE
|
122
173
|
- lib/generators/stormpath/views/views_generator.rb
|
123
174
|
- lib/stormpath-rails.rb
|
124
175
|
- lib/stormpath/rails.rb
|
125
|
-
- lib/stormpath/rails/account.rb
|
126
|
-
- lib/stormpath/rails/account_status.rb
|
127
|
-
- lib/stormpath/rails/authentication.rb
|
128
|
-
- lib/stormpath/rails/authentication_status.rb
|
129
176
|
- lib/stormpath/rails/client.rb
|
177
|
+
- lib/stormpath/rails/config/account_store_verification.rb
|
178
|
+
- lib/stormpath/rails/config/application_resolution.rb
|
179
|
+
- lib/stormpath/rails/config/dynamic_configuration.rb
|
180
|
+
- lib/stormpath/rails/config/read_file.rb
|
130
181
|
- lib/stormpath/rails/configuration.rb
|
182
|
+
- lib/stormpath/rails/content_type_negotiator.rb
|
131
183
|
- lib/stormpath/rails/controller.rb
|
132
184
|
- lib/stormpath/rails/engine.rb
|
133
|
-
- lib/stormpath/rails/
|
185
|
+
- lib/stormpath/rails/errors/invalid_sptoken_error.rb
|
186
|
+
- lib/stormpath/rails/errors/no_sptoken_error.rb
|
187
|
+
- lib/stormpath/rails/router.rb
|
188
|
+
- lib/stormpath/rails/routing_constraint.rb
|
134
189
|
- lib/stormpath/rails/social.rb
|
135
|
-
- lib/stormpath/rails/user.rb
|
136
|
-
- lib/stormpath/rails/user_config/api_key.rb
|
137
|
-
- lib/stormpath/rails/user_config/application.rb
|
138
|
-
- lib/stormpath/rails/user_config/facebook.rb
|
139
|
-
- lib/stormpath/rails/user_config/forgot_password.rb
|
140
|
-
- lib/stormpath/rails/user_config/google.rb
|
141
|
-
- lib/stormpath/rails/user_config/id_site.rb
|
142
|
-
- lib/stormpath/rails/user_config/login.rb
|
143
|
-
- lib/stormpath/rails/user_config/logout.rb
|
144
|
-
- lib/stormpath/rails/user_config/register.rb
|
145
|
-
- lib/stormpath/rails/user_config/verify_email.rb
|
146
190
|
- lib/stormpath/rails/version.rb
|
147
|
-
- lib/stormpath/testing/helpers.rb
|
148
191
|
- stormpath-rails.gemspec
|
149
192
|
homepage: http://www.stormpath.com
|
150
193
|
licenses: []
|
@@ -160,14 +203,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
203
|
version: '0'
|
161
204
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
162
205
|
requirements:
|
163
|
-
- - "
|
206
|
+
- - ">="
|
164
207
|
- !ruby/object:Gem::Version
|
165
|
-
version:
|
208
|
+
version: '0'
|
166
209
|
requirements: []
|
167
210
|
rubyforge_project:
|
168
|
-
rubygems_version: 2.
|
211
|
+
rubygems_version: 2.5.1
|
169
212
|
signing_key:
|
170
213
|
specification_version: 4
|
171
214
|
summary: Stormpath Rails integration
|
172
215
|
test_files: []
|
173
|
-
has_rdoc:
|