wordjelly-auth 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/auth/version.rb +1 -1
- data/spec/auth_test.rb +7 -0
- data/spec/controllers/auth/admin_create_users_controller_spec.rb +141 -0
- data/spec/controllers/auth/clients_controller_spec.rb +223 -0
- data/spec/controllers/auth/search_controller_spec.rb +5 -0
- data/spec/controllers/auth/shopping/discounts_controller_spec.rb +54 -0
- data/spec/controllers/auth/users/profiles_controller_spec.rb +5 -0
- data/spec/dummy/README.rdoc +28 -0
- data/spec/dummy/Rakefile +6 -0
- data/spec/dummy/app/assets/javascripts/activity.js +2 -0
- data/spec/dummy/app/assets/javascripts/application.js +16 -0
- data/spec/dummy/app/assets/javascripts/home.js +2 -0
- data/spec/dummy/app/assets/javascripts/pollymer.min.js +170 -0
- data/spec/dummy/app/assets/javascripts/tests.js +2 -0
- data/spec/dummy/app/assets/javascripts/topics.js +2 -0
- data/spec/dummy/app/assets/stylesheets/activity.css +4 -0
- data/spec/dummy/app/assets/stylesheets/application.scss +16 -0
- data/spec/dummy/app/assets/stylesheets/home.css +4 -0
- data/spec/dummy/app/assets/stylesheets/tests.css +4 -0
- data/spec/dummy/app/assets/stylesheets/topics.css +4 -0
- data/spec/dummy/app/controllers/activity_controller.rb +3 -0
- data/spec/dummy/app/controllers/admins/confirmations_controller.rb +28 -0
- data/spec/dummy/app/controllers/admins/omniauth_callbacks_controller.rb +28 -0
- data/spec/dummy/app/controllers/admins/passwords_controller.rb +32 -0
- data/spec/dummy/app/controllers/admins/registrations_controller.rb +60 -0
- data/spec/dummy/app/controllers/admins/sessions_controller.rb +5 -0
- data/spec/dummy/app/controllers/admins/unlocks_controller.rb +28 -0
- data/spec/dummy/app/controllers/application_controller.rb +49 -0
- data/spec/dummy/app/controllers/home_controller.rb +13 -0
- data/spec/dummy/app/controllers/otp_controller.rb +3 -0
- data/spec/dummy/app/controllers/shopping/cart_items_controller.rb +28 -0
- data/spec/dummy/app/controllers/shopping/carts_controller.rb +4 -0
- data/spec/dummy/app/controllers/shopping/discounts_controller.rb +3 -0
- data/spec/dummy/app/controllers/shopping/payments_controller.rb +5 -0
- data/spec/dummy/app/controllers/shopping/products_controller.rb +2 -0
- data/spec/dummy/app/controllers/tests_controller.rb +58 -0
- data/spec/dummy/app/controllers/topics_controller.rb +63 -0
- data/spec/dummy/app/controllers/users/sessions_controller.rb +3 -0
- data/spec/dummy/app/controllers/webhooks_controller.rb +13 -0
- data/spec/dummy/app/helpers/activity_helper.rb +2 -0
- data/spec/dummy/app/helpers/api/v1/token_auth_helper.rb +2 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/helpers/home_helper.rb +2 -0
- data/spec/dummy/app/helpers/tests_helper.rb +2 -0
- data/spec/dummy/app/helpers/topics_helper.rb +2 -0
- data/spec/dummy/app/mailers/application_mailer.rb +4 -0
- data/spec/dummy/app/mailers/new.rb +3 -0
- data/spec/dummy/app/models/activity.rb +3 -0
- data/spec/dummy/app/models/admin.rb +12 -0
- data/spec/dummy/app/models/noti.rb +48 -0
- data/spec/dummy/app/models/noti_response.rb +9 -0
- data/spec/dummy/app/models/shopping/cart.rb +3 -0
- data/spec/dummy/app/models/shopping/cart_item.rb +7 -0
- data/spec/dummy/app/models/shopping/discount.rb +3 -0
- data/spec/dummy/app/models/shopping/payment.rb +16 -0
- data/spec/dummy/app/models/shopping/product.rb +6 -0
- data/spec/dummy/app/models/test.rb +5 -0
- data/spec/dummy/app/models/topic.rb +75 -0
- data/spec/dummy/app/models/user.rb +95 -0
- data/spec/dummy/app/views/home/index.html.erb +6 -0
- data/spec/dummy/app/views/home/send_notification.html.erb +2 -0
- data/spec/dummy/app/views/layouts/application.html.erb +26 -0
- data/spec/dummy/app/views/layouts/mailer.html.erb +8 -0
- data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/spec/dummy/app/views/new/notification.html.erb +1 -0
- data/spec/dummy/app/views/new/notification.text.erb +1 -0
- data/spec/dummy/app/views/shopping/_navigation_options.html.erb +1 -0
- data/spec/dummy/app/views/tests/_form.html.erb +25 -0
- data/spec/dummy/app/views/tests/edit.html.erb +6 -0
- data/spec/dummy/app/views/tests/index.html.erb +33 -0
- data/spec/dummy/app/views/tests/new.html.erb +5 -0
- data/spec/dummy/app/views/tests/show.html.erb +14 -0
- data/spec/dummy/app/views/topics/_form.html.erb +25 -0
- data/spec/dummy/app/views/topics/edit.html.erb +6 -0
- data/spec/dummy/app/views/topics/index.html.erb +29 -0
- data/spec/dummy/app/views/topics/new.html.erb +5 -0
- data/spec/dummy/app/views/topics/show.html.erb +14 -0
- data/spec/dummy/app/views/users/sessions/create.js.erb +6 -0
- data/spec/dummy/bin/bundle +3 -0
- data/spec/dummy/bin/rails +4 -0
- data/spec/dummy/bin/rake +4 -0
- data/spec/dummy/bin/setup +29 -0
- data/spec/dummy/config.ru +8 -0
- data/spec/dummy/config/application.rb +31 -0
- data/spec/dummy/config/boot.rb +5 -0
- data/spec/dummy/config/environment.rb +4 -0
- data/spec/dummy/config/environments/development.rb +57 -0
- data/spec/dummy/config/environments/production.rb +92 -0
- data/spec/dummy/config/environments/test.rb +44 -0
- data/spec/dummy/config/initializers/assets.rb +11 -0
- data/spec/dummy/config/initializers/aws.rb +15 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/spec/dummy/config/initializers/devise.rb +273 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +16 -0
- data/spec/dummy/config/initializers/mime_types.rb +4 -0
- data/spec/dummy/config/initializers/preinitializer.rb +167 -0
- data/spec/dummy/config/initializers/redis.rb +9 -0
- data/spec/dummy/config/initializers/session_store.rb +3 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +9 -0
- data/spec/dummy/config/locales/devise.en.yml +62 -0
- data/spec/dummy/config/locales/en.yml +25 -0
- data/spec/dummy/config/mongoid.yml +142 -0
- data/spec/dummy/config/redis.yml +14 -0
- data/spec/dummy/config/routes.rb +38 -0
- data/spec/dummy/config/secrets.yml +22 -0
- data/spec/dummy/db/seeds.rb +48 -0
- data/spec/dummy/lib/admin/parameter_sanitizer.rb +9 -0
- data/spec/dummy/lib/assets/files/test_names.json +1 -0
- data/spec/dummy/lib/user/parameter_sanitizer.rb +8 -0
- data/spec/dummy/public/404.html +67 -0
- data/spec/dummy/public/422.html +67 -0
- data/spec/dummy/public/500.html +66 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/shoryuken.yml +5 -0
- data/spec/dummy/sidekiq.yml +9 -0
- data/spec/dummy/sidekiq_prep.sh +6 -0
- data/spec/dummy/spec/controllers/activity_controller_spec.rb +5 -0
- data/spec/dummy/spec/controllers/tests_controller_spec.rb +141 -0
- data/spec/dummy/spec/factories/tests.rb +6 -0
- data/spec/dummy/spec/fixtures/new/send_notification +3 -0
- data/spec/dummy/spec/helpers/activity_helper_spec.rb +15 -0
- data/spec/dummy/spec/helpers/tests_helper_spec.rb +15 -0
- data/spec/dummy/spec/mailers/new_spec.rb +18 -0
- data/spec/dummy/spec/mailers/previews/new_preview.rb +13 -0
- data/spec/dummy/spec/models/test_spec.rb +5 -0
- data/spec/dummy/spec/requests/tests_spec.rb +10 -0
- data/spec/dummy/spec/routing/tests_routing_spec.rb +39 -0
- data/spec/dummy/spec/views/tests/edit.html.erb_spec.rb +21 -0
- data/spec/dummy/spec/views/tests/index.html.erb_spec.rb +22 -0
- data/spec/dummy/spec/views/tests/new.html.erb_spec.rb +21 -0
- data/spec/dummy/spec/views/tests/show.html.erb_spec.rb +16 -0
- data/spec/dummy/test/controllers/api/v1/token_auth_controller_test.rb +7 -0
- data/spec/dummy/test/controllers/home_controller_test.rb +9 -0
- data/spec/dummy/test/controllers/oauth_tests_controller_test.rb +7 -0
- data/spec/dummy/test/fixtures/oauth_tests.yml +11 -0
- data/spec/dummy/test/fixtures/users.yml +7 -0
- data/spec/dummy/test/models/oauth_test_test.rb +7 -0
- data/spec/dummy/test/models/user_test.rb +7 -0
- data/spec/factories/client_factory.rb +77 -0
- data/spec/features/additional_login_param_feature_spec.rb +63 -0
- data/spec/features/extension_spec.rb +680 -0
- data/spec/features/redirect_disable_spec.rb +74 -0
- data/spec/fixtures/auth/clients.yml +13 -0
- data/spec/helpers/auth/admin_create_users_helper_spec.rb +15 -0
- data/spec/helpers/auth/resource_helper_spec.rb +15 -0
- data/spec/helpers/auth/search_helper_spec.rb +15 -0
- data/spec/helpers/auth/users/profiles_helper_spec.rb +15 -0
- data/spec/integration/navigation_test.rb +8 -0
- data/spec/mailers/auth/notifier_spec.rb +5 -0
- data/spec/mailers/previews/auth/notifier_preview.rb +4 -0
- data/spec/models/auth/admin_create_user_spec.rb +5 -0
- data/spec/models/auth/client_test.rb +9 -0
- data/spec/models/auth/shopping/discount_spec.rb +5 -0
- data/spec/rails_helper.rb +70 -0
- data/spec/requests/admin/confirmation_request_spec.rb +164 -0
- data/spec/requests/admin/password_request_spec.rb +191 -0
- data/spec/requests/admin/registration_request_spec.rb +574 -0
- data/spec/requests/admin/session_request_spec.rb +352 -0
- data/spec/requests/admin/unlock_request_spec.rb +178 -0
- data/spec/requests/admin_create_user_request_spec.rb +303 -0
- data/spec/requests/background_job_request_spec.rb +28 -0
- data/spec/requests/cart_item_request_spec.rb +381 -0
- data/spec/requests/cart_request_spec.rb +451 -0
- data/spec/requests/client_request_spec.rb +65 -0
- data/spec/requests/discount_request_spec.rb +589 -0
- data/spec/requests/payment_request_spec.rb +1254 -0
- data/spec/requests/search_request_spec.rb +173 -0
- data/spec/requests/topic_request_spec.rb +138 -0
- data/spec/requests/user/additional_login_param_and_email_validation_spec.rb +673 -0
- data/spec/requests/user/confirmation_request_spec.rb +189 -0
- data/spec/requests/user/omniauth_callbacks_request_spec.rb +682 -0
- data/spec/requests/user/otp_basic_flow_request_spec.rb +512 -0
- data/spec/requests/user/password_request_spec.rb +216 -0
- data/spec/requests/user/registration_request_spec.rb +615 -0
- data/spec/requests/user/session_request_spec.rb +361 -0
- data/spec/requests/user/unlock_request_spec.rb +208 -0
- data/spec/routing/admin/admin_routes_spec.rb +15 -0
- data/spec/routing/auth/admin_create_users_routing_spec.rb +39 -0
- data/spec/routing/clients_controller_routes_spec.rb +75 -0
- data/spec/routing/engine_routes_spec.rb +16 -0
- data/spec/spec_helper.rb +138 -0
- data/spec/support/factory_girl.rb +3 -0
- data/spec/support/omniauth_macros.rb +195 -0
- data/spec/support/payumoney_support.rb +11 -0
- data/spec/support/sign_in_support.rb +361 -0
- data/spec/support/wait_for_ajax.rb +11 -0
- data/spec/views/auth/admin_create_users/edit.html.erb_spec.rb +14 -0
- data/spec/views/auth/admin_create_users/index.html.erb_spec.rb +14 -0
- data/spec/views/auth/admin_create_users/new.html.erb_spec.rb +14 -0
- data/spec/views/auth/admin_create_users/show.html.erb_spec.rb +11 -0
- data/spec/views/auth/shopping/discounts/create.html.erb_spec.rb +5 -0
- data/spec/views/auth/shopping/discounts/destroy.html.erb_spec.rb +5 -0
- data/spec/views/auth/shopping/discounts/edit.html.erb_spec.rb +5 -0
- data/spec/views/auth/shopping/discounts/index.html.erb_spec.rb +5 -0
- data/spec/views/auth/shopping/discounts/new.html.erb_spec.rb +5 -0
- data/spec/views/auth/shopping/discounts/show.html.erb_spec.rb +5 -0
- data/spec/views/auth/shopping/discounts/update.html.erb_spec.rb +5 -0
- data/spec/views/profile/show.html.erb_spec.rb +5 -0
- metadata +401 -3
@@ -0,0 +1,16 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format. Inflections
|
4
|
+
# are locale specific, and you may define rules for as many different
|
5
|
+
# locales as you wish. All of these examples are active by default:
|
6
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
7
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
8
|
+
# inflect.singular /^(ox)en/i, '\1'
|
9
|
+
# inflect.irregular 'person', 'people'
|
10
|
+
# inflect.uncountable %w( fish sheep )
|
11
|
+
# end
|
12
|
+
|
13
|
+
# These inflection rules are supported but not enabled by default:
|
14
|
+
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
15
|
+
# inflect.acronym 'RESTful'
|
16
|
+
# end
|
@@ -0,0 +1,167 @@
|
|
1
|
+
Auth.configure do |config|
|
2
|
+
|
3
|
+
|
4
|
+
|
5
|
+
##the oauth credentails.
|
6
|
+
##remember to require the necessary gems in your gemfile.
|
7
|
+
config.oauth_credentials = {
|
8
|
+
"facebook" => {
|
9
|
+
"app_id" => "1834018783536739",
|
10
|
+
"app_secret" => "c1eb040ecc9d5bb1fd6f518169010420",
|
11
|
+
"options" => {
|
12
|
+
:scope => 'email',
|
13
|
+
:info_fields => 'first_name,last_name,email,work',
|
14
|
+
:display => 'page'
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"google_oauth2" => {
|
18
|
+
"app_id" => "79069425775-bfqobulod1iipmad6bmt6fvj7dnoama8.apps.googleusercontent.com",
|
19
|
+
"app_secret" => "ZdirqSi7CpfIdWyUDHnUMbMa",
|
20
|
+
"options" => {
|
21
|
+
:scope => "email, profile",
|
22
|
+
:prompt => "select_account",
|
23
|
+
:image_aspect_ratio => "square",
|
24
|
+
:image_size => 50
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
##the path where you want to mount the authentication routes.
|
30
|
+
config.mount_path = "/authenticate"
|
31
|
+
|
32
|
+
##the key should be the name of any model in which the "user_concern" has been included.
|
33
|
+
##the value should be controllers that will handle the usual devise pattern.
|
34
|
+
##refer to auth/lib/auth/rails/routes.rb
|
35
|
+
##default controllers have already been setup in the engine.
|
36
|
+
##you can use devise generate to build alternative controllers for your own purposes.
|
37
|
+
##THE ADDITIONAL LOGIN POSSIBLE
|
38
|
+
##additional_login_param
|
39
|
+
##HASH
|
40
|
+
##key -> [symbol]name
|
41
|
+
##value -> [string] the name to be used for the additional login parameter.
|
42
|
+
config.auth_resources = {
|
43
|
+
"User" => {
|
44
|
+
:nav_bar => true,
|
45
|
+
:login_params => [:email,:additional_login_param],
|
46
|
+
:additional_login_param_name => "mobile",
|
47
|
+
:additional_login_param_resend_confirmation_message => "Resend OTP",
|
48
|
+
:additional_login_param_new_otp_partial => "auth/modals/new_otp_input.html.erb",
|
49
|
+
:additional_login_param_resend_confirmation_message_partial => "auth/modals/resend_otp.html.erb",
|
50
|
+
:additional_login_param_verification_result_partial => "auth/modals/verify_otp.html.erb",
|
51
|
+
:controllers => {
|
52
|
+
:sessions => "users/sessions"
|
53
|
+
}
|
54
|
+
},
|
55
|
+
"Admin" => {
|
56
|
+
:nav_bar => true,
|
57
|
+
:login_params => [:email],
|
58
|
+
:controllers => {
|
59
|
+
:sessions => "admins/sessions"
|
60
|
+
}
|
61
|
+
}
|
62
|
+
}
|
63
|
+
|
64
|
+
config.otp_controller = "otp"
|
65
|
+
config.user_class = "User"
|
66
|
+
|
67
|
+
############## SHOPPING SETTINGS #####################
|
68
|
+
config.cart_item_controller = "shopping/cart_items"
|
69
|
+
config.cart_item_class = "Shopping::CartItem"
|
70
|
+
config.cart_controller = "shopping/carts"
|
71
|
+
config.cart_class = "Shopping::Cart"
|
72
|
+
config.product_controller = "shopping/products"
|
73
|
+
config.product_class = "Shopping::Product"
|
74
|
+
config.payment_controller = "shopping/payments"
|
75
|
+
config.payment_class = "Shopping::Payment"
|
76
|
+
config.discount_class = "Shopping::Discount"
|
77
|
+
config.discount_controller = "shopping/discounts"
|
78
|
+
|
79
|
+
config.payment_gateway_info = {:key => "gtKFFx", :salt => "eCwWELxi", :CardName => "Any Name", :CardNumber => "5123456789012346", :CVV => "123", :Expiry => "May 2017"}
|
80
|
+
############## SHOPPING SETTINGS END #################
|
81
|
+
|
82
|
+
|
83
|
+
##defaults to empty hash.
|
84
|
+
##add api keys for any third party libraries here.
|
85
|
+
##the api key for msgwow is actually the api key for msg91, remember to replace it with the api key for msgwow.
|
86
|
+
config.third_party_api_keys = {:two_factor_sms_api_key => "ac79bc21-6d31-11e7-94da-0200cd936042",:android_recaptcha_secret_key => "",:google_url_shortener_api_key => "AIzaSyDIsi0V4d3A2Wq6RY9dx-2o5j-IHfCAAtQ", :msg_wow_api_key => "173596AmSJpLtqpIvb59b18c37"}
|
87
|
+
|
88
|
+
##defaults to nil
|
89
|
+
##used in the engine at config/redis.rb
|
90
|
+
#config.redis_config_file_location = "/home/bhargav/Github/auth/spec/dummy/config/redis.yml"
|
91
|
+
|
92
|
+
|
93
|
+
config.token_regeneration_time = 1.day
|
94
|
+
|
95
|
+
|
96
|
+
## brand name
|
97
|
+
config.brand_name = "PathoFast"
|
98
|
+
|
99
|
+
##should be located in app/mailers.
|
100
|
+
config.mailer_class = "New"
|
101
|
+
config.notification_class = "Noti"
|
102
|
+
config.notification_response_class = "NotiResponse"
|
103
|
+
|
104
|
+
|
105
|
+
#########################################################
|
106
|
+
##
|
107
|
+
## IF TESTING, SET THESE VARIABLES AS PER THE COMMENTS.
|
108
|
+
##
|
109
|
+
#########################################################
|
110
|
+
|
111
|
+
## set this to true in production, false by default.
|
112
|
+
config.recaptcha = false
|
113
|
+
|
114
|
+
## set this to true while testing.
|
115
|
+
config.stub_otp_api_calls = false
|
116
|
+
|
117
|
+
config.enable_sign_in_modals = true
|
118
|
+
config.navbar = true
|
119
|
+
config.brand_name = "Wordjelly"
|
120
|
+
|
121
|
+
Auth.configuration.host_name = "http://localhost:3000"
|
122
|
+
|
123
|
+
end
|
124
|
+
|
125
|
+
|
126
|
+
Recaptcha.configure do |config|
|
127
|
+
config.site_key = '6Lcx7iYTAAAAAPvmiKy93OS1PCLZm4MYrDAMcuuJ'
|
128
|
+
config.secret_key = '6Lcx7iYTAAAAACNBnwMjXZ1nbsp6E1HQo38PQ0ry'
|
129
|
+
end
|
130
|
+
|
131
|
+
Mongoid::Elasticsearch.prefix = Auth.configuration.brand_name.downcase + "_"
|
132
|
+
|
133
|
+
## will create indexes for the shopping classes and user class, as defined by you in the configuration.
|
134
|
+
[Auth.configuration.product_class, Auth.configuration.cart_class, Auth.configuration.cart_item_class, Auth.configuration.payment_class, Auth.configuration.discount_class, Auth.configuration.user_class]. each do |cl|
|
135
|
+
|
136
|
+
if ((cl) && (cl.constantize.respond_to? :es))
|
137
|
+
puts "CREATING INDEX : #{cl} , IF IT DOESNT EXIST"
|
138
|
+
cl.constantize.es.index.create
|
139
|
+
end
|
140
|
+
|
141
|
+
end
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
##TEST CODE TO RUN BEFORE EACH STARTUP.
|
147
|
+
|
148
|
+
|
149
|
+
#puts "total admins: #{Admin.count}"
|
150
|
+
#Admin.delete_all
|
151
|
+
|
152
|
+
#puts "total users: #{User.count}"
|
153
|
+
#User.delete_all
|
154
|
+
#Shopping::CartItem.delete_all
|
155
|
+
#Shopping::Cart.delete_all
|
156
|
+
#Shopping::Payment.delete_all
|
157
|
+
|
158
|
+
=begin
|
159
|
+
puts "deleting all users and admins"
|
160
|
+
puts User.delete_all
|
161
|
+
puts Admin.delete_all
|
162
|
+
|
163
|
+
puts "deleting all carts, cart items and payments"
|
164
|
+
Shopping::Cart.delete_all
|
165
|
+
puts Shopping::CartItem.delete_all
|
166
|
+
Shopping::Payment.delete_all
|
167
|
+
=end
|
@@ -0,0 +1,9 @@
|
|
1
|
+
#redis.rb
|
2
|
+
cnfg = nil
|
3
|
+
REDIS_CONFIG = YAML.load( File.open( Rails.root.join("config/redis.yml") ) ).symbolize_keys
|
4
|
+
dflt = REDIS_CONFIG[:default].symbolize_keys
|
5
|
+
cnfg = dflt.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym]
|
6
|
+
$redis = Redis.new(cnfg)
|
7
|
+
# To clear out the db before each test
|
8
|
+
puts "FLUSHING REDIS DB SINCE ENV IS DEVELOPMENT."
|
9
|
+
$redis.flushdb if Rails.env = "development"
|
@@ -0,0 +1,9 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# This file contains settings for ActionController::ParamsWrapper which
|
4
|
+
# is enabled by default.
|
5
|
+
|
6
|
+
# Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
|
7
|
+
ActiveSupport.on_load(:action_controller) do
|
8
|
+
wrap_parameters format: [:json] if respond_to?(:wrap_parameters)
|
9
|
+
end
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
|
2
|
+
|
3
|
+
en:
|
4
|
+
devise:
|
5
|
+
confirmations:
|
6
|
+
confirmed: "Your email address has been successfully confirmed."
|
7
|
+
send_instructions: "You will receive an email with instructions for how to confirm your email address in a few minutes."
|
8
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive an email with instructions for how to confirm your email address in a few minutes."
|
9
|
+
failure:
|
10
|
+
already_authenticated: "You are already signed in."
|
11
|
+
inactive: "Your account is not activated yet."
|
12
|
+
invalid: "Invalid %{authentication_keys} or password."
|
13
|
+
locked: "Your account is locked."
|
14
|
+
last_attempt: "You have one more attempt before your account is locked."
|
15
|
+
not_found_in_database: "Invalid %{authentication_keys} or password."
|
16
|
+
timeout: "Your session expired. Please sign in again to continue."
|
17
|
+
unauthenticated: "You need to sign in or sign up before continuing."
|
18
|
+
unconfirmed: "You have to confirm your email address before continuing."
|
19
|
+
mailer:
|
20
|
+
confirmation_instructions:
|
21
|
+
subject: "Confirmation instructions"
|
22
|
+
reset_password_instructions:
|
23
|
+
subject: "Reset password instructions"
|
24
|
+
unlock_instructions:
|
25
|
+
subject: "Unlock instructions"
|
26
|
+
password_change:
|
27
|
+
subject: "Password Changed"
|
28
|
+
omniauth_callbacks:
|
29
|
+
failure: "Could not authenticate you from %{kind} because \"%{reason}\"."
|
30
|
+
success: "Successfully authenticated from %{kind} account."
|
31
|
+
passwords:
|
32
|
+
no_token: "You can't access this page without coming from a password reset email. If you do come from a password reset email, please make sure you used the full URL provided."
|
33
|
+
send_instructions: "You will receive an email with instructions on how to reset your password in a few minutes."
|
34
|
+
send_paranoid_instructions: "If your email address exists in our database, you will receive a password recovery link at your email address in a few minutes."
|
35
|
+
updated: "Your password has been changed successfully. You are now signed in."
|
36
|
+
updated_not_active: "Your password has been changed successfully."
|
37
|
+
registrations:
|
38
|
+
destroyed: "Bye! Your account has been successfully cancelled. We hope to see you again soon."
|
39
|
+
signed_up: "Welcome! You have signed up successfully."
|
40
|
+
signed_up_but_inactive: "You have signed up successfully. However, we could not sign you in because your account is not yet activated."
|
41
|
+
signed_up_but_locked: "You have signed up successfully. However, we could not sign you in because your account is locked."
|
42
|
+
signed_up_but_unconfirmed: "A message with a confirmation link has been sent to your email address. Please follow the link to activate your account."
|
43
|
+
update_needs_confirmation: "You updated your account successfully, but we need to verify your new email address. Please check your email and follow the confirm link to confirm your new email address."
|
44
|
+
updated: "Your account has been updated successfully."
|
45
|
+
sessions:
|
46
|
+
signed_in: "Signed in successfully."
|
47
|
+
signed_out: "Signed out successfully."
|
48
|
+
already_signed_out: "Signed out successfully."
|
49
|
+
unlocks:
|
50
|
+
send_instructions: "You will receive an email with instructions for how to unlock your account in a few minutes."
|
51
|
+
send_paranoid_instructions: "If your account exists, you will receive an email with instructions for how to unlock it in a few minutes."
|
52
|
+
unlocked: "Your account has been unlocked successfully. Please sign in to continue."
|
53
|
+
errors:
|
54
|
+
messages:
|
55
|
+
already_confirmed: "was already confirmed, please try signing in"
|
56
|
+
confirmation_period_expired: "needs to be confirmed within %{period}, please request a new one"
|
57
|
+
expired: "has expired, please request a new one"
|
58
|
+
not_found: "not found"
|
59
|
+
not_locked: "was not locked"
|
60
|
+
not_saved:
|
61
|
+
one: "1 error prohibited this %{resource} from being saved:"
|
62
|
+
other: "%{count} errors prohibited this %{resource} from being saved:"
|
@@ -0,0 +1,25 @@
|
|
1
|
+
# Files in the config/locales directory are used for internationalization
|
2
|
+
# and are automatically loaded by Rails. If you want to use locales other
|
3
|
+
# than English, add the necessary files in this directory.
|
4
|
+
#
|
5
|
+
# To use the locales, use `I18n.t`:
|
6
|
+
#
|
7
|
+
# I18n.t 'hello'
|
8
|
+
#
|
9
|
+
# In views, this is aliased to just `t`:
|
10
|
+
#
|
11
|
+
# <%= t('hello') %>
|
12
|
+
#
|
13
|
+
# To use a different locale, set it with `I18n.locale`:
|
14
|
+
#
|
15
|
+
# I18n.locale = :es
|
16
|
+
#
|
17
|
+
# This would use the information in config/locales/es.yml.
|
18
|
+
#
|
19
|
+
# To learn more, please read the Rails Internationalization guide
|
20
|
+
# available at http://guides.rubyonrails.org/i18n.html.
|
21
|
+
|
22
|
+
en:
|
23
|
+
hello: "Hello world"
|
24
|
+
bye:
|
25
|
+
there: "go"
|
@@ -0,0 +1,142 @@
|
|
1
|
+
development:
|
2
|
+
# Configure available database clients. (required)
|
3
|
+
clients:
|
4
|
+
# Defines the default client. (required)
|
5
|
+
default:
|
6
|
+
# Defines the name of the default database that Mongoid can connect to.
|
7
|
+
# (required).
|
8
|
+
database: dummy_development
|
9
|
+
# Provides the hosts the default client can connect to. Must be an array
|
10
|
+
# of host:port pairs. (required)
|
11
|
+
hosts:
|
12
|
+
- localhost:27017
|
13
|
+
options:
|
14
|
+
# Change the default write concern. (default = { w: 1 })
|
15
|
+
# write:
|
16
|
+
# w: 1
|
17
|
+
|
18
|
+
# Change the default read preference. Valid options for mode are: :secondary,
|
19
|
+
# :secondary_preferred, :primary, :primary_preferred, :nearest
|
20
|
+
# (default: primary)
|
21
|
+
# read:
|
22
|
+
# mode: :secondary_preferred
|
23
|
+
# tag_sets:
|
24
|
+
# - use: web
|
25
|
+
|
26
|
+
# The name of the user for authentication.
|
27
|
+
# user: 'user'
|
28
|
+
|
29
|
+
# The password of the user for authentication.
|
30
|
+
# password: 'password'
|
31
|
+
|
32
|
+
# The user's database roles.
|
33
|
+
# roles:
|
34
|
+
# - 'dbOwner'
|
35
|
+
|
36
|
+
# Change the default authentication mechanism. Valid options are: :scram,
|
37
|
+
# :mongodb_cr, :mongodb_x509, and :plain. (default on 3.0 is :scram, default
|
38
|
+
# on 2.4 and 2.6 is :plain)
|
39
|
+
# auth_mech: :scram
|
40
|
+
|
41
|
+
# The database or source to authenticate the user against. (default: admin)
|
42
|
+
# auth_source: admin
|
43
|
+
|
44
|
+
# Force a the driver cluster to behave in a certain manner instead of auto-
|
45
|
+
# discovering. Can be one of: :direct, :replica_set, :sharded. Set to :direct
|
46
|
+
# when connecting to hidden members of a replica set.
|
47
|
+
# connect: :direct
|
48
|
+
|
49
|
+
# Changes the default time in seconds the server monitors refresh their status
|
50
|
+
# via ismaster commands. (default: 10)
|
51
|
+
# heartbeat_frequency: 10
|
52
|
+
|
53
|
+
# The time in seconds for selecting servers for a near read preference. (default: 5)
|
54
|
+
# local_threshold: 5
|
55
|
+
|
56
|
+
# The timeout in seconds for selecting a server for an operation. (default: 30)
|
57
|
+
# server_selection_timeout: 30
|
58
|
+
|
59
|
+
# The maximum number of connections in the connection pool. (default: 5)
|
60
|
+
# max_pool_size: 5
|
61
|
+
|
62
|
+
# The minimum number of connections in the connection pool. (default: 1)
|
63
|
+
# min_pool_size: 1
|
64
|
+
|
65
|
+
# The time to wait, in seconds, in the connection pool for a connection
|
66
|
+
# to be checked in before timing out. (default: 5)
|
67
|
+
# wait_queue_timeout: 5
|
68
|
+
|
69
|
+
# The time to wait to establish a connection before timing out, in seconds.
|
70
|
+
# (default: 5)
|
71
|
+
# connect_timeout: 5
|
72
|
+
|
73
|
+
# The timeout to wait to execute operations on a socket before raising an error.
|
74
|
+
# (default: 5)
|
75
|
+
# socket_timeout: 5
|
76
|
+
|
77
|
+
# The name of the replica set to connect to. Servers provided as seeds that do
|
78
|
+
# not belong to this replica set will be ignored.
|
79
|
+
# replica_set: name
|
80
|
+
|
81
|
+
# Whether to connect to the servers via ssl. (default: false)
|
82
|
+
# ssl: true
|
83
|
+
|
84
|
+
# The certificate file used to identify the connection against MongoDB.
|
85
|
+
# ssl_cert: /path/to/my.cert
|
86
|
+
|
87
|
+
# The private keyfile used to identify the connection against MongoDB.
|
88
|
+
# Note that even if the key is stored in the same file as the certificate,
|
89
|
+
# both need to be explicitly specified.
|
90
|
+
# ssl_key: /path/to/my.key
|
91
|
+
|
92
|
+
# A passphrase for the private key.
|
93
|
+
# ssl_key_pass_phrase: password
|
94
|
+
|
95
|
+
# Whether or not to do peer certification validation. (default: true)
|
96
|
+
# ssl_verify: true
|
97
|
+
|
98
|
+
# The file containing a set of concatenated certification authority certifications
|
99
|
+
# used to validate certs passed from the other end of the connection.
|
100
|
+
# ssl_ca_cert: /path/to/ca.cert
|
101
|
+
|
102
|
+
|
103
|
+
# Configure Mongoid specific options. (optional)
|
104
|
+
options:
|
105
|
+
# Includes the root model name in json serialization. (default: false)
|
106
|
+
# include_root_in_json: false
|
107
|
+
|
108
|
+
# Include the _type field in serialization. (default: false)
|
109
|
+
# include_type_for_serialization: false
|
110
|
+
|
111
|
+
# Preload all models in development, needed when models use
|
112
|
+
# inheritance. (default: false)
|
113
|
+
# preload_models: false
|
114
|
+
|
115
|
+
# Raise an error when performing a #find and the document is not found.
|
116
|
+
# (default: true)
|
117
|
+
# raise_not_found_error: true
|
118
|
+
|
119
|
+
# Raise an error when defining a scope with the same name as an
|
120
|
+
# existing method. (default: false)
|
121
|
+
# scope_overwrite_exception: false
|
122
|
+
|
123
|
+
# Use Active Support's time zone in conversions. (default: true)
|
124
|
+
# use_activesupport_time_zone: true
|
125
|
+
|
126
|
+
# Ensure all times are UTC in the app side. (default: false)
|
127
|
+
# use_utc: false
|
128
|
+
|
129
|
+
# Set the Mongoid and Ruby driver log levels when not in a Rails
|
130
|
+
# environment. The Mongoid logger will be set to the Rails logger
|
131
|
+
# otherwise.(default: :info)
|
132
|
+
# log_level: :info
|
133
|
+
test:
|
134
|
+
clients:
|
135
|
+
default:
|
136
|
+
database: dummy_test
|
137
|
+
hosts:
|
138
|
+
- localhost:27017
|
139
|
+
options:
|
140
|
+
read:
|
141
|
+
mode: :primary
|
142
|
+
max_pool_size: 1
|