arcadex 1.1.3 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. checksums.yaml +4 -4
  2. data/db/migrate/20141020173616_add_max_uses_to_arcadex_tokens.rb +5 -0
  3. data/lib/arcadex/authentication.rb +45 -51
  4. data/lib/arcadex/create.rb +2 -1
  5. data/lib/arcadex/header.rb +8 -21
  6. data/lib/arcadex/version.rb +1 -1
  7. data/test/dummy/db/development.sqlite3 +0 -0
  8. data/test/dummy/db/schema.rb +2 -1
  9. data/test/dummy/db/test.sqlite3 +0 -0
  10. data/test/dummy/log/development.log +15 -0
  11. data/test/dummy/log/test.log +35 -0
  12. data/test/test_app/Gemfile +77 -0
  13. data/test/test_app/Gemfile.lock +281 -0
  14. data/test/test_app/README.md +1 -0
  15. data/test/test_app/Rakefile +6 -0
  16. data/test/test_app/app/admin/arcadex_token.rb +94 -0
  17. data/test/test_app/app/admin/dashboard.rb +69 -0
  18. data/test/test_app/app/admin/defcon_admin_user.rb +99 -0
  19. data/test/test_app/app/admin/people_user.rb +83 -0
  20. data/test/test_app/app/assets/javascripts/active_admin.js.coffee +1 -0
  21. data/test/test_app/app/assets/javascripts/application.js +16 -0
  22. data/test/test_app/app/assets/stylesheets/active_admin.css.scss +17 -0
  23. data/test/test_app/app/assets/stylesheets/application.css +13 -0
  24. data/test/test_app/app/controllers/api/v1/api_controller.rb +71 -0
  25. data/test/test_app/app/controllers/app_index_controller.rb +4 -0
  26. data/test/test_app/app/controllers/application_controller.rb +21 -0
  27. data/test/test_app/app/helpers/application_helper.rb +2 -0
  28. data/test/test_app/app/views/app_index/app.html.erb +0 -0
  29. data/test/test_app/app/views/layouts/app_index.html.erb +9 -0
  30. data/test/test_app/app/views/layouts/application.html.erb +14 -0
  31. data/test/test_app/bin/bundle +3 -0
  32. data/test/test_app/bin/rails +4 -0
  33. data/test/test_app/bin/rake +4 -0
  34. data/test/test_app/config.ru +4 -0
  35. data/test/test_app/config/application.rb +27 -0
  36. data/test/test_app/config/boot.rb +4 -0
  37. data/test/test_app/config/database.yml +25 -0
  38. data/test/test_app/config/environment.rb +5 -0
  39. data/test/test_app/config/environments/development.rb +29 -0
  40. data/test/test_app/config/environments/production.rb +80 -0
  41. data/test/test_app/config/environments/test.rb +36 -0
  42. data/test/test_app/config/initializers/active_admin.rb +252 -0
  43. data/test/test_app/config/initializers/backtrace_silencers.rb +7 -0
  44. data/test/test_app/config/initializers/filter_parameter_logging.rb +4 -0
  45. data/test/test_app/config/initializers/inflections.rb +16 -0
  46. data/test/test_app/config/initializers/mime_types.rb +5 -0
  47. data/test/test_app/config/initializers/secret_token.rb +12 -0
  48. data/test/test_app/config/initializers/session_store.rb +3 -0
  49. data/test/test_app/config/initializers/wrap_parameters.rb +14 -0
  50. data/test/test_app/config/locales/en.yml +23 -0
  51. data/test/test_app/config/routes.rb +66 -0
  52. data/test/test_app/config/schedule.rb +20 -0
  53. data/test/test_app/db/development.sqlite3 +0 -0
  54. data/test/test_app/db/migrate/20141016225515_create_active_admin_comments.rb +19 -0
  55. data/test/test_app/db/migrate/20141016225555_create_people_users.people.rb +14 -0
  56. data/test/test_app/db/migrate/20141016225556_create_arcadex_tokens.arcadex.rb +12 -0
  57. data/test/test_app/db/migrate/20141016225557_add_index_to_token.arcadex.rb +6 -0
  58. data/test/test_app/db/migrate/20141016225558_add_first_ip_address_to_arcadex_tokens.arcadex.rb +6 -0
  59. data/test/test_app/db/migrate/20141016225559_add_current_ip_address_to_arcadex_tokens.arcadex.rb +6 -0
  60. data/test/test_app/db/migrate/20141016225560_add_times_used_to_arcadex_tokens.arcadex.rb +6 -0
  61. data/test/test_app/db/migrate/20141016225561_add_expiration_minutes_to_arcadex_tokens.arcadex.rb +6 -0
  62. data/test/test_app/db/migrate/20141016225562_create_defcon_admin_users.defcon.rb +16 -0
  63. data/test/test_app/db/migrate/20141016225563_add_index_to_defcon_admin_users.defcon.rb +6 -0
  64. data/test/test_app/db/migrate/20141016225564_add_email_to_defcon_admin_users.defcon.rb +7 -0
  65. data/test/test_app/db/migrate/20141020173805_add_max_uses_to_arcadex_tokens.arcadex.rb +6 -0
  66. data/test/test_app/db/production.sqlite3 +0 -0
  67. data/test/test_app/db/schema.rb +73 -0
  68. data/test/test_app/db/seeds.rb +10 -0
  69. data/test/test_app/db/test.sqlite3 +0 -0
  70. data/test/test_app/engines/people/Gemfile +14 -0
  71. data/test/test_app/engines/people/Gemfile.lock +81 -0
  72. data/test/test_app/engines/people/MIT-LICENSE +20 -0
  73. data/test/test_app/engines/people/README.md +1 -0
  74. data/test/test_app/engines/people/Rakefile +34 -0
  75. data/test/test_app/engines/people/app/assets/javascripts/people/application.js +13 -0
  76. data/test/test_app/engines/people/app/assets/javascripts/people/users.js +2 -0
  77. data/test/test_app/engines/people/app/assets/stylesheets/people/application.css +13 -0
  78. data/test/test_app/engines/people/app/assets/stylesheets/people/users.css +4 -0
  79. data/test/test_app/engines/people/app/assets/stylesheets/scaffold.css +56 -0
  80. data/test/test_app/engines/people/app/controllers/people/api/v1/application_controller.rb +5 -0
  81. data/test/test_app/engines/people/app/controllers/people/api/v1/users_controller.rb +169 -0
  82. data/test/test_app/engines/people/app/controllers/people/application_controller.rb +4 -0
  83. data/test/test_app/engines/people/app/controllers/people/users_controller.rb +62 -0
  84. data/test/test_app/engines/people/app/helpers/people/application_helper.rb +4 -0
  85. data/test/test_app/engines/people/app/helpers/people/users_helper.rb +4 -0
  86. data/test/test_app/engines/people/app/models/people/user.rb +9 -0
  87. data/test/test_app/engines/people/app/models/people/v1/user.rb +32 -0
  88. data/test/test_app/engines/people/app/serializers/people/v1/user_serializer.rb +43 -0
  89. data/test/test_app/engines/people/app/views/layouts/people/default/application.html.erb +14 -0
  90. data/test/test_app/engines/people/app/views/people/users/_form.html.erb +29 -0
  91. data/test/test_app/engines/people/app/views/people/users/edit.html.erb +6 -0
  92. data/test/test_app/engines/people/app/views/people/users/index.html.erb +31 -0
  93. data/test/test_app/engines/people/app/views/people/users/new.html.erb +5 -0
  94. data/test/test_app/engines/people/app/views/people/users/show.html.erb +19 -0
  95. data/test/test_app/engines/people/bin/rails +12 -0
  96. data/test/test_app/engines/people/config/routes.rb +28 -0
  97. data/test/test_app/engines/people/db/migrate/20141016225548_create_people_users.rb +13 -0
  98. data/test/test_app/engines/people/lib/people.rb +4 -0
  99. data/test/test_app/engines/people/lib/people/engine.rb +5 -0
  100. data/test/test_app/engines/people/lib/people/version.rb +3 -0
  101. data/test/test_app/engines/people/lib/tasks/people_tasks.rake +4 -0
  102. data/test/test_app/engines/people/people.gemspec +33 -0
  103. data/test/test_app/engines/people/test/controllers/people/users_controller_test.rb +51 -0
  104. data/test/test_app/engines/people/test/dummy/README.rdoc +28 -0
  105. data/test/test_app/engines/people/test/dummy/Rakefile +6 -0
  106. data/test/test_app/engines/people/test/dummy/app/assets/javascripts/application.js +13 -0
  107. data/test/test_app/engines/people/test/dummy/app/assets/stylesheets/application.css +13 -0
  108. data/test/test_app/engines/people/test/dummy/app/controllers/application_controller.rb +5 -0
  109. data/test/test_app/engines/people/test/dummy/app/helpers/application_helper.rb +2 -0
  110. data/test/test_app/engines/people/test/dummy/app/views/layouts/application.html.erb +14 -0
  111. data/test/test_app/engines/people/test/dummy/bin/bundle +3 -0
  112. data/test/test_app/engines/people/test/dummy/bin/rails +4 -0
  113. data/test/test_app/engines/people/test/dummy/bin/rake +4 -0
  114. data/test/test_app/engines/people/test/dummy/config.ru +4 -0
  115. data/test/test_app/engines/people/test/dummy/config/application.rb +23 -0
  116. data/test/test_app/engines/people/test/dummy/config/boot.rb +5 -0
  117. data/test/test_app/engines/people/test/dummy/config/database.yml +25 -0
  118. data/test/test_app/engines/people/test/dummy/config/environment.rb +5 -0
  119. data/test/test_app/engines/people/test/dummy/config/environments/development.rb +29 -0
  120. data/test/test_app/engines/people/test/dummy/config/environments/production.rb +80 -0
  121. data/test/test_app/engines/people/test/dummy/config/environments/test.rb +36 -0
  122. data/test/test_app/engines/people/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  123. data/test/test_app/engines/people/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  124. data/test/test_app/engines/people/test/dummy/config/initializers/inflections.rb +16 -0
  125. data/test/test_app/engines/people/test/dummy/config/initializers/mime_types.rb +5 -0
  126. data/test/test_app/engines/people/test/dummy/config/initializers/secret_token.rb +12 -0
  127. data/test/test_app/engines/people/test/dummy/config/initializers/session_store.rb +3 -0
  128. data/test/test_app/engines/people/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  129. data/test/test_app/engines/people/test/dummy/config/locales/en.yml +23 -0
  130. data/test/test_app/engines/people/test/dummy/config/routes.rb +4 -0
  131. data/test/test_app/engines/people/test/dummy/public/404.html +58 -0
  132. data/test/test_app/engines/people/test/dummy/public/422.html +58 -0
  133. data/test/test_app/engines/people/test/dummy/public/500.html +57 -0
  134. data/test/test_app/engines/people/test/dummy/public/favicon.ico +0 -0
  135. data/test/test_app/engines/people/test/fixtures/people/users.yml +11 -0
  136. data/test/test_app/engines/people/test/helpers/people/users_helper_test.rb +6 -0
  137. data/test/test_app/engines/people/test/integration/navigation_test.rb +10 -0
  138. data/test/test_app/engines/people/test/models/people/user_test.rb +9 -0
  139. data/test/test_app/engines/people/test/people_test.rb +7 -0
  140. data/test/test_app/engines/people/test/test_helper.rb +15 -0
  141. data/test/test_app/gems/authorization/Gemfile +14 -0
  142. data/test/test_app/gems/authorization/Gemfile.lock +81 -0
  143. data/test/test_app/gems/authorization/MIT-LICENSE +20 -0
  144. data/test/test_app/gems/authorization/README.rdoc +3 -0
  145. data/test/test_app/gems/authorization/Rakefile +32 -0
  146. data/test/test_app/gems/authorization/authorization.gemspec +22 -0
  147. data/test/test_app/gems/authorization/lib/authorization.rb +4 -0
  148. data/test/test_app/gems/authorization/lib/authorization/people/v1/user.rb +90 -0
  149. data/test/test_app/gems/authorization/lib/authorization/version.rb +3 -0
  150. data/test/test_app/gems/authorization/lib/tasks/authorization_tasks.rake +4 -0
  151. data/test/test_app/gems/authorization/test/authorization_test.rb +7 -0
  152. data/test/test_app/gems/authorization/test/dummy/README.rdoc +28 -0
  153. data/test/test_app/gems/authorization/test/dummy/Rakefile +6 -0
  154. data/test/test_app/gems/authorization/test/dummy/app/assets/javascripts/application.js +13 -0
  155. data/test/test_app/gems/authorization/test/dummy/app/assets/stylesheets/application.css +13 -0
  156. data/test/test_app/gems/authorization/test/dummy/app/controllers/application_controller.rb +5 -0
  157. data/test/test_app/gems/authorization/test/dummy/app/helpers/application_helper.rb +2 -0
  158. data/test/test_app/gems/authorization/test/dummy/app/views/layouts/application.html.erb +14 -0
  159. data/test/test_app/gems/authorization/test/dummy/bin/bundle +3 -0
  160. data/test/test_app/gems/authorization/test/dummy/bin/rails +4 -0
  161. data/test/test_app/gems/authorization/test/dummy/bin/rake +4 -0
  162. data/test/test_app/gems/authorization/test/dummy/config.ru +4 -0
  163. data/test/test_app/gems/authorization/test/dummy/config/application.rb +23 -0
  164. data/test/test_app/gems/authorization/test/dummy/config/boot.rb +5 -0
  165. data/test/test_app/gems/authorization/test/dummy/config/database.yml +25 -0
  166. data/test/test_app/gems/authorization/test/dummy/config/environment.rb +5 -0
  167. data/test/test_app/gems/authorization/test/dummy/config/environments/development.rb +29 -0
  168. data/test/test_app/gems/authorization/test/dummy/config/environments/production.rb +80 -0
  169. data/test/test_app/gems/authorization/test/dummy/config/environments/test.rb +36 -0
  170. data/test/test_app/gems/authorization/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
  171. data/test/test_app/gems/authorization/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  172. data/test/test_app/gems/authorization/test/dummy/config/initializers/inflections.rb +16 -0
  173. data/test/test_app/gems/authorization/test/dummy/config/initializers/mime_types.rb +5 -0
  174. data/test/test_app/gems/authorization/test/dummy/config/initializers/secret_token.rb +12 -0
  175. data/test/test_app/gems/authorization/test/dummy/config/initializers/session_store.rb +3 -0
  176. data/test/test_app/gems/authorization/test/dummy/config/initializers/wrap_parameters.rb +14 -0
  177. data/test/test_app/gems/authorization/test/dummy/config/locales/en.yml +23 -0
  178. data/test/test_app/gems/authorization/test/dummy/config/routes.rb +56 -0
  179. data/test/test_app/gems/authorization/test/dummy/public/404.html +58 -0
  180. data/test/test_app/gems/authorization/test/dummy/public/422.html +58 -0
  181. data/test/test_app/gems/authorization/test/dummy/public/500.html +57 -0
  182. data/test/test_app/gems/authorization/test/dummy/public/favicon.ico +0 -0
  183. data/test/test_app/gems/authorization/test/test_helper.rb +15 -0
  184. data/test/test_app/log/development.log +79 -0
  185. data/test/test_app/log/production.log +12 -0
  186. data/test/test_app/log/test.log +13884 -0
  187. data/test/test_app/public/404.html +58 -0
  188. data/test/test_app/public/422.html +58 -0
  189. data/test/test_app/public/500.html +57 -0
  190. data/test/test_app/public/favicon.ico +0 -0
  191. data/test/test_app/public/robots.txt +5 -0
  192. data/test/test_app/spec/controllers/app_index_controller_spec.rb +12 -0
  193. data/test/test_app/spec/engines/people/api/v1/models/user_spec.rb +61 -0
  194. data/test/test_app/spec/engines/people/api/v1/requests/user_spec.rb +244 -0
  195. data/test/test_app/spec/engines/people/api/v1/routing/user_spec.rb +91 -0
  196. data/test/test_app/spec/factories/people_user_1_factory.rb +14 -0
  197. data/test/test_app/spec/rails_helper.rb +47 -0
  198. data/test/test_app/spec/spec_helper.rb +78 -0
  199. data/test/test_app/spec/support/factory_girl.rb +16 -0
  200. data/test/test_app/spec/support/request_helpers.rb +7 -0
  201. metadata +381 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1ec7073c253adca8cc8ec774ba547f92445aa53f
4
- data.tar.gz: cca41f30ff491f5d68634875576c13d9685d9102
3
+ metadata.gz: 08653438dc3f283525e507f24af8f06306f14f22
4
+ data.tar.gz: efd18717b4d8a29d2f5055f5fac4a8aa48d3afcf
5
5
  SHA512:
6
- metadata.gz: 51ee5ab1c6b330e45f4e4dfb8b99fb0bde274d2ed8ed30db42202fcc192721e5db55b3a6b8877ab9a27a1e01dd3c40691e2821776eab1803be2c90fef5837366
7
- data.tar.gz: 81a389475ef540c380c864e8547115570535a7faf7ccd1c7c7bf3a617f1cc3996017de2c7fae7cdebb0a1173842eb39021263eaa842729695e4509349f3badcc
6
+ metadata.gz: 63961c7a9793f9d04162b67d454221b1e63b49c8838ad973ad31e67a6da584c2bd301cfcae24d140390cfdf1ad0692875a4a38ac9d7d5918056ff4e492401441
7
+ data.tar.gz: cff8b2bf4cb36663cc15609dc049f6f3dccb8e9428facebc4cdecce9b47a94cd93ac99390b57eb2e74acbe2f8dac43d18f5e01b76c8bd1a1b1ae351249d984d0
@@ -0,0 +1,5 @@
1
+ class AddMaxUsesToArcadexTokens < ActiveRecord::Migration
2
+ def change
3
+ add_column :arcadex_tokens, :max_uses, :integer
4
+ end
5
+ end
@@ -3,67 +3,61 @@ module Arcadex
3
3
 
4
4
  ################Below are authentication methods###########################
5
5
  ############This should be called by the user##############################
6
- def self.full_authentication(params,request,should_use_email)
7
- auth_token = ::Arcadex::Header.grab_token(params,request)
8
- email = ::Arcadex::Header.grab_email(params,request)
9
- instance_hash = nil;
10
- if should_use_email
11
- instance_hash = ::Arcadex::Authentication.authenticate_with_email_token(auth_token,email)
12
- else
13
- instance_hash = ::Arcadex::Authentication.authenticate_with_only_token(auth_token)
6
+ def self.authenticate_owner_with_index(params,request,auth_key,index_key,index_attr)
7
+ instance_hash = ::Arcadex::Authentication.get_instance(params,request,auth_key)
8
+ index = ::Arcadex::Header.grab_param_header(params,request,index_key)
9
+ if instance_hash.nil? || index.nil?
10
+ return nil
14
11
  end
15
- if instance_hash.nil?
12
+ token = instance_hash["current_token"]
13
+ owner = instance_hash["current_owner"]
14
+ owner_from_index = ::Object.const_get(token.imageable_type).find_by(index_attr.to_sym => index)
15
+ if owner_from_index.nil?
16
+ return nil
17
+ end
18
+ if owner.id != owner_from_index.id
16
19
  return nil
17
- else
18
- token = instance_hash["current_token"]
19
- if token.first_ip_address.nil?
20
- token.first_ip_address = request.remote_ip
21
- end
22
- token.current_ip_address = request.remote_ip
23
- if token.times_used.nil?
24
- token.times_used = 0;
25
- end
26
- token.times_used = token.times_used + 1
27
- token.save
28
- return instance_hash
29
20
  end
21
+ return instance_hash
30
22
  end
31
23
 
32
- #This should be used in the application_controller before all actions
33
- def self.authenticate_with_email_token(auth_token,email)
34
- #Find token from auth_token and owner from token
35
- token = ::Arcadex::Find.find_token_by_auth_token(auth_token)
24
+ #Returns the object that is mapped to the key. The key is in the params or heaaders
25
+ def self.get_instance(params,request,key)
26
+ auth_token = ::Arcadex::Header.grab_param_header(params,request,key)
27
+ if auth_token.nil?
28
+ return nil
29
+ end
30
+ token = ::Arcadex::Find.find_token_by_auth_token(auth_token)
36
31
  owner = ::Arcadex::Find.find_owner_by_token(token)
37
- #This assumes that the owner of the token is indeed a user
38
- if !token.nil?
39
- user = ::Object.const_get(token.imageable_type).find_by(email: email)
40
- #user = ::People::User.find_by(email: email)
41
- end
42
- #This is to mitigate timing attacks
32
+ #This is to mitigate timing attacks
43
33
  ::Devise.secure_compare(auth_token,auth_token)
44
- if owner.nil? || user.nil? || user.id != owner.id
45
- return nil
46
- else
47
- #These are the variables available to every controller that inherits
48
- instance_hash = {"current_user" => owner, "current_token" => token}
49
- return instance_hash
34
+ if token.nil? || owner.nil?
35
+ return nil
50
36
  end
37
+ if !::Arcadex::Authentication.update_token(token,request)
38
+ return nil
39
+ end
40
+ instance_hash = {"current_owner" => owner, "current_token" => token}
41
+ return instance_hash
51
42
  end
52
43
 
53
- #This should be used in the application_controller before all actions
54
- def self.authenticate_with_only_token(auth_token)
55
- #Find token from auth_token and owner from token
56
- token = ::Arcadex::Find.find_token_by_auth_token(auth_token)
57
- owner = ::Arcadex::Find.find_owner_by_token(token)
58
- #This is to mitigate timing attacks
59
- ::Devise.secure_compare(auth_token,auth_token)
60
- if owner.nil?
61
- return nil
62
- else
63
- #These are the variables available to every controller that inherits
64
- instance_hash = {"current_user" => owner, "current_token" => token}
65
- return instance_hash
66
- end
44
+ def self.update_token(token,request)
45
+ if token.first_ip_address.nil?
46
+ token.first_ip_address = request.remote_ip
47
+ end
48
+ token.current_ip_address = request.remote_ip
49
+ if token.times_used.nil?
50
+ token.times_used = 0;
51
+ end
52
+ token.times_used = token.times_used + 1
53
+ if !token.max_uses.nil?
54
+ if token.max_uses > token.times_used
55
+ ::Arcadex::Authentication.destroy_token(token)
56
+ return false
57
+ end
58
+ end
59
+ token.save
60
+ return true
67
61
  end
68
62
 
69
63
  end
@@ -11,11 +11,12 @@ module Arcadex
11
11
 
12
12
  #Arcadex.create_token(instance.tokens.new,exp_minutes,request)
13
13
  #Put any token in here to set it's values. Usually when its first created
14
- def self.set_token(token,exp_minutes,request)
14
+ def self.set_token(token,exp_minutes,request,max_uses)
15
15
  token.first_ip_address = request.remote_ip
16
16
  token.current_ip_address = request.remote_ip
17
17
  token.times_used = 0
18
18
  token.expiration_minutes = exp_minutes
19
+ token.max_uses = max_uses
19
20
  token.save
20
21
  return token
21
22
  end
@@ -1,29 +1,16 @@
1
1
  module Arcadex
2
2
  module Header
3
3
 
4
- #Gets the auth_token from either the url or header
5
- def self.grab_token(params,request)
6
- #Header token has preference
7
- if !params["auth_token"].blank?
8
- auth_token = params["auth_token"]
4
+ def self.grab_param_header(params,request,key)
5
+ #Values in the headers have preference
6
+ if !params[key].blank?
7
+ value = params[key]
9
8
  end
10
- if !request.headers["Auth-Token"].blank?
11
- auth_token = request.headers["Auth-Token"]
9
+ if !request.headers[key].blank?
10
+ value = request.headers[key]
12
11
  end
13
- return auth_token
14
- end
15
-
16
- #Gets the email from either the url or header
17
- def self.grab_email(params,request)
18
- #Header email has preference
19
- if !params["email"].blank?
20
- email = params["email"]
21
- end
22
- if !request.headers["Email"].blank?
23
- email = request.headers["Email"]
24
- end
25
- return email
26
- end
12
+ return value
13
+ end
27
14
 
28
15
  end
29
16
  end
@@ -1,3 +1,3 @@
1
1
  module Arcadex
2
- VERSION = "1.1.3"
2
+ VERSION = "1.2.0"
3
3
  end
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20140910215147) do
14
+ ActiveRecord::Schema.define(version: 20141020173616) do
15
15
 
16
16
  create_table "arcadex_tokens", force: true do |t|
17
17
  t.integer "imageable_id"
@@ -23,6 +23,7 @@ ActiveRecord::Schema.define(version: 20140910215147) do
23
23
  t.string "current_ip_address"
24
24
  t.integer "times_used"
25
25
  t.integer "expiration_minutes"
26
+ t.integer "max_uses"
26
27
  end
27
28
 
28
29
  add_index "arcadex_tokens", ["auth_token"], name: "index_arcadex_tokens_on_auth_token", unique: true
Binary file
@@ -43,4 +43,19 @@ Migrating to AddExpirationMinutesToArcadexTokens (20140910215147)
43
43
  SELECT sql
44
44
  FROM sqlite_temp_master
45
45
  WHERE name='index_arcadex_tokens_on_auth_token' AND type='index'
46
+ 
47
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
48
+ Migrating to AddMaxUsesToArcadexTokens (20141020173616)
49
+  (0.1ms) begin transaction
50
+  (18.7ms) ALTER TABLE "arcadex_tokens" ADD "max_uses" integer
51
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141020173616"]]
52
+  (121.5ms) commit transaction
53
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
54
+  (0.1ms)  SELECT sql
55
+ FROM sqlite_master
56
+ WHERE name='index_arcadex_tokens_on_auth_token' AND type='index'
57
+ UNION ALL
58
+ SELECT sql
59
+ FROM sqlite_temp_master
60
+ WHERE name='index_arcadex_tokens_on_auth_token' AND type='index'
46
61
  
@@ -20,3 +20,38 @@ Migrating to AddIndexToToken (20140806202340)
20
20
  SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140806202340"]]
21
21
   (99.7ms) commit transaction
22
22
  ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
23
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
24
+ Migrating to AddFirstIpAddressToArcadexTokens (20140910215044)
25
+  (0.1ms) begin transaction
26
+  (0.7ms) ALTER TABLE "arcadex_tokens" ADD "first_ip_address" varchar(255)
27
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140910215044"]]
28
+  (140.5ms) commit transaction
29
+ Migrating to AddCurrentIpAddressToArcadexTokens (20140910215118)
30
+  (0.1ms) begin transaction
31
+  (0.6ms) ALTER TABLE "arcadex_tokens" ADD "current_ip_address" varchar(255)
32
+ SQL (0.4ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140910215118"]]
33
+  (141.4ms) commit transaction
34
+ Migrating to AddTimesUsedToArcadexTokens (20140910215136)
35
+  (0.2ms) begin transaction
36
+  (2.4ms) ALTER TABLE "arcadex_tokens" ADD "times_used" integer
37
+ SQL (1.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140910215136"]]
38
+  (124.5ms) commit transaction
39
+ Migrating to AddExpirationMinutesToArcadexTokens (20140910215147)
40
+  (0.2ms) begin transaction
41
+  (1.5ms) ALTER TABLE "arcadex_tokens" ADD "expiration_minutes" integer
42
+ SQL (0.7ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140910215147"]]
43
+  (125.1ms) commit transaction
44
+ Migrating to AddMaxUsesToArcadexTokens (20141020173616)
45
+  (0.1ms) begin transaction
46
+  (0.7ms) ALTER TABLE "arcadex_tokens" ADD "max_uses" integer
47
+ SQL (0.5ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20141020173616"]]
48
+  (140.5ms) commit transaction
49
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
50
+  (0.1ms)  SELECT sql
51
+ FROM sqlite_master
52
+ WHERE name='index_arcadex_tokens_on_auth_token' AND type='index'
53
+ UNION ALL
54
+ SELECT sql
55
+ FROM sqlite_temp_master
56
+ WHERE name='index_arcadex_tokens_on_auth_token' AND type='index'
57
+ 
@@ -0,0 +1,77 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gem 'people', :path => "engines/people"
4
+
5
+
6
+ gem "json_voorhees"
7
+ # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
8
+ gem 'rails', '4.0.4'
9
+
10
+ # Use sqlite3 as the database for Active Record
11
+ gem 'sqlite3'
12
+
13
+ # Use SCSS for stylesheets
14
+ gem 'sass-rails', '~> 4.0.2'
15
+
16
+ # Use Uglifier as compressor for JavaScript assets
17
+ gem 'uglifier', '>= 1.3.0'
18
+
19
+ # Use CoffeeScript for .js.coffee assets and views
20
+ gem 'coffee-rails', '~> 4.0.0'
21
+
22
+ # See https://github.com/sstephenson/execjs#readme for more supported runtimes
23
+ # gem 'therubyracer', platforms: :ruby
24
+
25
+ # Use jquery as the JavaScript library
26
+ gem 'jquery-rails'
27
+
28
+ # Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
29
+ gem 'turbolinks'
30
+
31
+ # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
32
+ gem 'jbuilder', '~> 1.2'
33
+
34
+ group :doc do
35
+ # bundle exec rake doc:rails generates the API under doc/api.
36
+ gem 'sdoc', require: false
37
+ end
38
+
39
+ # Use ActiveModel has_secure_password
40
+ # gem 'bcrypt', '~> 3.1.7'
41
+
42
+ # Use unicorn as the app server
43
+ # gem 'unicorn'
44
+
45
+ # Use Capistrano for deployment
46
+ # gem 'capistrano', group: :development
47
+
48
+ # Use debugger
49
+ # gem 'debugger', group: [:development, :test]
50
+
51
+ group :development, :test do
52
+ gem "figaro", "~> 0.7.0"
53
+ gem "annotate", ">=2.6.0"
54
+ gem "rspec-rails", "~> 3.0.0"
55
+ gem "byebug", "~> 3.2.0"
56
+ gem "factory_girl_rails", "~> 4.0"
57
+ gem "database_cleaner", "~> 1.3.0"
58
+ end
59
+
60
+ group :development do
61
+ gem "better_errors", "~> 1.1.0"
62
+ gem "binding_of_caller", "~> 0.7.1"
63
+ end
64
+
65
+ gem "active_model_serializers", "~> 0.8.0"
66
+ gem "rails-api"
67
+ gem "kaminari"
68
+ gem "bcrypt", "~> 3.1.7"
69
+ gem "type_cartographer"
70
+ gem "devise", "~> 3.2.4"
71
+ gem "arcadex", path: "../../../arcadex"
72
+ gem "autoprefixer-rails"
73
+ gem "bootstrap-sass", "~> 3.2.0"
74
+ gem "activeadmin", git: "https://github.com/activeadmin/activeadmin.git", branch: "master"
75
+ gem "defcon", "~> 1.2.3"
76
+ gem "authorization", path: "gems/authorization"
77
+ gem "whenever", require: false
@@ -0,0 +1,281 @@
1
+ GIT
2
+ remote: https://github.com/activeadmin/activeadmin.git
3
+ revision: 05778f4b7c8e821d584c7b4b08bcd79c02a0db76
4
+ branch: master
5
+ specs:
6
+ activeadmin (1.0.0.pre)
7
+ arbre (~> 1.0, >= 1.0.2)
8
+ bourbon
9
+ coffee-rails
10
+ formtastic (~> 3.0)
11
+ inherited_resources (~> 1.4.1)
12
+ jquery-rails
13
+ jquery-ui-rails (~> 5.0)
14
+ kaminari (~> 0.15)
15
+ rails (>= 3.2, < 4.2)
16
+ ransack (~> 1.3)
17
+ sass-rails
18
+
19
+ PATH
20
+ remote: ../../../arcadex
21
+ specs:
22
+ arcadex (1.1.3)
23
+ devise (>= 3.2.4)
24
+ rails (>= 4.0.0)
25
+
26
+ PATH
27
+ remote: engines/people
28
+ specs:
29
+ people (0.0.1)
30
+ active_model_serializers (~> 0.8.0)
31
+ arcadex
32
+ bcrypt (~> 3.1.7)
33
+ rails (~> 4.0.4)
34
+ rails-api
35
+ type_cartographer
36
+
37
+ PATH
38
+ remote: gems/authorization
39
+ specs:
40
+ authorization (0.0.1)
41
+ rails (~> 4.0.4)
42
+
43
+ GEM
44
+ remote: https://rubygems.org/
45
+ specs:
46
+ actionmailer (4.0.4)
47
+ actionpack (= 4.0.4)
48
+ mail (~> 2.5.4)
49
+ actionpack (4.0.4)
50
+ activesupport (= 4.0.4)
51
+ builder (~> 3.1.0)
52
+ erubis (~> 2.7.0)
53
+ rack (~> 1.5.2)
54
+ rack-test (~> 0.6.2)
55
+ active_model_serializers (0.8.2)
56
+ activemodel (>= 3.0)
57
+ activemodel (4.0.4)
58
+ activesupport (= 4.0.4)
59
+ builder (~> 3.1.0)
60
+ activerecord (4.0.4)
61
+ activemodel (= 4.0.4)
62
+ activerecord-deprecated_finders (~> 1.0.2)
63
+ activesupport (= 4.0.4)
64
+ arel (~> 4.0.0)
65
+ activerecord-deprecated_finders (1.0.3)
66
+ activesupport (4.0.4)
67
+ i18n (~> 0.6, >= 0.6.9)
68
+ minitest (~> 4.2)
69
+ multi_json (~> 1.3)
70
+ thread_safe (~> 0.1)
71
+ tzinfo (~> 0.3.37)
72
+ annotate (2.6.5)
73
+ activerecord (>= 2.3.0)
74
+ rake (>= 0.8.7)
75
+ arbre (1.0.2)
76
+ activesupport (>= 3.0.0)
77
+ arel (4.0.2)
78
+ autoprefixer-rails (3.1.2.20141016)
79
+ execjs
80
+ bcrypt (3.1.7)
81
+ better_errors (1.1.0)
82
+ coderay (>= 1.0.0)
83
+ erubis (>= 2.6.6)
84
+ binding_of_caller (0.7.2)
85
+ debug_inspector (>= 0.0.1)
86
+ bootstrap-sass (3.2.0.2)
87
+ sass (~> 3.2)
88
+ bourbon (3.2.3)
89
+ sass (~> 3.2)
90
+ thor
91
+ builder (3.1.4)
92
+ byebug (3.2.0)
93
+ columnize (~> 0.8)
94
+ debugger-linecache (~> 1.2)
95
+ chronic (0.10.2)
96
+ coderay (1.1.0)
97
+ coffee-rails (4.0.1)
98
+ coffee-script (>= 2.2.0)
99
+ railties (>= 4.0.0, < 5.0)
100
+ coffee-script (2.3.0)
101
+ coffee-script-source
102
+ execjs
103
+ coffee-script-source (1.8.0)
104
+ columnize (0.8.9)
105
+ database_cleaner (1.3.0)
106
+ debug_inspector (0.0.2)
107
+ debugger-linecache (1.2.0)
108
+ defcon (1.2.3)
109
+ bcrypt (>= 3.1.7)
110
+ rails (>= 4.0.0)
111
+ devise (3.2.4)
112
+ bcrypt (~> 3.0)
113
+ orm_adapter (~> 0.1)
114
+ railties (>= 3.2.6, < 5)
115
+ thread_safe (~> 0.1)
116
+ warden (~> 1.2.3)
117
+ diff-lcs (1.2.5)
118
+ erubis (2.7.0)
119
+ execjs (2.2.2)
120
+ factory_girl (4.4.0)
121
+ activesupport (>= 3.0.0)
122
+ factory_girl_rails (4.4.1)
123
+ factory_girl (~> 4.4.0)
124
+ railties (>= 3.0.0)
125
+ figaro (0.7.0)
126
+ bundler (~> 1.0)
127
+ rails (>= 3, < 5)
128
+ formtastic (3.0.0)
129
+ actionpack (>= 3.2.13)
130
+ has_scope (0.6.0.rc)
131
+ actionpack (>= 3.2, < 5)
132
+ activesupport (>= 3.2, < 5)
133
+ hike (1.2.3)
134
+ i18n (0.6.11)
135
+ inherited_resources (1.4.1)
136
+ has_scope (~> 0.6.0.rc)
137
+ responders (~> 1.0.0.rc)
138
+ jbuilder (1.5.3)
139
+ activesupport (>= 3.0.0)
140
+ multi_json (>= 1.2.0)
141
+ jquery-rails (3.1.2)
142
+ railties (>= 3.0, < 5.0)
143
+ thor (>= 0.14, < 2.0)
144
+ jquery-ui-rails (5.0.1)
145
+ railties (>= 3.2.16)
146
+ json (1.8.1)
147
+ json_voorhees (0.5.4)
148
+ rails (>= 4.0.0)
149
+ kaminari (0.16.1)
150
+ actionpack (>= 3.0.0)
151
+ activesupport (>= 3.0.0)
152
+ mail (2.5.4)
153
+ mime-types (~> 1.16)
154
+ treetop (~> 1.4.8)
155
+ mime-types (1.25.1)
156
+ minitest (4.7.5)
157
+ multi_json (1.10.1)
158
+ orm_adapter (0.5.0)
159
+ polyamorous (1.1.0)
160
+ activerecord (>= 3.0)
161
+ polyglot (0.3.5)
162
+ rack (1.5.2)
163
+ rack-test (0.6.2)
164
+ rack (>= 1.0)
165
+ rails (4.0.4)
166
+ actionmailer (= 4.0.4)
167
+ actionpack (= 4.0.4)
168
+ activerecord (= 4.0.4)
169
+ activesupport (= 4.0.4)
170
+ bundler (>= 1.3.0, < 2.0)
171
+ railties (= 4.0.4)
172
+ sprockets-rails (~> 2.0.0)
173
+ rails-api (0.3.0)
174
+ actionpack (>= 3.2.11)
175
+ railties (>= 3.2.11)
176
+ railties (4.0.4)
177
+ actionpack (= 4.0.4)
178
+ activesupport (= 4.0.4)
179
+ rake (>= 0.8.7)
180
+ thor (>= 0.18.1, < 2.0)
181
+ rake (10.3.2)
182
+ ransack (1.4.1)
183
+ actionpack (>= 3.0)
184
+ activerecord (>= 3.0)
185
+ activesupport (>= 3.0)
186
+ i18n
187
+ polyamorous (~> 1.1)
188
+ rdoc (4.1.2)
189
+ json (~> 1.4)
190
+ responders (1.0.0)
191
+ railties (>= 3.2, < 5)
192
+ rspec-core (3.0.4)
193
+ rspec-support (~> 3.0.0)
194
+ rspec-expectations (3.0.4)
195
+ diff-lcs (>= 1.2.0, < 2.0)
196
+ rspec-support (~> 3.0.0)
197
+ rspec-mocks (3.0.4)
198
+ rspec-support (~> 3.0.0)
199
+ rspec-rails (3.0.2)
200
+ actionpack (>= 3.0)
201
+ activesupport (>= 3.0)
202
+ railties (>= 3.0)
203
+ rspec-core (~> 3.0.0)
204
+ rspec-expectations (~> 3.0.0)
205
+ rspec-mocks (~> 3.0.0)
206
+ rspec-support (~> 3.0.0)
207
+ rspec-support (3.0.4)
208
+ sass (3.2.19)
209
+ sass-rails (4.0.3)
210
+ railties (>= 4.0.0, < 5.0)
211
+ sass (~> 3.2.0)
212
+ sprockets (~> 2.8, <= 2.11.0)
213
+ sprockets-rails (~> 2.0)
214
+ sdoc (0.4.1)
215
+ json (~> 1.7, >= 1.7.7)
216
+ rdoc (~> 4.0)
217
+ sprockets (2.11.0)
218
+ hike (~> 1.2)
219
+ multi_json (~> 1.0)
220
+ rack (~> 1.0)
221
+ tilt (~> 1.1, != 1.3.0)
222
+ sprockets-rails (2.0.1)
223
+ actionpack (>= 3.0)
224
+ activesupport (>= 3.0)
225
+ sprockets (~> 2.8)
226
+ sqlite3 (1.3.9)
227
+ thor (0.19.1)
228
+ thread_safe (0.3.4)
229
+ tilt (1.4.1)
230
+ treetop (1.4.15)
231
+ polyglot
232
+ polyglot (>= 0.3.1)
233
+ turbolinks (2.4.0)
234
+ coffee-rails
235
+ type_cartographer (1.0.0)
236
+ rails (>= 4.0.0)
237
+ tzinfo (0.3.41)
238
+ uglifier (2.5.3)
239
+ execjs (>= 0.3.0)
240
+ json (>= 1.8.0)
241
+ warden (1.2.3)
242
+ rack (>= 1.0)
243
+ whenever (0.9.3)
244
+ chronic (>= 0.6.3)
245
+
246
+ PLATFORMS
247
+ ruby
248
+
249
+ DEPENDENCIES
250
+ active_model_serializers (~> 0.8.0)
251
+ activeadmin!
252
+ annotate (>= 2.6.0)
253
+ arcadex!
254
+ authorization!
255
+ autoprefixer-rails
256
+ bcrypt (~> 3.1.7)
257
+ better_errors (~> 1.1.0)
258
+ binding_of_caller (~> 0.7.1)
259
+ bootstrap-sass (~> 3.2.0)
260
+ byebug (~> 3.2.0)
261
+ coffee-rails (~> 4.0.0)
262
+ database_cleaner (~> 1.3.0)
263
+ defcon (~> 1.2.3)
264
+ devise (~> 3.2.4)
265
+ factory_girl_rails (~> 4.0)
266
+ figaro (~> 0.7.0)
267
+ jbuilder (~> 1.2)
268
+ jquery-rails
269
+ json_voorhees
270
+ kaminari
271
+ people!
272
+ rails (= 4.0.4)
273
+ rails-api
274
+ rspec-rails (~> 3.0.0)
275
+ sass-rails (~> 4.0.2)
276
+ sdoc
277
+ sqlite3
278
+ turbolinks
279
+ type_cartographer
280
+ uglifier (>= 1.3.0)
281
+ whenever