wordjelly-auth 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (275) hide show
  1. checksums.yaml +7 -0
  2. data/MIT-LICENSE +20 -0
  3. data/README.rdoc +3 -0
  4. data/Rakefile +35 -0
  5. data/app/assets/images/auth/activity.jpg +0 -0
  6. data/app/assets/images/auth/facebook.svg +1 -0
  7. data/app/assets/images/auth/google_oauth2.svg +1 -0
  8. data/app/assets/images/auth/js_pic3.jpg +0 -0
  9. data/app/assets/images/auth/profile.jpg +0 -0
  10. data/app/assets/javascripts/auth/admin_create_users.js +2 -0
  11. data/app/assets/javascripts/auth/application.js +20 -0
  12. data/app/assets/javascripts/auth/auth_dependencies.js +12 -0
  13. data/app/assets/javascripts/auth/auth_modals_and_navbar.js +218 -0
  14. data/app/assets/javascripts/auth/clients.js +2 -0
  15. data/app/assets/javascripts/auth/search.js +2 -0
  16. data/app/assets/javascripts/auth/shopping/discounts.js +2 -0
  17. data/app/assets/javascripts/auth/users/profiles.js +188 -0
  18. data/app/assets/stylesheets/auth/admin_create_users.css +4 -0
  19. data/app/assets/stylesheets/auth/application.scss +14 -0
  20. data/app/assets/stylesheets/auth/auth_default_css.scss +13 -0
  21. data/app/assets/stylesheets/auth/common-styles.scss +579 -0
  22. data/app/assets/stylesheets/auth/overrides.scss +26 -0
  23. data/app/assets/stylesheets/auth/search.css +4 -0
  24. data/app/assets/stylesheets/auth/shopping/discounts.css +4 -0
  25. data/app/assets/stylesheets/auth/users/profiles.scss +40 -0
  26. data/app/assets/stylesheets/scaffold.css +56 -0
  27. data/app/controllers/auth/admin_create_users_controller.rb +89 -0
  28. data/app/controllers/auth/application_controller.rb +97 -0
  29. data/app/controllers/auth/clients_controller.rb +105 -0
  30. data/app/controllers/auth/concerns/activity_controller_concern.rb +32 -0
  31. data/app/controllers/auth/concerns/devise_concern.rb +193 -0
  32. data/app/controllers/auth/concerns/omni_concern.rb +310 -0
  33. data/app/controllers/auth/concerns/otp_concern.rb +251 -0
  34. data/app/controllers/auth/concerns/shopping/cart_controller_concern.rb +105 -0
  35. data/app/controllers/auth/concerns/shopping/cart_item_controller_concern.rb +150 -0
  36. data/app/controllers/auth/concerns/shopping/discount_controller_concern.rb +97 -0
  37. data/app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb +38 -0
  38. data/app/controllers/auth/concerns/shopping/payment_controller_concern.rb +101 -0
  39. data/app/controllers/auth/concerns/shopping/product_controller_concern.rb +68 -0
  40. data/app/controllers/auth/concerns/token_concern.rb +187 -0
  41. data/app/controllers/auth/confirmations_controller.rb +3 -0
  42. data/app/controllers/auth/mailgun_controller.rb +8 -0
  43. data/app/controllers/auth/omniauth_callbacks_controller.rb +6 -0
  44. data/app/controllers/auth/passwords_controller.rb +4 -0
  45. data/app/controllers/auth/profiles_controller.rb +156 -0
  46. data/app/controllers/auth/registrations_controller.rb +99 -0
  47. data/app/controllers/auth/search_controller.rb +61 -0
  48. data/app/controllers/auth/sessions_controller.rb +20 -0
  49. data/app/controllers/auth/shopping/cart_items_controller.rb +14 -0
  50. data/app/controllers/auth/shopping/carts_controller.rb +13 -0
  51. data/app/controllers/auth/shopping/discounts_controller.rb +19 -0
  52. data/app/controllers/auth/shopping/payments_controller.rb +13 -0
  53. data/app/controllers/auth/shopping/products_controller.rb +17 -0
  54. data/app/controllers/auth/shopping/shopping_controller.rb +86 -0
  55. data/app/controllers/auth/unlocks_controller.rb +3 -0
  56. data/app/controllers/auth/webhooks_controller.rb +3 -0
  57. data/app/helpers/auth/admin_create_users_helper.rb +2 -0
  58. data/app/helpers/auth/application_helper.rb +136 -0
  59. data/app/helpers/auth/clients_helper.rb +4 -0
  60. data/app/helpers/auth/resource_helper.rb +10 -0
  61. data/app/helpers/auth/search_helper.rb +2 -0
  62. data/app/helpers/auth/shopping/cart_items/cart_items_helper.rb +29 -0
  63. data/app/helpers/auth/shopping/carts/carts_helper.rb +25 -0
  64. data/app/helpers/auth/shopping/discounts/discounts_helper.rb +39 -0
  65. data/app/helpers/auth/shopping/payments/pay_u_money_helper.rb +56 -0
  66. data/app/helpers/auth/shopping/payments/payments_helper.rb +54 -0
  67. data/app/helpers/auth/shopping/products/products_helper.rb +52 -0
  68. data/app/helpers/auth/shopping/shopping_helper.rb +3 -0
  69. data/app/helpers/auth/users/profiles_helper.rb +12 -0
  70. data/app/jobs/otp_job.rb +92 -0
  71. data/app/mailers/application_mailer.rb +4 -0
  72. data/app/mailers/auth/notifier.rb +9 -0
  73. data/app/models/auth/admin_create_user.rb +3 -0
  74. data/app/models/auth/client.rb +52 -0
  75. data/app/models/auth/concerns/activity_concern.rb +112 -0
  76. data/app/models/auth/concerns/chief_model_concern.rb +73 -0
  77. data/app/models/auth/concerns/es_concern.rb +21 -0
  78. data/app/models/auth/concerns/notification_concern.rb +232 -0
  79. data/app/models/auth/concerns/notification_response_concern.rb +71 -0
  80. data/app/models/auth/concerns/owner_concern.rb +81 -0
  81. data/app/models/auth/concerns/shopping/cart_concern.rb +329 -0
  82. data/app/models/auth/concerns/shopping/cart_item_concern.rb +437 -0
  83. data/app/models/auth/concerns/shopping/discount_concern.rb +482 -0
  84. data/app/models/auth/concerns/shopping/discount_flow.txt +11 -0
  85. data/app/models/auth/concerns/shopping/pay_u_money_concern.rb +184 -0
  86. data/app/models/auth/concerns/shopping/payment_concern.rb +613 -0
  87. data/app/models/auth/concerns/shopping/product_concern.rb +102 -0
  88. data/app/models/auth/concerns/sms_otp_concern.rb +68 -0
  89. data/app/models/auth/concerns/user_concern.rb +788 -0
  90. data/app/models/auth/identity.rb +23 -0
  91. data/app/models/auth/shopping/cart.rb +3 -0
  92. data/app/models/auth/shopping/cart_item.rb +6 -0
  93. data/app/models/auth/shopping/cart_item_payment_result.rb +7 -0
  94. data/app/models/auth/shopping/discount.rb +4 -0
  95. data/app/models/auth/shopping/payment.rb +5 -0
  96. data/app/models/auth/shopping/product.rb +5 -0
  97. data/app/models/auth/user.rb +3 -0
  98. data/app/views/auth/admin_create_users/_admin_actions.html.erb +46 -0
  99. data/app/views/auth/admin_create_users/_form.html.erb +19 -0
  100. data/app/views/auth/admin_create_users/edit.html.erb +6 -0
  101. data/app/views/auth/admin_create_users/index.html.erb +25 -0
  102. data/app/views/auth/admin_create_users/new.html.erb +5 -0
  103. data/app/views/auth/admin_create_users/show.html.erb +8 -0
  104. data/app/views/auth/clients/_form.html.erb +41 -0
  105. data/app/views/auth/clients/edit.html.erb +6 -0
  106. data/app/views/auth/clients/index.html.erb +33 -0
  107. data/app/views/auth/clients/new.html.erb +5 -0
  108. data/app/views/auth/clients/show.html.erb +21 -0
  109. data/app/views/auth/confirmations/_enter_otp.html.erb +27 -0
  110. data/app/views/auth/confirmations/_get_otp_status.html.erb +25 -0
  111. data/app/views/auth/confirmations/_new_otp_input.js.erb +11 -0
  112. data/app/views/auth/confirmations/_resend_otp.js.erb +8 -0
  113. data/app/views/auth/confirmations/_resend_sms_otp.html.erb +18 -0
  114. data/app/views/auth/confirmations/_verify_otp.js.erb +64 -0
  115. data/app/views/auth/confirmations/create.js.erb +8 -0
  116. data/app/views/auth/confirmations/enter_otp.html.erb +7 -0
  117. data/app/views/auth/confirmations/get_otp_status.html.erb +3 -0
  118. data/app/views/auth/confirmations/new.html.erb +1 -0
  119. data/app/views/auth/confirmations/new.js.erb +16 -0
  120. data/app/views/auth/confirmations/otp_status_result.html.erb +20 -0
  121. data/app/views/auth/mailer/confirmation_instructions.html.erb +5 -0
  122. data/app/views/auth/mailer/password_change.html.erb +3 -0
  123. data/app/views/auth/mailer/reset_password_instructions.html.erb +8 -0
  124. data/app/views/auth/mailer/unlock_instructions.html.erb +7 -0
  125. data/app/views/auth/modals/_ajax_error_modal.html.erb +3 -0
  126. data/app/views/auth/modals/_ajax_error_modal_content.html.erb +0 -0
  127. data/app/views/auth/modals/_edit_account_content.html.erb +68 -0
  128. data/app/views/auth/modals/_edit_account_success_content.html.erb +5 -0
  129. data/app/views/auth/modals/_error_notification.html.erb +8 -0
  130. data/app/views/auth/modals/_forgot_password_content.html.erb +18 -0
  131. data/app/views/auth/modals/_forgot_password_success_content.html.erb +8 -0
  132. data/app/views/auth/modals/_login_default_content.html.erb +3 -0
  133. data/app/views/auth/modals/_login_forms.html.erb +13 -0
  134. data/app/views/auth/modals/_login_navigation_options.html.erb +12 -0
  135. data/app/views/auth/modals/_new_otp_input.html.erb +28 -0
  136. data/app/views/auth/modals/_oauth_and_submit.html.erb +21 -0
  137. data/app/views/auth/modals/_recaptcha_tags.html.erb +4 -0
  138. data/app/views/auth/modals/_resend_confirmation_content.html.erb +17 -0
  139. data/app/views/auth/modals/_resend_confirmation_success_content.html.erb +8 -0
  140. data/app/views/auth/modals/_resend_otp.html.erb +23 -0
  141. data/app/views/auth/modals/_resource_errors.js.erb +24 -0
  142. data/app/views/auth/modals/_sign_in_inputs.html.erb +10 -0
  143. data/app/views/auth/modals/_sign_in_needed_modal.html.erb +3 -0
  144. data/app/views/auth/modals/_sign_in_success_content.html.erb +5 -0
  145. data/app/views/auth/modals/_sign_up_inputs.html.erb +9 -0
  146. data/app/views/auth/modals/_sign_up_success_content.html.erb +1 -0
  147. data/app/views/auth/modals/_sign_up_success_inactive_content.html.erb +2 -0
  148. data/app/views/auth/modals/_unlock_content.html.erb +17 -0
  149. data/app/views/auth/modals/_verify_otp.html.erb +1 -0
  150. data/app/views/auth/modals/base_modal/_base.html.erb +25 -0
  151. data/app/views/auth/modals/login.js.erb +120 -0
  152. data/app/views/auth/modals/unlock_success_content.html.erb +8 -0
  153. data/app/views/auth/notifier/_email.html.erb +3 -0
  154. data/app/views/auth/notifier/notification.html.erb +2 -0
  155. data/app/views/auth/notifier/notification.text.erb +1 -0
  156. data/app/views/auth/omniauth_callbacks/failure.html.erb +4 -0
  157. data/app/views/auth/passwords/create.js.erb +12 -0
  158. data/app/views/auth/passwords/edit.html.erb +25 -0
  159. data/app/views/auth/passwords/new.html.erb +16 -0
  160. data/app/views/auth/passwords/new.js.erb +19 -0
  161. data/app/views/auth/profiles/_proxy_resource.html.erb +5 -0
  162. data/app/views/auth/profiles/set_proxy_resource.js.erb +1 -0
  163. data/app/views/auth/profiles/show.html.erb +8 -0
  164. data/app/views/auth/registrations/create.js.erb +40 -0
  165. data/app/views/auth/registrations/edit.html.erb +2 -0
  166. data/app/views/auth/registrations/edit.js.erb +5 -0
  167. data/app/views/auth/registrations/new.html.erb +33 -0
  168. data/app/views/auth/registrations/update.js.erb +47 -0
  169. data/app/views/auth/search/_search_bar.html.erb +11 -0
  170. data/app/views/auth/search/_search_result.html.erb +7 -0
  171. data/app/views/auth/search/_search_results.html.erb +4 -0
  172. data/app/views/auth/search/authenticated_user_search.js.erb +45 -0
  173. data/app/views/auth/search/authenticated_user_search.json +7 -0
  174. data/app/views/auth/sessions/create.js.erb +5 -0
  175. data/app/views/auth/sessions/new.html.erb +4 -0
  176. data/app/views/auth/sessions/new.js.erb +20 -0
  177. data/app/views/auth/shared/_devise_error_messages.html.erb +9 -0
  178. data/app/views/auth/shared/_links.html.erb +25 -0
  179. data/app/views/auth/shared/_object_errors.html.erb +12 -0
  180. data/app/views/auth/shared/_proxy_resource.html.erb +18 -0
  181. data/app/views/auth/shopping/cart_items/_form.html.erb +34 -0
  182. data/app/views/auth/shopping/cart_items/_show_cart_items_collection.html.erb +31 -0
  183. data/app/views/auth/shopping/cart_items/create_multiple.html.erb +6 -0
  184. data/app/views/auth/shopping/cart_items/create_multiple.json.erb +9 -0
  185. data/app/views/auth/shopping/cart_items/edit.html.erb +6 -0
  186. data/app/views/auth/shopping/cart_items/index.html.erb +52 -0
  187. data/app/views/auth/shopping/cart_items/new.html.erb +5 -0
  188. data/app/views/auth/shopping/cart_items/show.html.erb +13 -0
  189. data/app/views/auth/shopping/carts/_form.html.erb +35 -0
  190. data/app/views/auth/shopping/carts/_payment_links.html.erb +27 -0
  191. data/app/views/auth/shopping/carts/_remove_cart_item.html.erb +11 -0
  192. data/app/views/auth/shopping/carts/_show_cart_balance_info.html.erb +35 -0
  193. data/app/views/auth/shopping/carts/edit.html.erb +6 -0
  194. data/app/views/auth/shopping/carts/index.html.erb +43 -0
  195. data/app/views/auth/shopping/carts/new.html.erb +5 -0
  196. data/app/views/auth/shopping/carts/show.html.erb +46 -0
  197. data/app/views/auth/shopping/discounts/_form.html.erb +18 -0
  198. data/app/views/auth/shopping/discounts/_form_for_create_multiple_cart_items.html.erb +17 -0
  199. data/app/views/auth/shopping/discounts/_show_pending_discount_request.html.erb +17 -0
  200. data/app/views/auth/shopping/discounts/destroy.html.erb +2 -0
  201. data/app/views/auth/shopping/discounts/edit.html.erb +29 -0
  202. data/app/views/auth/shopping/discounts/index.html.erb +40 -0
  203. data/app/views/auth/shopping/discounts/new.html.erb +1 -0
  204. data/app/views/auth/shopping/discounts/show.html.erb +18 -0
  205. data/app/views/auth/shopping/discounts/update.html.erb +2 -0
  206. data/app/views/auth/shopping/payments/_approve_payment.html.erb +7 -0
  207. data/app/views/auth/shopping/payments/_cash_card_cheque.html.erb +24 -0
  208. data/app/views/auth/shopping/payments/_create_discount_coupon.html.erb +5 -0
  209. data/app/views/auth/shopping/payments/_form.html.erb +19 -0
  210. data/app/views/auth/shopping/payments/_gateway.html.erb +21 -0
  211. data/app/views/auth/shopping/payments/_proceed_to_gateway_or_verify_payment.html.erb +18 -0
  212. data/app/views/auth/shopping/payments/_refresh_payment.html.erb +7 -0
  213. data/app/views/auth/shopping/payments/_refund.html.erb +10 -0
  214. data/app/views/auth/shopping/payments/_show_payment_receipt.html.erb +12 -0
  215. data/app/views/auth/shopping/payments/edit.html.erb +6 -0
  216. data/app/views/auth/shopping/payments/index.html.erb +43 -0
  217. data/app/views/auth/shopping/payments/new.html.erb +13 -0
  218. data/app/views/auth/shopping/payments/show.html.erb +36 -0
  219. data/app/views/auth/shopping/products/_form.html.erb +27 -0
  220. data/app/views/auth/shopping/products/edit.html.erb +6 -0
  221. data/app/views/auth/shopping/products/index.html.erb +48 -0
  222. data/app/views/auth/shopping/products/index.json.erb +7 -0
  223. data/app/views/auth/shopping/products/new.html.erb +5 -0
  224. data/app/views/auth/shopping/products/show.html.erb +12 -0
  225. data/app/views/auth/shopping/products/show.json.erb +1 -0
  226. data/app/views/auth/unlocks/create.js.erb +12 -0
  227. data/app/views/auth/unlocks/new.html.erb +14 -0
  228. data/app/views/auth/unlocks/new.js.erb +17 -0
  229. data/app/views/auth/users/_search_result.html.erb +8 -0
  230. data/app/views/auth/users/profiles/_user_data.html.erb +4 -0
  231. data/app/views/auth/users/profiles/show.html.erb +54 -0
  232. data/app/views/layouts/auth/_modals.html.erb +2 -0
  233. data/app/views/layouts/auth/application.html.erb +17 -0
  234. data/app/views/layouts/auth/navbar/_navbar.html.erb +49 -0
  235. data/app/views/layouts/auth/navbar/_personalization.html.erb +17 -0
  236. data/app/views/layouts/auth/navbar/_progress_spinner.html.erb +11 -0
  237. data/app/views/layouts/mailer.html.erb +5 -0
  238. data/app/views/layouts/mailer.text.erb +1 -0
  239. data/config/initializers/active_model.rb +36 -0
  240. data/config/initializers/devise.rb +623 -0
  241. data/config/initializers/json.rb +10 -0
  242. data/config/initializers/omniauth.rb +447 -0
  243. data/config/initializers/redis.rb +2 -0
  244. data/config/initializers/redis.yml +14 -0
  245. data/config/locales/devise.en.yml +63 -0
  246. data/config/routes.rb +1 -0
  247. data/lib/assets/javascripts/data.js +126 -0
  248. data/lib/assets/javascripts/jquery.calendario.js +394 -0
  249. data/lib/assets/javascripts/jquery.tagcloud.js +92 -0
  250. data/lib/assets/javascripts/leanModal.js +236 -0
  251. data/lib/assets/javascripts/main.js +668 -0
  252. data/lib/assets/javascripts/modernizr.custom.63321.js +4 -0
  253. data/lib/assets/javascripts/payumoney.js +9 -0
  254. data/lib/assets/javascripts/search.js +36 -0
  255. data/lib/assets/javascripts/spinner.js +77 -0
  256. data/lib/assets/javascripts/trianglify.min.js +2 -0
  257. data/lib/assets/javascripts/you_need_to_sign_in.js.erb +478 -0
  258. data/lib/assets/stylesheets/calendar.css +111 -0
  259. data/lib/assets/stylesheets/calendar_modifications.scss +276 -0
  260. data/lib/auth.rb +32 -0
  261. data/lib/auth/custom_failure.rb +3 -0
  262. data/lib/auth/engine.rb +231 -0
  263. data/lib/auth/job_exception_handler.rb +7 -0
  264. data/lib/auth/mailgun.rb +28 -0
  265. data/lib/auth/notify.rb +8 -0
  266. data/lib/auth/omniauth/path.rb +104 -0
  267. data/lib/auth/partials.rb +12 -0
  268. data/lib/auth/rails/routes.rb +169 -0
  269. data/lib/auth/search/main.rb +97 -0
  270. data/lib/auth/sidekiq_up.rb +16 -0
  271. data/lib/auth/two_factor_otp.rb +202 -0
  272. data/lib/auth/url_shortener.rb +29 -0
  273. data/lib/auth/version.rb +3 -0
  274. data/lib/tasks/auth_tasks.rake +4 -0
  275. metadata +863 -0
@@ -0,0 +1,202 @@
1
+ module Auth
2
+ module TwoFactorOtp
3
+
4
+ ## the currently being used resource.
5
+ mattr_accessor :resource
6
+
7
+ TWO_FACTOR_BASE_URL = "http://2factor.in/API/V1/"
8
+ TWO_FACTOR_TRANSACTIONAL_SMS_URL = "/ADDON_SERVICES/SEND/TSMS"
9
+ ##returns the string value at the errors keys in the redis hash
10
+ def self.check_errors
11
+ $redis.hget(resource.id.to_s + "_two_factor_sms_otp","error")
12
+ end
13
+
14
+ def self.set_webhook_identifier(notification_response,last_response)
15
+
16
+
17
+ last_response = JSON.parse(last_response)
18
+
19
+ if last_response["Status"] && last_response["Status"] == "Success"
20
+
21
+ notification_response.webhook_identifier = last_response["Details"]
22
+ end
23
+
24
+ end
25
+
26
+ ## to_number : string, indian telephone number, without the preceeding 91
27
+ ## template : the two_factor_otp template
28
+ ## example request should look like this
29
+ ## "https://2factor.in/API/R1/?module=TRANS_SMS&apikey=#{Auth.configuration.third_party_api_keys[:two_factor_sms_api_key]}&to=#{to_number}&from=#{template_sender_id}&templatename=TemplateName&var1=VAR1_VALUE&var2=VAR2_VALUE"
30
+ ## @return[String] session_id
31
+ def send_transactional_sms(args)
32
+ to_number = args[:to_number]
33
+ template_name = args[:template_name]
34
+ var_hash = args[:var_hash]
35
+ template_sender_id = args[:template_sender_id]
36
+
37
+ url = "https://2factor.in/API/R1/?module=TRANS_SMS"
38
+
39
+ params = {
40
+ apikey: Auth.configuration.third_party_api_keys[:two_factor_sms_api_key],
41
+ to: to_number,
42
+ from: template_sender_id,
43
+ templatename: template_name,
44
+ }.merge(var_hash)
45
+
46
+ request = Typhoeus::Request.new(
47
+ url,
48
+ params: params,
49
+ timeout: typhoeus_timeout
50
+ )
51
+
52
+ response = request.run
53
+
54
+ response.body
55
+ end
56
+
57
+ def auth_gen
58
+
59
+ #puts "--entered auth gen with params #{self.id} and phone number #{self.additional_login_param}"
60
+ clear_redis_user_otp_hash
61
+ #puts "--came after clearing the redis hash."
62
+ if Auth.configuration.third_party_api_keys[:two_factor_sms_api_key].nil?
63
+ #puts "--no api key found"
64
+ log_error_to_redis("no api key found for two_factor_sms_otp")
65
+ else
66
+ #puts "--running request"
67
+
68
+ response = send_otp_response
69
+
70
+ if response.code == 200
71
+ puts "-- send response code is 200"
72
+ response_body = JSON.parse(response.body).symbolize_keys
73
+ puts "---send response body is:"
74
+ puts response_body.to_s
75
+ if response_body[:Status] == "Success"
76
+ puts "--send response status is success"
77
+ puts "set the redis value to : #{response_body[:Details]}"
78
+ $redis.hset(resource.id.to_s + "_two_factor_sms_otp","otp_session_id",response_body[:Details])
79
+ else
80
+ #puts "--response status is failure"
81
+ log_error_to_redis(response_body[:Details])
82
+ end
83
+ else
84
+ #puts "--response code is non 200"
85
+ log_error_to_redis("HTTP Error code:"+ response.code.to_s)
86
+ end
87
+ end
88
+
89
+ end
90
+
91
+ def verify(otp)
92
+
93
+ if Auth.configuration.third_party_api_keys[:two_factor_sms_api_key].nil?
94
+ log_error_to_redis("no api key found for two_factor_sms_otp")
95
+ else
96
+ otp_session_id = $redis.hget(resource.id.to_s + "_two_factor_sms_otp","otp_session_id")
97
+ if otp_session_id.nil?
98
+ log_error_to_redis("No otp session id found, please click \"resend otp message\" and try again")
99
+ else
100
+
101
+ response = verify_otp_response(otp,otp_session_id)
102
+ if response.code == 200
103
+ response_body = JSON.parse(response.body).symbolize_keys
104
+ if response_body[:Status] == "Success"
105
+ ##suppose here we say additional parameter confirmed
106
+ ##then when we have to sign in user, we just need to bypass the active_for_authentication,
107
+ ##and dont touch anything else.
108
+
109
+ resource.otp = otp
110
+
111
+ resource.additional_login_param_status = 2
112
+
113
+ resource.save
114
+
115
+
116
+
117
+ clear_redis_user_otp_hash
118
+ else
119
+ log_error_to_redis(response_body[:Details])
120
+ end
121
+ else
122
+ log_error_to_redis("HTTP Error code:"+ response.code.to_s)
123
+ end
124
+ end
125
+ end
126
+ end
127
+
128
+ def log_error_to_redis(error)
129
+ #puts "redis error is:#{error}"
130
+ $redis.hset(resource.id.to_s + "_two_factor_sms_otp","error",error)
131
+ end
132
+
133
+ def clear_redis_user_otp_hash
134
+ #puts "--came to clear redis otp hash."
135
+ $redis.del(resource.id.to_s + "_two_factor_sms_otp")
136
+ end
137
+
138
+ def send_otp_response
139
+ if Auth.configuration.stub_otp_api_calls == true
140
+
141
+ OpenStruct.new({code: 200, body: JSON.generate({:Status => "Success", :Details => Faker::Name.name})})
142
+ else
143
+ Typhoeus.get("https://2factor.in/API/V1/#{Auth.configuration.third_party_api_keys[:two_factor_sms_api_key]}/SMS/+91#{resource.additional_login_param}/AUTOGEN", timeout: typhoeus_timeout)
144
+ end
145
+ end
146
+
147
+ def verify_otp_response(otp,otp_session_id)
148
+
149
+ if Auth.configuration.stub_otp_api_calls == true
150
+ if Auth.configuration.simulate_invalid_otp == true
151
+ OpenStruct.new({code: 200, body: JSON.generate({:Status => "failed", :Details => "your otp is invalid"})})
152
+ else
153
+
154
+ ##check the otp, and derive the response based on that.
155
+ ##this comparison of comparing the session id, with the opt is just for test purpose.
156
+ ##in reality they have nothing to do with each other.
157
+ puts "otp session id is:#{otp_session_id}"
158
+ puts "otp is: #{otp}"
159
+ OpenStruct.new({code: 200, body: JSON.generate({:Status => ((otp_session_id == otp) ? "Success" : "failed"), :Details => "location: two_factor_otp.rb#verify_otp_response, compares otp_session id to provided otp to decide failure or success"})})
160
+ end
161
+ else
162
+ Typhoeus.get("https://2factor.in/API/V1/#{Auth.configuration.third_party_api_keys[:two_factor_sms_api_key]}/SMS/VERIFY/#{otp_session_id}/#{otp}", timeout: typhoeus_timeout)
163
+ end
164
+ end
165
+
166
+ ############################ WEBHOOK #####################
167
+
168
+ def sms_webhook(params)
169
+
170
+ Auth.configuration.notification_response_class.constantize.find_and_update_notification_response(params[:SessionId],JSON.generate(params)) do |notification_response|
171
+ puts "found the sms notification response and triggered it."
172
+ if transactional_sms_failed?(params)
173
+ notification = notification_response.get_parent_notification
174
+ resource = notification_response.get_resource
175
+ notification.send_sms_background(resource)
176
+ end
177
+
178
+ end
179
+
180
+ end
181
+
182
+
183
+ def transactional_sms_delivered?(params)
184
+ params[:StatusGroupId] && params[:StatusGroupId].to_s == "3"
185
+ end
186
+
187
+ def transactional_sms_pending?(params)
188
+ params[:StatusGroupId] && params[:StatusGroupId].to_s =~ /0|1/
189
+ end
190
+
191
+ def transactional_sms_failed?(params)
192
+ !params[:StatusGroupId] || (params[:StatusGroupId] && params[:StatusGroupId].to_s =~ /2|4|5/)
193
+ end
194
+
195
+ ## return the timeout in seconds.
196
+ def typhoeus_timeout
197
+ 10
198
+ end
199
+
200
+
201
+ end
202
+ end
@@ -0,0 +1,29 @@
1
+ module UrlShortener
2
+ ## return[String] shortened url OR nil if exception is encountered.
3
+ def self.url_shortener_endpoint
4
+ "https://www.googleapis.com/urlshortener/v1/url"
5
+ end
6
+
7
+ ## return[String] shortened url.
8
+ ## raises exception if no longurl provided.
9
+ def self.shorten(longUrl=nil)
10
+ raise Exception.new("long url not provided") if longUrl.nil?
11
+ body = {:longUrl => longUrl}.to_json
12
+ request = Typhoeus::Request.new(
13
+ url_shortener_endpoint,
14
+ method: :post,
15
+ params:
16
+ {
17
+ key: Auth.configuration.third_party_api_keys[:google_url_shortener_api_key]
18
+ },
19
+ body: body,
20
+ headers: {
21
+ 'Accept' => "application/json",
22
+ 'Content-Type' => "application/json"
23
+ }
24
+ )
25
+ response = request.run
26
+ JSON.parse(response.body)["id"] if response.success?
27
+
28
+ end
29
+ end
@@ -0,0 +1,3 @@
1
+ module Auth
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,4 @@
1
+ # desc "Explaining what the task does"
2
+ # task :auth do
3
+ # # Task goes here
4
+ # end
metadata ADDED
@@ -0,0 +1,863 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: wordjelly-auth
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - bhargav
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2018-02-20 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: xpath
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 2.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: rails
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: 4.2.6
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: 4.2.6
41
+ - !ruby/object:Gem::Dependency
42
+ name: sass-rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: turbolinks
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'
69
+ - !ruby/object:Gem::Dependency
70
+ name: remotipart
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: momentjs-rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: simple_token_authentication
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: devise
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 4.1.1
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '='
123
+ - !ruby/object:Gem::Version
124
+ version: 4.1.1
125
+ - !ruby/object:Gem::Dependency
126
+ name: omniauth
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - '='
130
+ - !ruby/object:Gem::Version
131
+ version: 1.4.1
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - '='
137
+ - !ruby/object:Gem::Version
138
+ version: 1.4.1
139
+ - !ruby/object:Gem::Dependency
140
+ name: omniauth-google-oauth2
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - '='
144
+ - !ruby/object:Gem::Version
145
+ version: 0.4.1
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - '='
151
+ - !ruby/object:Gem::Version
152
+ version: 0.4.1
153
+ - !ruby/object:Gem::Dependency
154
+ name: omniauth-twitter
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :runtime
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: omniauth-facebook
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - '='
172
+ - !ruby/object:Gem::Version
173
+ version: 4.0.0
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - '='
179
+ - !ruby/object:Gem::Version
180
+ version: 4.0.0
181
+ - !ruby/object:Gem::Dependency
182
+ name: omniauth-linkedin
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: thin
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - ">="
200
+ - !ruby/object:Gem::Version
201
+ version: '0'
202
+ type: :runtime
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - ">="
207
+ - !ruby/object:Gem::Version
208
+ version: '0'
209
+ - !ruby/object:Gem::Dependency
210
+ name: valid_url
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :runtime
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: materialize-sass
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - '='
228
+ - !ruby/object:Gem::Version
229
+ version: 0.97.1
230
+ type: :runtime
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - '='
235
+ - !ruby/object:Gem::Version
236
+ version: 0.97.1
237
+ - !ruby/object:Gem::Dependency
238
+ name: recaptcha
239
+ requirement: !ruby/object:Gem::Requirement
240
+ requirements:
241
+ - - ">="
242
+ - !ruby/object:Gem::Version
243
+ version: '0'
244
+ type: :runtime
245
+ prerelease: false
246
+ version_requirements: !ruby/object:Gem::Requirement
247
+ requirements:
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: underscore-rails
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :runtime
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: hashie
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - '='
270
+ - !ruby/object:Gem::Version
271
+ version: 3.5.1
272
+ type: :runtime
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - '='
277
+ - !ruby/object:Gem::Version
278
+ version: 3.5.1
279
+ - !ruby/object:Gem::Dependency
280
+ name: typhoeus
281
+ requirement: !ruby/object:Gem::Requirement
282
+ requirements:
283
+ - - ">="
284
+ - !ruby/object:Gem::Version
285
+ version: '0'
286
+ type: :runtime
287
+ prerelease: false
288
+ version_requirements: !ruby/object:Gem::Requirement
289
+ requirements:
290
+ - - ">="
291
+ - !ruby/object:Gem::Version
292
+ version: '0'
293
+ - !ruby/object:Gem::Dependency
294
+ name: redis
295
+ requirement: !ruby/object:Gem::Requirement
296
+ requirements:
297
+ - - '='
298
+ - !ruby/object:Gem::Version
299
+ version: 3.3.1
300
+ type: :runtime
301
+ prerelease: false
302
+ version_requirements: !ruby/object:Gem::Requirement
303
+ requirements:
304
+ - - '='
305
+ - !ruby/object:Gem::Version
306
+ version: 3.3.1
307
+ - !ruby/object:Gem::Dependency
308
+ name: i18n
309
+ requirement: !ruby/object:Gem::Requirement
310
+ requirements:
311
+ - - '='
312
+ - !ruby/object:Gem::Version
313
+ version: 0.8.1
314
+ type: :runtime
315
+ prerelease: false
316
+ version_requirements: !ruby/object:Gem::Requirement
317
+ requirements:
318
+ - - '='
319
+ - !ruby/object:Gem::Version
320
+ version: 0.8.1
321
+ - !ruby/object:Gem::Dependency
322
+ name: kaminari-mongoid
323
+ requirement: !ruby/object:Gem::Requirement
324
+ requirements:
325
+ - - ">="
326
+ - !ruby/object:Gem::Version
327
+ version: '0'
328
+ type: :runtime
329
+ prerelease: false
330
+ version_requirements: !ruby/object:Gem::Requirement
331
+ requirements:
332
+ - - ">="
333
+ - !ruby/object:Gem::Version
334
+ version: '0'
335
+ - !ruby/object:Gem::Dependency
336
+ name: kaminari-actionview
337
+ requirement: !ruby/object:Gem::Requirement
338
+ requirements:
339
+ - - ">="
340
+ - !ruby/object:Gem::Version
341
+ version: '0'
342
+ type: :runtime
343
+ prerelease: false
344
+ version_requirements: !ruby/object:Gem::Requirement
345
+ requirements:
346
+ - - ">="
347
+ - !ruby/object:Gem::Version
348
+ version: '0'
349
+ - !ruby/object:Gem::Dependency
350
+ name: googl
351
+ requirement: !ruby/object:Gem::Requirement
352
+ requirements:
353
+ - - ">="
354
+ - !ruby/object:Gem::Version
355
+ version: '0'
356
+ type: :runtime
357
+ prerelease: false
358
+ version_requirements: !ruby/object:Gem::Requirement
359
+ requirements:
360
+ - - ">="
361
+ - !ruby/object:Gem::Version
362
+ version: '0'
363
+ - !ruby/object:Gem::Dependency
364
+ name: sinatra
365
+ requirement: !ruby/object:Gem::Requirement
366
+ requirements:
367
+ - - ">="
368
+ - !ruby/object:Gem::Version
369
+ version: '0'
370
+ type: :runtime
371
+ prerelease: false
372
+ version_requirements: !ruby/object:Gem::Requirement
373
+ requirements:
374
+ - - ">="
375
+ - !ruby/object:Gem::Version
376
+ version: '0'
377
+ - !ruby/object:Gem::Dependency
378
+ name: aws-sdk
379
+ requirement: !ruby/object:Gem::Requirement
380
+ requirements:
381
+ - - "~>"
382
+ - !ruby/object:Gem::Version
383
+ version: '2'
384
+ type: :runtime
385
+ prerelease: false
386
+ version_requirements: !ruby/object:Gem::Requirement
387
+ requirements:
388
+ - - "~>"
389
+ - !ruby/object:Gem::Version
390
+ version: '2'
391
+ - !ruby/object:Gem::Dependency
392
+ name: dotenv-rails
393
+ requirement: !ruby/object:Gem::Requirement
394
+ requirements:
395
+ - - ">="
396
+ - !ruby/object:Gem::Version
397
+ version: '0'
398
+ type: :runtime
399
+ prerelease: false
400
+ version_requirements: !ruby/object:Gem::Requirement
401
+ requirements:
402
+ - - ">="
403
+ - !ruby/object:Gem::Version
404
+ version: '0'
405
+ - !ruby/object:Gem::Dependency
406
+ name: mongoid_versioned_atomic
407
+ requirement: !ruby/object:Gem::Requirement
408
+ requirements:
409
+ - - '='
410
+ - !ruby/object:Gem::Version
411
+ version: 0.0.5
412
+ type: :runtime
413
+ prerelease: false
414
+ version_requirements: !ruby/object:Gem::Requirement
415
+ requirements:
416
+ - - '='
417
+ - !ruby/object:Gem::Version
418
+ version: 0.0.5
419
+ - !ruby/object:Gem::Dependency
420
+ name: wj-jquery-rails
421
+ requirement: !ruby/object:Gem::Requirement
422
+ requirements:
423
+ - - ">="
424
+ - !ruby/object:Gem::Version
425
+ version: 4.2.2.1
426
+ type: :runtime
427
+ prerelease: false
428
+ version_requirements: !ruby/object:Gem::Requirement
429
+ requirements:
430
+ - - ">="
431
+ - !ruby/object:Gem::Version
432
+ version: 4.2.2.1
433
+ - !ruby/object:Gem::Dependency
434
+ name: wj-mailgun-ruby
435
+ requirement: !ruby/object:Gem::Requirement
436
+ requirements:
437
+ - - ">="
438
+ - !ruby/object:Gem::Version
439
+ version: 1.1.7
440
+ type: :runtime
441
+ prerelease: false
442
+ version_requirements: !ruby/object:Gem::Requirement
443
+ requirements:
444
+ - - ">="
445
+ - !ruby/object:Gem::Version
446
+ version: 1.1.7
447
+ - !ruby/object:Gem::Dependency
448
+ name: wj-payuindia
449
+ requirement: !ruby/object:Gem::Requirement
450
+ requirements:
451
+ - - ">="
452
+ - !ruby/object:Gem::Version
453
+ version: 0.1.1
454
+ type: :runtime
455
+ prerelease: false
456
+ version_requirements: !ruby/object:Gem::Requirement
457
+ requirements:
458
+ - - ">="
459
+ - !ruby/object:Gem::Version
460
+ version: 0.1.1
461
+ - !ruby/object:Gem::Dependency
462
+ name: wj-mongoid-elasticsearch
463
+ requirement: !ruby/object:Gem::Requirement
464
+ requirements:
465
+ - - "~>"
466
+ - !ruby/object:Gem::Version
467
+ version: 0.0.1
468
+ type: :runtime
469
+ prerelease: false
470
+ version_requirements: !ruby/object:Gem::Requirement
471
+ requirements:
472
+ - - "~>"
473
+ - !ruby/object:Gem::Version
474
+ version: 0.0.1
475
+ - !ruby/object:Gem::Dependency
476
+ name: faker
477
+ requirement: !ruby/object:Gem::Requirement
478
+ requirements:
479
+ - - ">="
480
+ - !ruby/object:Gem::Version
481
+ version: '0'
482
+ type: :development
483
+ prerelease: false
484
+ version_requirements: !ruby/object:Gem::Requirement
485
+ requirements:
486
+ - - ">="
487
+ - !ruby/object:Gem::Version
488
+ version: '0'
489
+ - !ruby/object:Gem::Dependency
490
+ name: rspec-rails
491
+ requirement: !ruby/object:Gem::Requirement
492
+ requirements:
493
+ - - ">="
494
+ - !ruby/object:Gem::Version
495
+ version: '0'
496
+ type: :development
497
+ prerelease: false
498
+ version_requirements: !ruby/object:Gem::Requirement
499
+ requirements:
500
+ - - ">="
501
+ - !ruby/object:Gem::Version
502
+ version: '0'
503
+ - !ruby/object:Gem::Dependency
504
+ name: capybara
505
+ requirement: !ruby/object:Gem::Requirement
506
+ requirements:
507
+ - - ">="
508
+ - !ruby/object:Gem::Version
509
+ version: '0'
510
+ type: :development
511
+ prerelease: false
512
+ version_requirements: !ruby/object:Gem::Requirement
513
+ requirements:
514
+ - - ">="
515
+ - !ruby/object:Gem::Version
516
+ version: '0'
517
+ - !ruby/object:Gem::Dependency
518
+ name: selenium-webdriver
519
+ requirement: !ruby/object:Gem::Requirement
520
+ requirements:
521
+ - - ">="
522
+ - !ruby/object:Gem::Version
523
+ version: '0'
524
+ type: :development
525
+ prerelease: false
526
+ version_requirements: !ruby/object:Gem::Requirement
527
+ requirements:
528
+ - - ">="
529
+ - !ruby/object:Gem::Version
530
+ version: '0'
531
+ - !ruby/object:Gem::Dependency
532
+ name: capybara-webkit
533
+ requirement: !ruby/object:Gem::Requirement
534
+ requirements:
535
+ - - '='
536
+ - !ruby/object:Gem::Version
537
+ version: 1.14.0
538
+ type: :development
539
+ prerelease: false
540
+ version_requirements: !ruby/object:Gem::Requirement
541
+ requirements:
542
+ - - '='
543
+ - !ruby/object:Gem::Version
544
+ version: 1.14.0
545
+ - !ruby/object:Gem::Dependency
546
+ name: factory_girl_rails
547
+ requirement: !ruby/object:Gem::Requirement
548
+ requirements:
549
+ - - ">="
550
+ - !ruby/object:Gem::Version
551
+ version: '0'
552
+ type: :development
553
+ prerelease: false
554
+ version_requirements: !ruby/object:Gem::Requirement
555
+ requirements:
556
+ - - ">="
557
+ - !ruby/object:Gem::Version
558
+ version: '0'
559
+ description: Simple authentication solution for any rails app.
560
+ email:
561
+ - bhargav.r.raut@gmail.com
562
+ executables: []
563
+ extensions: []
564
+ extra_rdoc_files: []
565
+ files:
566
+ - MIT-LICENSE
567
+ - README.rdoc
568
+ - Rakefile
569
+ - app/assets/images/auth/activity.jpg
570
+ - app/assets/images/auth/facebook.svg
571
+ - app/assets/images/auth/google_oauth2.svg
572
+ - app/assets/images/auth/js_pic3.jpg
573
+ - app/assets/images/auth/profile.jpg
574
+ - app/assets/javascripts/auth/admin_create_users.js
575
+ - app/assets/javascripts/auth/application.js
576
+ - app/assets/javascripts/auth/auth_dependencies.js
577
+ - app/assets/javascripts/auth/auth_modals_and_navbar.js
578
+ - app/assets/javascripts/auth/clients.js
579
+ - app/assets/javascripts/auth/search.js
580
+ - app/assets/javascripts/auth/shopping/discounts.js
581
+ - app/assets/javascripts/auth/users/profiles.js
582
+ - app/assets/stylesheets/auth/admin_create_users.css
583
+ - app/assets/stylesheets/auth/application.scss
584
+ - app/assets/stylesheets/auth/auth_default_css.scss
585
+ - app/assets/stylesheets/auth/common-styles.scss
586
+ - app/assets/stylesheets/auth/overrides.scss
587
+ - app/assets/stylesheets/auth/search.css
588
+ - app/assets/stylesheets/auth/shopping/discounts.css
589
+ - app/assets/stylesheets/auth/users/profiles.scss
590
+ - app/assets/stylesheets/scaffold.css
591
+ - app/controllers/auth/admin_create_users_controller.rb
592
+ - app/controllers/auth/application_controller.rb
593
+ - app/controllers/auth/clients_controller.rb
594
+ - app/controllers/auth/concerns/activity_controller_concern.rb
595
+ - app/controllers/auth/concerns/devise_concern.rb
596
+ - app/controllers/auth/concerns/omni_concern.rb
597
+ - app/controllers/auth/concerns/otp_concern.rb
598
+ - app/controllers/auth/concerns/shopping/cart_controller_concern.rb
599
+ - app/controllers/auth/concerns/shopping/cart_item_controller_concern.rb
600
+ - app/controllers/auth/concerns/shopping/discount_controller_concern.rb
601
+ - app/controllers/auth/concerns/shopping/pay_u_money_controller_concern.rb
602
+ - app/controllers/auth/concerns/shopping/payment_controller_concern.rb
603
+ - app/controllers/auth/concerns/shopping/product_controller_concern.rb
604
+ - app/controllers/auth/concerns/token_concern.rb
605
+ - app/controllers/auth/confirmations_controller.rb
606
+ - app/controllers/auth/mailgun_controller.rb
607
+ - app/controllers/auth/omniauth_callbacks_controller.rb
608
+ - app/controllers/auth/passwords_controller.rb
609
+ - app/controllers/auth/profiles_controller.rb
610
+ - app/controllers/auth/registrations_controller.rb
611
+ - app/controllers/auth/search_controller.rb
612
+ - app/controllers/auth/sessions_controller.rb
613
+ - app/controllers/auth/shopping/cart_items_controller.rb
614
+ - app/controllers/auth/shopping/carts_controller.rb
615
+ - app/controllers/auth/shopping/discounts_controller.rb
616
+ - app/controllers/auth/shopping/payments_controller.rb
617
+ - app/controllers/auth/shopping/products_controller.rb
618
+ - app/controllers/auth/shopping/shopping_controller.rb
619
+ - app/controllers/auth/unlocks_controller.rb
620
+ - app/controllers/auth/webhooks_controller.rb
621
+ - app/helpers/auth/admin_create_users_helper.rb
622
+ - app/helpers/auth/application_helper.rb
623
+ - app/helpers/auth/clients_helper.rb
624
+ - app/helpers/auth/resource_helper.rb
625
+ - app/helpers/auth/search_helper.rb
626
+ - app/helpers/auth/shopping/cart_items/cart_items_helper.rb
627
+ - app/helpers/auth/shopping/carts/carts_helper.rb
628
+ - app/helpers/auth/shopping/discounts/discounts_helper.rb
629
+ - app/helpers/auth/shopping/payments/pay_u_money_helper.rb
630
+ - app/helpers/auth/shopping/payments/payments_helper.rb
631
+ - app/helpers/auth/shopping/products/products_helper.rb
632
+ - app/helpers/auth/shopping/shopping_helper.rb
633
+ - app/helpers/auth/users/profiles_helper.rb
634
+ - app/jobs/otp_job.rb
635
+ - app/mailers/application_mailer.rb
636
+ - app/mailers/auth/notifier.rb
637
+ - app/models/auth/admin_create_user.rb
638
+ - app/models/auth/client.rb
639
+ - app/models/auth/concerns/activity_concern.rb
640
+ - app/models/auth/concerns/chief_model_concern.rb
641
+ - app/models/auth/concerns/es_concern.rb
642
+ - app/models/auth/concerns/notification_concern.rb
643
+ - app/models/auth/concerns/notification_response_concern.rb
644
+ - app/models/auth/concerns/owner_concern.rb
645
+ - app/models/auth/concerns/shopping/cart_concern.rb
646
+ - app/models/auth/concerns/shopping/cart_item_concern.rb
647
+ - app/models/auth/concerns/shopping/discount_concern.rb
648
+ - app/models/auth/concerns/shopping/discount_flow.txt
649
+ - app/models/auth/concerns/shopping/pay_u_money_concern.rb
650
+ - app/models/auth/concerns/shopping/payment_concern.rb
651
+ - app/models/auth/concerns/shopping/product_concern.rb
652
+ - app/models/auth/concerns/sms_otp_concern.rb
653
+ - app/models/auth/concerns/user_concern.rb
654
+ - app/models/auth/identity.rb
655
+ - app/models/auth/shopping/cart.rb
656
+ - app/models/auth/shopping/cart_item.rb
657
+ - app/models/auth/shopping/cart_item_payment_result.rb
658
+ - app/models/auth/shopping/discount.rb
659
+ - app/models/auth/shopping/payment.rb
660
+ - app/models/auth/shopping/product.rb
661
+ - app/models/auth/user.rb
662
+ - app/views/auth/admin_create_users/_admin_actions.html.erb
663
+ - app/views/auth/admin_create_users/_form.html.erb
664
+ - app/views/auth/admin_create_users/edit.html.erb
665
+ - app/views/auth/admin_create_users/index.html.erb
666
+ - app/views/auth/admin_create_users/new.html.erb
667
+ - app/views/auth/admin_create_users/show.html.erb
668
+ - app/views/auth/clients/_form.html.erb
669
+ - app/views/auth/clients/edit.html.erb
670
+ - app/views/auth/clients/index.html.erb
671
+ - app/views/auth/clients/new.html.erb
672
+ - app/views/auth/clients/show.html.erb
673
+ - app/views/auth/confirmations/_enter_otp.html.erb
674
+ - app/views/auth/confirmations/_get_otp_status.html.erb
675
+ - app/views/auth/confirmations/_new_otp_input.js.erb
676
+ - app/views/auth/confirmations/_resend_otp.js.erb
677
+ - app/views/auth/confirmations/_resend_sms_otp.html.erb
678
+ - app/views/auth/confirmations/_verify_otp.js.erb
679
+ - app/views/auth/confirmations/create.js.erb
680
+ - app/views/auth/confirmations/enter_otp.html.erb
681
+ - app/views/auth/confirmations/get_otp_status.html.erb
682
+ - app/views/auth/confirmations/new.html.erb
683
+ - app/views/auth/confirmations/new.js.erb
684
+ - app/views/auth/confirmations/otp_status_result.html.erb
685
+ - app/views/auth/mailer/confirmation_instructions.html.erb
686
+ - app/views/auth/mailer/password_change.html.erb
687
+ - app/views/auth/mailer/reset_password_instructions.html.erb
688
+ - app/views/auth/mailer/unlock_instructions.html.erb
689
+ - app/views/auth/modals/_ajax_error_modal.html.erb
690
+ - app/views/auth/modals/_ajax_error_modal_content.html.erb
691
+ - app/views/auth/modals/_edit_account_content.html.erb
692
+ - app/views/auth/modals/_edit_account_success_content.html.erb
693
+ - app/views/auth/modals/_error_notification.html.erb
694
+ - app/views/auth/modals/_forgot_password_content.html.erb
695
+ - app/views/auth/modals/_forgot_password_success_content.html.erb
696
+ - app/views/auth/modals/_login_default_content.html.erb
697
+ - app/views/auth/modals/_login_forms.html.erb
698
+ - app/views/auth/modals/_login_navigation_options.html.erb
699
+ - app/views/auth/modals/_new_otp_input.html.erb
700
+ - app/views/auth/modals/_oauth_and_submit.html.erb
701
+ - app/views/auth/modals/_recaptcha_tags.html.erb
702
+ - app/views/auth/modals/_resend_confirmation_content.html.erb
703
+ - app/views/auth/modals/_resend_confirmation_success_content.html.erb
704
+ - app/views/auth/modals/_resend_otp.html.erb
705
+ - app/views/auth/modals/_resource_errors.js.erb
706
+ - app/views/auth/modals/_sign_in_inputs.html.erb
707
+ - app/views/auth/modals/_sign_in_needed_modal.html.erb
708
+ - app/views/auth/modals/_sign_in_success_content.html.erb
709
+ - app/views/auth/modals/_sign_up_inputs.html.erb
710
+ - app/views/auth/modals/_sign_up_success_content.html.erb
711
+ - app/views/auth/modals/_sign_up_success_inactive_content.html.erb
712
+ - app/views/auth/modals/_unlock_content.html.erb
713
+ - app/views/auth/modals/_verify_otp.html.erb
714
+ - app/views/auth/modals/base_modal/_base.html.erb
715
+ - app/views/auth/modals/login.js.erb
716
+ - app/views/auth/modals/unlock_success_content.html.erb
717
+ - app/views/auth/notifier/_email.html.erb
718
+ - app/views/auth/notifier/notification.html.erb
719
+ - app/views/auth/notifier/notification.text.erb
720
+ - app/views/auth/omniauth_callbacks/failure.html.erb
721
+ - app/views/auth/passwords/create.js.erb
722
+ - app/views/auth/passwords/edit.html.erb
723
+ - app/views/auth/passwords/new.html.erb
724
+ - app/views/auth/passwords/new.js.erb
725
+ - app/views/auth/profiles/_proxy_resource.html.erb
726
+ - app/views/auth/profiles/set_proxy_resource.js.erb
727
+ - app/views/auth/profiles/show.html.erb
728
+ - app/views/auth/registrations/create.js.erb
729
+ - app/views/auth/registrations/edit.html.erb
730
+ - app/views/auth/registrations/edit.js.erb
731
+ - app/views/auth/registrations/new.html.erb
732
+ - app/views/auth/registrations/update.js.erb
733
+ - app/views/auth/search/_search_bar.html.erb
734
+ - app/views/auth/search/_search_result.html.erb
735
+ - app/views/auth/search/_search_results.html.erb
736
+ - app/views/auth/search/authenticated_user_search.js.erb
737
+ - app/views/auth/search/authenticated_user_search.json
738
+ - app/views/auth/sessions/create.js.erb
739
+ - app/views/auth/sessions/new.html.erb
740
+ - app/views/auth/sessions/new.js.erb
741
+ - app/views/auth/shared/_devise_error_messages.html.erb
742
+ - app/views/auth/shared/_links.html.erb
743
+ - app/views/auth/shared/_object_errors.html.erb
744
+ - app/views/auth/shared/_proxy_resource.html.erb
745
+ - app/views/auth/shopping/cart_items/_form.html.erb
746
+ - app/views/auth/shopping/cart_items/_show_cart_items_collection.html.erb
747
+ - app/views/auth/shopping/cart_items/create_multiple.html.erb
748
+ - app/views/auth/shopping/cart_items/create_multiple.json.erb
749
+ - app/views/auth/shopping/cart_items/edit.html.erb
750
+ - app/views/auth/shopping/cart_items/index.html.erb
751
+ - app/views/auth/shopping/cart_items/new.html.erb
752
+ - app/views/auth/shopping/cart_items/show.html.erb
753
+ - app/views/auth/shopping/carts/_form.html.erb
754
+ - app/views/auth/shopping/carts/_payment_links.html.erb
755
+ - app/views/auth/shopping/carts/_remove_cart_item.html.erb
756
+ - app/views/auth/shopping/carts/_show_cart_balance_info.html.erb
757
+ - app/views/auth/shopping/carts/edit.html.erb
758
+ - app/views/auth/shopping/carts/index.html.erb
759
+ - app/views/auth/shopping/carts/new.html.erb
760
+ - app/views/auth/shopping/carts/show.html.erb
761
+ - app/views/auth/shopping/discounts/_form.html.erb
762
+ - app/views/auth/shopping/discounts/_form_for_create_multiple_cart_items.html.erb
763
+ - app/views/auth/shopping/discounts/_show_pending_discount_request.html.erb
764
+ - app/views/auth/shopping/discounts/destroy.html.erb
765
+ - app/views/auth/shopping/discounts/edit.html.erb
766
+ - app/views/auth/shopping/discounts/index.html.erb
767
+ - app/views/auth/shopping/discounts/new.html.erb
768
+ - app/views/auth/shopping/discounts/show.html.erb
769
+ - app/views/auth/shopping/discounts/update.html.erb
770
+ - app/views/auth/shopping/payments/_approve_payment.html.erb
771
+ - app/views/auth/shopping/payments/_cash_card_cheque.html.erb
772
+ - app/views/auth/shopping/payments/_create_discount_coupon.html.erb
773
+ - app/views/auth/shopping/payments/_form.html.erb
774
+ - app/views/auth/shopping/payments/_gateway.html.erb
775
+ - app/views/auth/shopping/payments/_proceed_to_gateway_or_verify_payment.html.erb
776
+ - app/views/auth/shopping/payments/_refresh_payment.html.erb
777
+ - app/views/auth/shopping/payments/_refund.html.erb
778
+ - app/views/auth/shopping/payments/_show_payment_receipt.html.erb
779
+ - app/views/auth/shopping/payments/edit.html.erb
780
+ - app/views/auth/shopping/payments/index.html.erb
781
+ - app/views/auth/shopping/payments/new.html.erb
782
+ - app/views/auth/shopping/payments/show.html.erb
783
+ - app/views/auth/shopping/products/_form.html.erb
784
+ - app/views/auth/shopping/products/edit.html.erb
785
+ - app/views/auth/shopping/products/index.html.erb
786
+ - app/views/auth/shopping/products/index.json.erb
787
+ - app/views/auth/shopping/products/new.html.erb
788
+ - app/views/auth/shopping/products/show.html.erb
789
+ - app/views/auth/shopping/products/show.json.erb
790
+ - app/views/auth/unlocks/create.js.erb
791
+ - app/views/auth/unlocks/new.html.erb
792
+ - app/views/auth/unlocks/new.js.erb
793
+ - app/views/auth/users/_search_result.html.erb
794
+ - app/views/auth/users/profiles/_user_data.html.erb
795
+ - app/views/auth/users/profiles/show.html.erb
796
+ - app/views/layouts/auth/_modals.html.erb
797
+ - app/views/layouts/auth/application.html.erb
798
+ - app/views/layouts/auth/navbar/_navbar.html.erb
799
+ - app/views/layouts/auth/navbar/_personalization.html.erb
800
+ - app/views/layouts/auth/navbar/_progress_spinner.html.erb
801
+ - app/views/layouts/mailer.html.erb
802
+ - app/views/layouts/mailer.text.erb
803
+ - config/initializers/active_model.rb
804
+ - config/initializers/devise.rb
805
+ - config/initializers/json.rb
806
+ - config/initializers/omniauth.rb
807
+ - config/initializers/redis.rb
808
+ - config/initializers/redis.yml
809
+ - config/locales/devise.en.yml
810
+ - config/routes.rb
811
+ - lib/assets/javascripts/data.js
812
+ - lib/assets/javascripts/jquery.calendario.js
813
+ - lib/assets/javascripts/jquery.tagcloud.js
814
+ - lib/assets/javascripts/leanModal.js
815
+ - lib/assets/javascripts/main.js
816
+ - lib/assets/javascripts/modernizr.custom.63321.js
817
+ - lib/assets/javascripts/payumoney.js
818
+ - lib/assets/javascripts/search.js
819
+ - lib/assets/javascripts/spinner.js
820
+ - lib/assets/javascripts/trianglify.min.js
821
+ - lib/assets/javascripts/you_need_to_sign_in.js.erb
822
+ - lib/assets/stylesheets/calendar.css
823
+ - lib/assets/stylesheets/calendar_modifications.scss
824
+ - lib/auth.rb
825
+ - lib/auth/custom_failure.rb
826
+ - lib/auth/engine.rb
827
+ - lib/auth/job_exception_handler.rb
828
+ - lib/auth/mailgun.rb
829
+ - lib/auth/notify.rb
830
+ - lib/auth/omniauth/path.rb
831
+ - lib/auth/partials.rb
832
+ - lib/auth/rails/routes.rb
833
+ - lib/auth/search/main.rb
834
+ - lib/auth/sidekiq_up.rb
835
+ - lib/auth/two_factor_otp.rb
836
+ - lib/auth/url_shortener.rb
837
+ - lib/auth/version.rb
838
+ - lib/tasks/auth_tasks.rake
839
+ homepage: http://github.com/wordjelly/auth
840
+ licenses:
841
+ - MIT
842
+ metadata: {}
843
+ post_install_message:
844
+ rdoc_options: []
845
+ require_paths:
846
+ - lib
847
+ required_ruby_version: !ruby/object:Gem::Requirement
848
+ requirements:
849
+ - - ">="
850
+ - !ruby/object:Gem::Version
851
+ version: '0'
852
+ required_rubygems_version: !ruby/object:Gem::Requirement
853
+ requirements:
854
+ - - ">="
855
+ - !ruby/object:Gem::Version
856
+ version: '0'
857
+ requirements: []
858
+ rubyforge_project:
859
+ rubygems_version: 2.2.5
860
+ signing_key:
861
+ specification_version: 4
862
+ summary: Authentication engine, bundles mongoid, devise, and token authentication
863
+ test_files: []