ctws 0.1.5.alpha

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +21 -0
  3. data/README.md +295 -0
  4. data/Rakefile +21 -0
  5. data/app/auth/ctws/authenticate_user.rb +36 -0
  6. data/app/auth/ctws/authorize_api_request.rb +44 -0
  7. data/app/controllers/concerns/ctws/exception_handler.rb +58 -0
  8. data/app/controllers/concerns/ctws/response.rb +25 -0
  9. data/app/controllers/concerns/ctws/v1/exception_handler.rb +6 -0
  10. data/app/controllers/concerns/ctws/v1/response.rb +6 -0
  11. data/app/controllers/ctws/application_controller.rb +5 -0
  12. data/app/controllers/ctws/authentication_controller.rb +28 -0
  13. data/app/controllers/ctws/ctws_controller.rb +24 -0
  14. data/app/controllers/ctws/min_app_versions_controller.rb +55 -0
  15. data/app/controllers/ctws/users_controller.rb +39 -0
  16. data/app/controllers/ctws/v1/authentication_controller.rb +6 -0
  17. data/app/controllers/ctws/v1/ctws_controller.rb +9 -0
  18. data/app/controllers/ctws/v1/min_app_versions_controller.rb +6 -0
  19. data/app/controllers/ctws/v1/users_controller.rb +6 -0
  20. data/app/controllers/ctws/v2/ctws_controller.rb +9 -0
  21. data/app/controllers/ctws/v2/min_app_versions_controller.rb +6 -0
  22. data/app/jobs/ctws/application_job.rb +4 -0
  23. data/app/lib/ctws/json_web_token.rb +25 -0
  24. data/app/lib/ctws/message.rb +43 -0
  25. data/app/mailers/ctws/application_mailer.rb +6 -0
  26. data/app/models/ctws/application_record.rb +5 -0
  27. data/app/models/ctws/min_app_version.rb +22 -0
  28. data/config/initializers/ctws.rb +5 -0
  29. data/config/initializers/mime_types.rb +1 -0
  30. data/config/routes.rb +18 -0
  31. data/db/migrate/20170425110839_create_ctws_min_app_versions.rb +13 -0
  32. data/db/migrate/20170425110933_add_values_to_ctws_min_app_versions.rb +26 -0
  33. data/lib/ctws/engine.rb +13 -0
  34. data/lib/ctws/version.rb +3 -0
  35. data/lib/ctws.rb +18 -0
  36. data/lib/tasks/ctws_tasks.rake +4 -0
  37. data/spec/auth/ctws/authenticate_user_spec.rb +34 -0
  38. data/spec/auth/ctws/authorize_api_request_spec.rb +62 -0
  39. data/spec/controllers/ctws/ctws_controller_spec.rb +41 -0
  40. data/spec/controllers/ctws/users_controller_spec.rb +7 -0
  41. data/spec/dummy/Rakefile +6 -0
  42. data/spec/dummy/app/assets/config/manifest.js +5 -0
  43. data/spec/dummy/app/assets/javascripts/application.js +13 -0
  44. data/spec/dummy/app/assets/javascripts/cable.js +13 -0
  45. data/spec/dummy/app/assets/stylesheets/application.css +15 -0
  46. data/spec/dummy/app/channels/application_cable/channel.rb +4 -0
  47. data/spec/dummy/app/channels/application_cable/connection.rb +4 -0
  48. data/spec/dummy/app/controllers/application_controller.rb +3 -0
  49. data/spec/dummy/app/controllers/user_controller.rb +18 -0
  50. data/spec/dummy/app/helpers/application_helper.rb +2 -0
  51. data/spec/dummy/app/helpers/user_helper.rb +2 -0
  52. data/spec/dummy/app/jobs/application_job.rb +2 -0
  53. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  54. data/spec/dummy/app/models/application_record.rb +3 -0
  55. data/spec/dummy/app/models/user.rb +4 -0
  56. data/spec/dummy/app/views/layouts/application.html.erb +14 -0
  57. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  58. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  59. data/spec/dummy/bin/bundle +3 -0
  60. data/spec/dummy/bin/rails +4 -0
  61. data/spec/dummy/bin/rake +4 -0
  62. data/spec/dummy/bin/setup +34 -0
  63. data/spec/dummy/bin/update +29 -0
  64. data/spec/dummy/config/application.rb +15 -0
  65. data/spec/dummy/config/boot.rb +5 -0
  66. data/spec/dummy/config/cable.yml +9 -0
  67. data/spec/dummy/config/database.yml +25 -0
  68. data/spec/dummy/config/environment.rb +5 -0
  69. data/spec/dummy/config/environments/development.rb +54 -0
  70. data/spec/dummy/config/environments/production.rb +86 -0
  71. data/spec/dummy/config/environments/test.rb +42 -0
  72. data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
  73. data/spec/dummy/config/initializers/assets.rb +11 -0
  74. data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
  75. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  76. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  77. data/spec/dummy/config/initializers/inflections.rb +16 -0
  78. data/spec/dummy/config/initializers/mime_types.rb +4 -0
  79. data/spec/dummy/config/initializers/new_framework_defaults.rb +24 -0
  80. data/spec/dummy/config/initializers/session_store.rb +3 -0
  81. data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
  82. data/spec/dummy/config/locales/en.yml +23 -0
  83. data/spec/dummy/config/puma.rb +47 -0
  84. data/spec/dummy/config/routes.rb +5 -0
  85. data/spec/dummy/config/secrets.yml +22 -0
  86. data/spec/dummy/config/spring.rb +6 -0
  87. data/spec/dummy/config.ru +5 -0
  88. data/spec/dummy/db/development.sqlite3 +0 -0
  89. data/spec/dummy/db/migrate/20170622072636_create_users.rb +10 -0
  90. data/spec/dummy/db/schema.rb +39 -0
  91. data/spec/dummy/db/test.sqlite3 +0 -0
  92. data/spec/dummy/log/development.log +29 -0
  93. data/spec/dummy/log/test.log +31496 -0
  94. data/spec/dummy/public/404.html +67 -0
  95. data/spec/dummy/public/422.html +67 -0
  96. data/spec/dummy/public/500.html +66 -0
  97. data/spec/dummy/public/apple-touch-icon-precomposed.png +0 -0
  98. data/spec/dummy/public/apple-touch-icon.png +0 -0
  99. data/spec/dummy/public/favicon.ico +0 -0
  100. data/spec/factories/ctws/ctws_user.rb +7 -0
  101. data/spec/factories/ctws_min_app_version.rb +9 -0
  102. data/spec/models/ctws/min_app_version_spec.rb +11 -0
  103. data/spec/models/ctws/user_spec.rb +8 -0
  104. data/spec/rails_helper.rb +88 -0
  105. data/spec/requests/ctws/authentication_spec.rb +47 -0
  106. data/spec/requests/ctws/min_app_version_spec.rb +169 -0
  107. data/spec/requests/ctws/users_spec.rb +46 -0
  108. data/spec/spec_helper.rb +27 -0
  109. data/spec/support/ctws/controller_spec_helper.rb +29 -0
  110. data/spec/support/ctws/request_spec_helper.rb +10 -0
  111. metadata +367 -0
metadata ADDED
@@ -0,0 +1,367 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ctws
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.5.alpha
5
+ platform: ruby
6
+ authors:
7
+ - Agustí B.R.
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-07-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '5.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '5.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bcrypt
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.1'
41
+ - !ruby/object:Gem::Dependency
42
+ name: jwt
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.5'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.5'
55
+ - !ruby/object:Gem::Dependency
56
+ name: sqlite3
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rspec-rails
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '3.6'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '3.6'
83
+ - !ruby/object:Gem::Dependency
84
+ name: factory_girl_rails
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '4.8'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '4.8'
97
+ - !ruby/object:Gem::Dependency
98
+ name: shoulda-matchers
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.1'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.1'
111
+ - !ruby/object:Gem::Dependency
112
+ name: faker
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.8'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.8'
125
+ - !ruby/object:Gem::Dependency
126
+ name: database_cleaner
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '1.6'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '1.6'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rake
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '12.0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '12.0'
153
+ description: Adds a Webservice API to an existing Rails App.
154
+ email:
155
+ - agusti.br@coditramuntana.com
156
+ executables: []
157
+ extensions: []
158
+ extra_rdoc_files: []
159
+ files:
160
+ - LICENSE
161
+ - README.md
162
+ - Rakefile
163
+ - app/auth/ctws/authenticate_user.rb
164
+ - app/auth/ctws/authorize_api_request.rb
165
+ - app/controllers/concerns/ctws/exception_handler.rb
166
+ - app/controllers/concerns/ctws/response.rb
167
+ - app/controllers/concerns/ctws/v1/exception_handler.rb
168
+ - app/controllers/concerns/ctws/v1/response.rb
169
+ - app/controllers/ctws/application_controller.rb
170
+ - app/controllers/ctws/authentication_controller.rb
171
+ - app/controllers/ctws/ctws_controller.rb
172
+ - app/controllers/ctws/min_app_versions_controller.rb
173
+ - app/controllers/ctws/users_controller.rb
174
+ - app/controllers/ctws/v1/authentication_controller.rb
175
+ - app/controllers/ctws/v1/ctws_controller.rb
176
+ - app/controllers/ctws/v1/min_app_versions_controller.rb
177
+ - app/controllers/ctws/v1/users_controller.rb
178
+ - app/controllers/ctws/v2/ctws_controller.rb
179
+ - app/controllers/ctws/v2/min_app_versions_controller.rb
180
+ - app/jobs/ctws/application_job.rb
181
+ - app/lib/ctws/json_web_token.rb
182
+ - app/lib/ctws/message.rb
183
+ - app/mailers/ctws/application_mailer.rb
184
+ - app/models/ctws/application_record.rb
185
+ - app/models/ctws/min_app_version.rb
186
+ - config/initializers/ctws.rb
187
+ - config/initializers/mime_types.rb
188
+ - config/routes.rb
189
+ - db/migrate/20170425110839_create_ctws_min_app_versions.rb
190
+ - db/migrate/20170425110933_add_values_to_ctws_min_app_versions.rb
191
+ - lib/ctws.rb
192
+ - lib/ctws/engine.rb
193
+ - lib/ctws/version.rb
194
+ - lib/tasks/ctws_tasks.rake
195
+ - spec/auth/ctws/authenticate_user_spec.rb
196
+ - spec/auth/ctws/authorize_api_request_spec.rb
197
+ - spec/controllers/ctws/ctws_controller_spec.rb
198
+ - spec/controllers/ctws/users_controller_spec.rb
199
+ - spec/dummy/Rakefile
200
+ - spec/dummy/app/assets/config/manifest.js
201
+ - spec/dummy/app/assets/javascripts/application.js
202
+ - spec/dummy/app/assets/javascripts/cable.js
203
+ - spec/dummy/app/assets/stylesheets/application.css
204
+ - spec/dummy/app/channels/application_cable/channel.rb
205
+ - spec/dummy/app/channels/application_cable/connection.rb
206
+ - spec/dummy/app/controllers/application_controller.rb
207
+ - spec/dummy/app/controllers/user_controller.rb
208
+ - spec/dummy/app/helpers/application_helper.rb
209
+ - spec/dummy/app/helpers/user_helper.rb
210
+ - spec/dummy/app/jobs/application_job.rb
211
+ - spec/dummy/app/mailers/application_mailer.rb
212
+ - spec/dummy/app/models/application_record.rb
213
+ - spec/dummy/app/models/user.rb
214
+ - spec/dummy/app/views/layouts/application.html.erb
215
+ - spec/dummy/app/views/layouts/mailer.html.erb
216
+ - spec/dummy/app/views/layouts/mailer.text.erb
217
+ - spec/dummy/bin/bundle
218
+ - spec/dummy/bin/rails
219
+ - spec/dummy/bin/rake
220
+ - spec/dummy/bin/setup
221
+ - spec/dummy/bin/update
222
+ - spec/dummy/config.ru
223
+ - spec/dummy/config/application.rb
224
+ - spec/dummy/config/boot.rb
225
+ - spec/dummy/config/cable.yml
226
+ - spec/dummy/config/database.yml
227
+ - spec/dummy/config/environment.rb
228
+ - spec/dummy/config/environments/development.rb
229
+ - spec/dummy/config/environments/production.rb
230
+ - spec/dummy/config/environments/test.rb
231
+ - spec/dummy/config/initializers/application_controller_renderer.rb
232
+ - spec/dummy/config/initializers/assets.rb
233
+ - spec/dummy/config/initializers/backtrace_silencers.rb
234
+ - spec/dummy/config/initializers/cookies_serializer.rb
235
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
236
+ - spec/dummy/config/initializers/inflections.rb
237
+ - spec/dummy/config/initializers/mime_types.rb
238
+ - spec/dummy/config/initializers/new_framework_defaults.rb
239
+ - spec/dummy/config/initializers/session_store.rb
240
+ - spec/dummy/config/initializers/wrap_parameters.rb
241
+ - spec/dummy/config/locales/en.yml
242
+ - spec/dummy/config/puma.rb
243
+ - spec/dummy/config/routes.rb
244
+ - spec/dummy/config/secrets.yml
245
+ - spec/dummy/config/spring.rb
246
+ - spec/dummy/db/development.sqlite3
247
+ - spec/dummy/db/migrate/20170622072636_create_users.rb
248
+ - spec/dummy/db/schema.rb
249
+ - spec/dummy/db/test.sqlite3
250
+ - spec/dummy/log/development.log
251
+ - spec/dummy/log/test.log
252
+ - spec/dummy/public/404.html
253
+ - spec/dummy/public/422.html
254
+ - spec/dummy/public/500.html
255
+ - spec/dummy/public/apple-touch-icon-precomposed.png
256
+ - spec/dummy/public/apple-touch-icon.png
257
+ - spec/dummy/public/favicon.ico
258
+ - spec/factories/ctws/ctws_user.rb
259
+ - spec/factories/ctws_min_app_version.rb
260
+ - spec/models/ctws/min_app_version_spec.rb
261
+ - spec/models/ctws/user_spec.rb
262
+ - spec/rails_helper.rb
263
+ - spec/requests/ctws/authentication_spec.rb
264
+ - spec/requests/ctws/min_app_version_spec.rb
265
+ - spec/requests/ctws/users_spec.rb
266
+ - spec/spec_helper.rb
267
+ - spec/support/ctws/controller_spec_helper.rb
268
+ - spec/support/ctws/request_spec_helper.rb
269
+ homepage: https://github.com/CodiTramuntana/ctws
270
+ licenses:
271
+ - MIT
272
+ metadata: {}
273
+ post_install_message:
274
+ rdoc_options: []
275
+ require_paths:
276
+ - lib
277
+ required_ruby_version: !ruby/object:Gem::Requirement
278
+ requirements:
279
+ - - ">="
280
+ - !ruby/object:Gem::Version
281
+ version: '0'
282
+ required_rubygems_version: !ruby/object:Gem::Requirement
283
+ requirements:
284
+ - - ">"
285
+ - !ruby/object:Gem::Version
286
+ version: 1.3.1
287
+ requirements: []
288
+ rubyforge_project:
289
+ rubygems_version: 2.5.1
290
+ signing_key:
291
+ specification_version: 4
292
+ summary: Rails gem to be used as Webservice base.
293
+ test_files:
294
+ - spec/controllers/ctws/users_controller_spec.rb
295
+ - spec/controllers/ctws/ctws_controller_spec.rb
296
+ - spec/factories/ctws/ctws_user.rb
297
+ - spec/factories/ctws_min_app_version.rb
298
+ - spec/support/ctws/request_spec_helper.rb
299
+ - spec/support/ctws/controller_spec_helper.rb
300
+ - spec/auth/ctws/authenticate_user_spec.rb
301
+ - spec/auth/ctws/authorize_api_request_spec.rb
302
+ - spec/rails_helper.rb
303
+ - spec/dummy/bin/setup
304
+ - spec/dummy/bin/rake
305
+ - spec/dummy/bin/bundle
306
+ - spec/dummy/bin/update
307
+ - spec/dummy/bin/rails
308
+ - spec/dummy/config/boot.rb
309
+ - spec/dummy/config/spring.rb
310
+ - spec/dummy/config/locales/en.yml
311
+ - spec/dummy/config/secrets.yml
312
+ - spec/dummy/config/cable.yml
313
+ - spec/dummy/config/application.rb
314
+ - spec/dummy/config/routes.rb
315
+ - spec/dummy/config/database.yml
316
+ - spec/dummy/config/puma.rb
317
+ - spec/dummy/config/initializers/backtrace_silencers.rb
318
+ - spec/dummy/config/initializers/assets.rb
319
+ - spec/dummy/config/initializers/session_store.rb
320
+ - spec/dummy/config/initializers/cookies_serializer.rb
321
+ - spec/dummy/config/initializers/new_framework_defaults.rb
322
+ - spec/dummy/config/initializers/inflections.rb
323
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
324
+ - spec/dummy/config/initializers/application_controller_renderer.rb
325
+ - spec/dummy/config/initializers/wrap_parameters.rb
326
+ - spec/dummy/config/initializers/mime_types.rb
327
+ - spec/dummy/config/environments/development.rb
328
+ - spec/dummy/config/environments/production.rb
329
+ - spec/dummy/config/environments/test.rb
330
+ - spec/dummy/config/environment.rb
331
+ - spec/dummy/app/controllers/user_controller.rb
332
+ - spec/dummy/app/controllers/application_controller.rb
333
+ - spec/dummy/app/views/layouts/mailer.text.erb
334
+ - spec/dummy/app/views/layouts/mailer.html.erb
335
+ - spec/dummy/app/views/layouts/application.html.erb
336
+ - spec/dummy/app/helpers/application_helper.rb
337
+ - spec/dummy/app/helpers/user_helper.rb
338
+ - spec/dummy/app/jobs/application_job.rb
339
+ - spec/dummy/app/assets/config/manifest.js
340
+ - spec/dummy/app/assets/stylesheets/application.css
341
+ - spec/dummy/app/assets/javascripts/cable.js
342
+ - spec/dummy/app/assets/javascripts/application.js
343
+ - spec/dummy/app/channels/application_cable/channel.rb
344
+ - spec/dummy/app/channels/application_cable/connection.rb
345
+ - spec/dummy/app/models/user.rb
346
+ - spec/dummy/app/models/application_record.rb
347
+ - spec/dummy/app/mailers/application_mailer.rb
348
+ - spec/dummy/db/test.sqlite3
349
+ - spec/dummy/db/schema.rb
350
+ - spec/dummy/db/migrate/20170622072636_create_users.rb
351
+ - spec/dummy/db/development.sqlite3
352
+ - spec/dummy/Rakefile
353
+ - spec/dummy/config.ru
354
+ - spec/dummy/public/404.html
355
+ - spec/dummy/public/apple-touch-icon.png
356
+ - spec/dummy/public/500.html
357
+ - spec/dummy/public/apple-touch-icon-precomposed.png
358
+ - spec/dummy/public/422.html
359
+ - spec/dummy/public/favicon.ico
360
+ - spec/dummy/log/test.log
361
+ - spec/dummy/log/development.log
362
+ - spec/models/ctws/min_app_version_spec.rb
363
+ - spec/models/ctws/user_spec.rb
364
+ - spec/requests/ctws/users_spec.rb
365
+ - spec/requests/ctws/min_app_version_spec.rb
366
+ - spec/requests/ctws/authentication_spec.rb
367
+ - spec/spec_helper.rb