apisonator 2.100.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 (173) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +317 -0
  3. data/Gemfile +11 -0
  4. data/Gemfile.base +65 -0
  5. data/Gemfile.lock +319 -0
  6. data/Gemfile.on_prem +1 -0
  7. data/Gemfile.on_prem.lock +297 -0
  8. data/LICENSE +202 -0
  9. data/NOTICE +15 -0
  10. data/README.md +230 -0
  11. data/Rakefile +287 -0
  12. data/apisonator.gemspec +47 -0
  13. data/app/api/api.rb +13 -0
  14. data/app/api/internal/alert_limits.rb +32 -0
  15. data/app/api/internal/application_keys.rb +49 -0
  16. data/app/api/internal/application_referrer_filters.rb +43 -0
  17. data/app/api/internal/applications.rb +77 -0
  18. data/app/api/internal/errors.rb +54 -0
  19. data/app/api/internal/events.rb +42 -0
  20. data/app/api/internal/internal.rb +104 -0
  21. data/app/api/internal/metrics.rb +40 -0
  22. data/app/api/internal/service_tokens.rb +46 -0
  23. data/app/api/internal/services.rb +58 -0
  24. data/app/api/internal/stats.rb +42 -0
  25. data/app/api/internal/usagelimits.rb +62 -0
  26. data/app/api/internal/utilization.rb +23 -0
  27. data/bin/3scale_backend +223 -0
  28. data/bin/3scale_backend_worker +26 -0
  29. data/config.ru +4 -0
  30. data/config/puma.rb +192 -0
  31. data/config/schedule.rb +9 -0
  32. data/ext/mkrf_conf.rb +64 -0
  33. data/lib/3scale/backend.rb +67 -0
  34. data/lib/3scale/backend/alert_limit.rb +56 -0
  35. data/lib/3scale/backend/alerts.rb +137 -0
  36. data/lib/3scale/backend/analytics/kinesis.rb +3 -0
  37. data/lib/3scale/backend/analytics/kinesis/adapter.rb +180 -0
  38. data/lib/3scale/backend/analytics/kinesis/exporter.rb +86 -0
  39. data/lib/3scale/backend/analytics/kinesis/job.rb +135 -0
  40. data/lib/3scale/backend/analytics/redshift.rb +3 -0
  41. data/lib/3scale/backend/analytics/redshift/adapter.rb +367 -0
  42. data/lib/3scale/backend/analytics/redshift/importer.rb +83 -0
  43. data/lib/3scale/backend/analytics/redshift/job.rb +33 -0
  44. data/lib/3scale/backend/application.rb +330 -0
  45. data/lib/3scale/backend/application_events.rb +76 -0
  46. data/lib/3scale/backend/background_job.rb +65 -0
  47. data/lib/3scale/backend/configurable.rb +20 -0
  48. data/lib/3scale/backend/configuration.rb +151 -0
  49. data/lib/3scale/backend/configuration/loader.rb +42 -0
  50. data/lib/3scale/backend/constants.rb +19 -0
  51. data/lib/3scale/backend/cors.rb +84 -0
  52. data/lib/3scale/backend/distributed_lock.rb +67 -0
  53. data/lib/3scale/backend/environment.rb +21 -0
  54. data/lib/3scale/backend/error_storage.rb +52 -0
  55. data/lib/3scale/backend/errors.rb +343 -0
  56. data/lib/3scale/backend/event_storage.rb +120 -0
  57. data/lib/3scale/backend/experiment.rb +84 -0
  58. data/lib/3scale/backend/extensions.rb +5 -0
  59. data/lib/3scale/backend/extensions/array.rb +19 -0
  60. data/lib/3scale/backend/extensions/hash.rb +26 -0
  61. data/lib/3scale/backend/extensions/nil_class.rb +13 -0
  62. data/lib/3scale/backend/extensions/redis.rb +44 -0
  63. data/lib/3scale/backend/extensions/string.rb +13 -0
  64. data/lib/3scale/backend/extensions/time.rb +110 -0
  65. data/lib/3scale/backend/failed_jobs_scheduler.rb +141 -0
  66. data/lib/3scale/backend/job_fetcher.rb +122 -0
  67. data/lib/3scale/backend/listener.rb +728 -0
  68. data/lib/3scale/backend/listener_metrics.rb +99 -0
  69. data/lib/3scale/backend/logging.rb +48 -0
  70. data/lib/3scale/backend/logging/external.rb +44 -0
  71. data/lib/3scale/backend/logging/external/impl.rb +93 -0
  72. data/lib/3scale/backend/logging/external/impl/airbrake.rb +66 -0
  73. data/lib/3scale/backend/logging/external/impl/bugsnag.rb +69 -0
  74. data/lib/3scale/backend/logging/external/impl/default.rb +18 -0
  75. data/lib/3scale/backend/logging/external/resque.rb +57 -0
  76. data/lib/3scale/backend/logging/logger.rb +18 -0
  77. data/lib/3scale/backend/logging/middleware.rb +62 -0
  78. data/lib/3scale/backend/logging/middleware/json_writer.rb +21 -0
  79. data/lib/3scale/backend/logging/middleware/text_writer.rb +60 -0
  80. data/lib/3scale/backend/logging/middleware/writer.rb +143 -0
  81. data/lib/3scale/backend/logging/worker.rb +107 -0
  82. data/lib/3scale/backend/manifest.rb +80 -0
  83. data/lib/3scale/backend/memoizer.rb +277 -0
  84. data/lib/3scale/backend/metric.rb +275 -0
  85. data/lib/3scale/backend/metric/collection.rb +91 -0
  86. data/lib/3scale/backend/oauth.rb +4 -0
  87. data/lib/3scale/backend/oauth/token.rb +26 -0
  88. data/lib/3scale/backend/oauth/token_key.rb +30 -0
  89. data/lib/3scale/backend/oauth/token_storage.rb +313 -0
  90. data/lib/3scale/backend/oauth/token_value.rb +25 -0
  91. data/lib/3scale/backend/period.rb +3 -0
  92. data/lib/3scale/backend/period/boundary.rb +107 -0
  93. data/lib/3scale/backend/period/cache.rb +28 -0
  94. data/lib/3scale/backend/period/period.rb +402 -0
  95. data/lib/3scale/backend/queue_storage.rb +16 -0
  96. data/lib/3scale/backend/rack.rb +49 -0
  97. data/lib/3scale/backend/rack/exception_catcher.rb +136 -0
  98. data/lib/3scale/backend/rack/internal_error_catcher.rb +23 -0
  99. data/lib/3scale/backend/rack/prometheus.rb +19 -0
  100. data/lib/3scale/backend/saas.rb +6 -0
  101. data/lib/3scale/backend/saas_analytics.rb +4 -0
  102. data/lib/3scale/backend/server.rb +30 -0
  103. data/lib/3scale/backend/server/falcon.rb +52 -0
  104. data/lib/3scale/backend/server/puma.rb +71 -0
  105. data/lib/3scale/backend/service.rb +317 -0
  106. data/lib/3scale/backend/service_token.rb +97 -0
  107. data/lib/3scale/backend/stats.rb +8 -0
  108. data/lib/3scale/backend/stats/aggregator.rb +170 -0
  109. data/lib/3scale/backend/stats/aggregators/base.rb +72 -0
  110. data/lib/3scale/backend/stats/aggregators/response_code.rb +58 -0
  111. data/lib/3scale/backend/stats/aggregators/usage.rb +34 -0
  112. data/lib/3scale/backend/stats/bucket_reader.rb +135 -0
  113. data/lib/3scale/backend/stats/bucket_storage.rb +108 -0
  114. data/lib/3scale/backend/stats/cleaner.rb +195 -0
  115. data/lib/3scale/backend/stats/codes_commons.rb +14 -0
  116. data/lib/3scale/backend/stats/delete_job_def.rb +60 -0
  117. data/lib/3scale/backend/stats/key_generator.rb +73 -0
  118. data/lib/3scale/backend/stats/keys.rb +104 -0
  119. data/lib/3scale/backend/stats/partition_eraser_job.rb +58 -0
  120. data/lib/3scale/backend/stats/partition_generator_job.rb +46 -0
  121. data/lib/3scale/backend/stats/period_commons.rb +34 -0
  122. data/lib/3scale/backend/stats/stats_parser.rb +141 -0
  123. data/lib/3scale/backend/stats/storage.rb +113 -0
  124. data/lib/3scale/backend/statsd.rb +14 -0
  125. data/lib/3scale/backend/storable.rb +35 -0
  126. data/lib/3scale/backend/storage.rb +40 -0
  127. data/lib/3scale/backend/storage_async.rb +4 -0
  128. data/lib/3scale/backend/storage_async/async_redis.rb +21 -0
  129. data/lib/3scale/backend/storage_async/client.rb +205 -0
  130. data/lib/3scale/backend/storage_async/pipeline.rb +79 -0
  131. data/lib/3scale/backend/storage_async/resque_extensions.rb +30 -0
  132. data/lib/3scale/backend/storage_helpers.rb +278 -0
  133. data/lib/3scale/backend/storage_key_helpers.rb +9 -0
  134. data/lib/3scale/backend/storage_sync.rb +43 -0
  135. data/lib/3scale/backend/transaction.rb +62 -0
  136. data/lib/3scale/backend/transactor.rb +177 -0
  137. data/lib/3scale/backend/transactor/limit_headers.rb +54 -0
  138. data/lib/3scale/backend/transactor/notify_batcher.rb +139 -0
  139. data/lib/3scale/backend/transactor/notify_job.rb +47 -0
  140. data/lib/3scale/backend/transactor/process_job.rb +33 -0
  141. data/lib/3scale/backend/transactor/report_job.rb +84 -0
  142. data/lib/3scale/backend/transactor/status.rb +236 -0
  143. data/lib/3scale/backend/transactor/usage_report.rb +182 -0
  144. data/lib/3scale/backend/usage.rb +63 -0
  145. data/lib/3scale/backend/usage_limit.rb +115 -0
  146. data/lib/3scale/backend/use_cases/provider_key_change_use_case.rb +60 -0
  147. data/lib/3scale/backend/util.rb +17 -0
  148. data/lib/3scale/backend/validators.rb +26 -0
  149. data/lib/3scale/backend/validators/base.rb +36 -0
  150. data/lib/3scale/backend/validators/key.rb +17 -0
  151. data/lib/3scale/backend/validators/limits.rb +57 -0
  152. data/lib/3scale/backend/validators/oauth_key.rb +15 -0
  153. data/lib/3scale/backend/validators/oauth_setting.rb +15 -0
  154. data/lib/3scale/backend/validators/redirect_uri.rb +33 -0
  155. data/lib/3scale/backend/validators/referrer.rb +60 -0
  156. data/lib/3scale/backend/validators/service_state.rb +15 -0
  157. data/lib/3scale/backend/validators/state.rb +15 -0
  158. data/lib/3scale/backend/version.rb +5 -0
  159. data/lib/3scale/backend/views/oauth_access_tokens.builder +14 -0
  160. data/lib/3scale/backend/views/oauth_app_id_by_token.builder +4 -0
  161. data/lib/3scale/backend/worker.rb +87 -0
  162. data/lib/3scale/backend/worker_async.rb +88 -0
  163. data/lib/3scale/backend/worker_metrics.rb +44 -0
  164. data/lib/3scale/backend/worker_sync.rb +32 -0
  165. data/lib/3scale/bundler_shim.rb +17 -0
  166. data/lib/3scale/prometheus_server.rb +10 -0
  167. data/lib/3scale/tasks/connectivity.rake +41 -0
  168. data/lib/3scale/tasks/helpers.rb +3 -0
  169. data/lib/3scale/tasks/helpers/environment.rb +23 -0
  170. data/lib/3scale/tasks/stats.rake +131 -0
  171. data/lib/3scale/tasks/swagger.rake +46 -0
  172. data/licenses.xml +1215 -0
  173. metadata +227 -0
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '02689c2d07caa6e88eb1079c13064378fafa921ffb28e4da095cd8ad5fbac578'
4
+ data.tar.gz: 434d69fc1eb06088b1c4111bd41979567f1b00c22b149e5b4a7bdbda48c447a1
5
+ SHA512:
6
+ metadata.gz: edc21e4dedc90447e734e7afe0fe681127d9a4a88cd4ba3d9f9633b7eae3ee31488aa54b9cfaaeb6e28c158eb822c9679e325c4b6773130779fd63f5a6498fe9
7
+ data.tar.gz: 3267cfad364babfafb0c563feea99ecd0ff346b7a12d224b37178ff28e13a92fcce8a25372b1901f54a1bfcf6ecdeea0f9665ac2e30dcc6fe0fa3aff15bce468
@@ -0,0 +1,317 @@
1
+ # Change Log
2
+
3
+ Notable changes to Apisonator will be tracked in this document.
4
+
5
+ ## 2.100.0 - 2020-04-21
6
+
7
+ ### Added
8
+
9
+ - The behavior of the referrer filters validator is now configurable
10
+ ([#190](https://github.com/3scale/apisonator/pull/190)).
11
+
12
+ ### Fixed
13
+
14
+ - When running the listeners in async mode, Apisonator no longer returns
15
+ exception messages to the caller
16
+ ([#186](https://github.com/3scale/apisonator/pull/186)).
17
+ - Fixed a small concurrency issue when running the workers in async mode. It
18
+ only affected to some job run times that appear in the logs
19
+ ([#191](https://github.com/3scale/apisonator/pull/191)).
20
+
21
+ ### Removed
22
+
23
+ - Deleted some unused rake tasks for uploading swagger specs
24
+ ([#193](https://github.com/3scale/apisonator/pull/193)).
25
+
26
+ ## 2.99.0 - 2020-03-31
27
+
28
+ ### Added
29
+
30
+ - Support for specifying transaction timestamps as UNIX epoch timestamps
31
+ ([#167](https://github.com/3scale/apisonator/pull/167))
32
+ - Prometheus metrics for the listener
33
+ ([#174](https://github.com/3scale/apisonator/pull/174),
34
+ [#178](https://github.com/3scale/apisonator/pull/178))
35
+
36
+ ### Changed
37
+
38
+ - Updated yabeda-prometheus to v0.5.0
39
+ ([#171](https://github.com/3scale/apisonator/pull/171))
40
+ - Updated async-container to v0.16.4
41
+ ([#179](https://github.com/3scale/apisonator/pull/179))
42
+ - Stopped propagating unused log attributes unnecessarily
43
+ ([#180](https://github.com/3scale/apisonator/pull/180))
44
+ - No longer sets a default of 1 for `CONFIG_NOTIFICATION_BATCH` in the
45
+ Dockerfiles ([#183](https://github.com/3scale/apisonator/pull/183))
46
+
47
+ ### Removed
48
+
49
+ - The "latest transactions" functionality has been removed. It was no longer
50
+ needed by Porta ([#169](https://github.com/3scale/apisonator/pull/169))
51
+
52
+ ## 2.98.1.1 - 2020-03-05
53
+
54
+ ### Changed
55
+
56
+ - Updated Nokogiri to v1.10.9 [#163](https://github.com/3scale/apisonator/pull/163)
57
+ - Updated Rake to v13.0.1 [#162](https://github.com/3scale/apisonator/pull/162)
58
+
59
+ ## 2.98.1 - 2020-02-18
60
+
61
+ ### Fixed
62
+
63
+ - No longer crashes when the address of a sentinel cannot be resolved. It tries
64
+ to connect to another sentinel in the list instead.
65
+ [#158](https://github.com/3scale/apisonator/pull/158)
66
+
67
+ ## 2.98.0 - 2020-02-04
68
+
69
+ ### Added
70
+
71
+ - Listeners can now be deployed in async mode using Falcon. Still experimental
72
+ [#150](https://github.com/3scale/apisonator/pull/150)
73
+ - Added the delete stats task to the `backend-cron` executable
74
+ [#156](https://github.com/3scale/apisonator/pull/156)
75
+
76
+ ### Fixed
77
+
78
+ - Fixed a minor bug in the stats deletion feature. The task no longer crashes
79
+ with invalid keys [#154](https://github.com/3scale/apisonator/pull/154)
80
+ - `backend-cron` no longer crashes when `RESCHEDULE_JOBS_FREQ` is set
81
+ [#155](https://github.com/3scale/apisonator/pull/155)
82
+
83
+ ## 2.97.0 - 2020-01-13
84
+
85
+ ### Added
86
+
87
+ - New "flat_usage" extension, useful for caching. [#142](https://github.com/3scale/apisonator/pull/142)
88
+
89
+ ### Changed
90
+
91
+ - New approach to delete the stats of a service [#143](https://github.com/3scale/apisonator/pull/143)
92
+ - Updated Rack to 2.0.8 [#144](https://github.com/3scale/apisonator/pull/144)
93
+
94
+ ## 2.96.2 - 2019-10-17
95
+
96
+ ### Added
97
+
98
+ - Async params can be configured using environment variables [#138](https://github.com/3scale/apisonator/pull/138)
99
+
100
+ ### Fixed
101
+
102
+ - Rake tasks now work when using the async redis client [#137](https://github.com/3scale/apisonator/pull/137)
103
+
104
+ ## 2.96.1 - 2019-10-10
105
+
106
+ ### Changed
107
+
108
+ - Updated async-redis to v0.4.1 [#132](https://github.com/3scale/apisonator/pull/132)
109
+ - Updated rubyzip to v2.0.0 [#133](https://github.com/3scale/apisonator/pull/133)
110
+
111
+ ## 2.96.0 - 2019-09-30
112
+
113
+ ### Added
114
+
115
+ - Support for non-blocking Redis calls using the redis-async gem. The feature is
116
+ opt-in and can be enabled only in workers for now. The feature is enabled with
117
+ `CONFIG_REDIS_ASYNC=true` [#96](https://github.com/3scale/apisonator/pull/96)
118
+
119
+ ## 2.95.0 - 2019-09-25
120
+
121
+ ### Changed
122
+
123
+ - Dropped support for end-users [#128](https://github.com/3scale/apisonator/pull/128)
124
+
125
+ ## 2.94.2 - 2019-09-10
126
+
127
+ ### Changed
128
+
129
+ - Perf optimization: `Usage.usage` is more efficient now because it does not create unnecessary instance periods [#126](https://github.com/3scale/apisonator/pull/126)
130
+
131
+ ## 2.94.1 - 2019-09-09
132
+
133
+ ### Changed
134
+
135
+ - Perf optimization: `Metric.ascendants` and `Metric.descendants` are memoized now [#124](https://github.com/3scale/apisonator/pull/124)
136
+
137
+ ## 2.94.0 - 2019-09-04
138
+
139
+ ### Added
140
+
141
+ - Prometheus metrics for workers [#111](https://github.com/3scale/apisonator/pull/111)
142
+ - Support for metric hierarchies with more than 2 levels [#119](https://github.com/3scale/apisonator/pull/119), [#121](https://github.com/3scale/apisonator/pull/121), [#122](https://github.com/3scale/apisonator/pull/122)
143
+
144
+ ### Changed
145
+
146
+ - Updated Nokogiri to v1.10.4 [#118](https://github.com/3scale/apisonator/pull/118)
147
+
148
+ ## 2.93.0 - 2019-07-31
149
+
150
+ ### Changed
151
+
152
+ - Dropped support for Ruby < 2.4 [#109](https://github.com/3scale/apisonator/pull/109)
153
+
154
+ ## 2.92.0 - 2019-06-12
155
+
156
+ ### Added
157
+
158
+ - Support for password-protected Redis sentinels [#101](https://github.com/3scale/apisonator/pull/101)
159
+ - New limit header with the max value for the limit [#103](https://github.com/3scale/apisonator/pull/103)
160
+ - CI tests now run on Ruby 2.5 and Ruby 2.6 too [#84](https://github.com/3scale/apisonator/pull/84), [#97](https://github.com/3scale/apisonator/pull/97)
161
+
162
+ ### Changed
163
+
164
+ - Updated redis gem to v4.1.1 [#99](https://github.com/3scale/apisonator/pull/99)
165
+ - Performance optimizations in some time methods [#80](https://github.com/3scale/apisonator/pull/80), [#81](https://github.com/3scale/apisonator/pull/81)
166
+
167
+
168
+ ## 2.91.1 - 2019-03-08
169
+
170
+ ### Changed
171
+
172
+ - The endpoint of the internal API to delete stats of a service has been disabled because of performance issues. It will be re-enabled once those are solved. [#87](https://github.com/3scale/apisonator/pull/87)
173
+
174
+
175
+ ## 2.91.0 - 2019-03-05
176
+
177
+ ### Added
178
+
179
+ - New endpoint in the internal API to delete the stats of a service. [#72](https://github.com/3scale/apisonator/pull/72), [#73](https://github.com/3scale/apisonator/pull/73), [#74](https://github.com/3scale/apisonator/pull/74), [#78](https://github.com/3scale/apisonator/pull/78), [#82](https://github.com/3scale/apisonator/pull/82).
180
+
181
+ ### Changed
182
+
183
+ - Rakefile now accepts a list of files as an argument in the "bench" target [#79](https://github.com/3scale/apisonator/pull/79)
184
+
185
+
186
+ ## 2.90.0 - 2019-02-20
187
+
188
+ ### Added
189
+
190
+ - New endpoint in the internal API to delete the users of a service. [#38](https://github.com/3scale/apisonator/pull/38)
191
+
192
+ ### Changed
193
+
194
+ - Updated rack to v2.0.6. [#63](https://github.com/3scale/apisonator/pull/63)
195
+ - Updated Nokogiri to v1.9.1. [#70](https://github.com/3scale/apisonator/pull/70)
196
+
197
+ ### Fixed
198
+
199
+ - Small fixes and improvements in the Makefiles and Dockerfiles used to build the docker images and the dev environment. [#61](https://github.com/3scale/apisonator/pull/61), [#64](https://github.com/3scale/apisonator/pull/64), [#67](https://github.com/3scale/apisonator/pull/67), [#68](https://github.com/3scale/apisonator/pull/68), [#69](https://github.com/3scale/apisonator/pull/69).
200
+
201
+
202
+ ## 2.89.0 - 2018-10-23
203
+
204
+ ### Added
205
+
206
+ - Tasks to check redis storage and queue storage connection. [#58](https://github.com/3scale/apisonator/pull/58)
207
+
208
+ ### Security
209
+
210
+ - Updated rubyzip to version 1.2.2 due to [CVE-2018-1000544](https://access.redhat.com/security/cve/cve-2018-1000544). [#57](https://github.com/3scale/apisonator/pull/57)
211
+
212
+ ## 2.88.1 - 2018-10-10
213
+
214
+ ### Fixed
215
+
216
+ - The Limit Headers now show the correct information when the request is
217
+ rate-limited. [#55](https://github.com/3scale/apisonator/pull/55)
218
+
219
+ ## 2.88.0 - 2018-09-19
220
+
221
+ ### Added
222
+
223
+ - Add documentation about utilization alerts. [#43](https://github.com/3scale/apisonator/pull/43)
224
+ - Set sentinel default port when no port is provided in Redis sentinel configuration. [#46](https://github.com/3scale/apisonator/pull/46)
225
+
226
+ ### Changed
227
+
228
+ - When a Service is deleted delete all of its errors. [#44](https://github.com/3scale/apisonator/pull/44)
229
+ - When a Service is deleted all its transactions are deleted. [#45](https://github.com/3scale/apisonator/pull/45)
230
+ - Allow deletion of default service when it is the only existing one. [#51](https://github.com/3scale/apisonator/pull/51)
231
+
232
+ ### Fixes
233
+
234
+ - Fix apisonator docker commands order in README. [#49](https://github.com/3scale/apisonator/pull/49)
235
+
236
+ ## 2.87.2 - 2018-07-02
237
+
238
+ ### Changed
239
+
240
+ - Allow defining Resque configuration without sentinels and defining non-localhost
241
+ Resque configuration for development and test environments. [#41](https://github.com/3scale/apisonator/pull/41)
242
+
243
+ ## 2.87.1 - 2018-06-27
244
+
245
+ ### Fixes
246
+
247
+ - Fix existing Services prior the 2.87.0 release not being set as active by
248
+ default [#39](https://github.com/3scale/apisonator/pull/39)
249
+
250
+ ## 2.87.0 - 2018-06-21
251
+
252
+ ### Added
253
+
254
+ - Services now can be active (default) or inactive. Calls on inactive services
255
+ always fail, with authorizations being denied. ([#34](https://github.com/3scale/apisonator/issues/34))
256
+
257
+ ### Changed
258
+
259
+ - Small cleaups and refactor of transactor code. ([#26](https://github.com/3scale/apisonator/pull/26))
260
+ - Allow multiple job schedulers to be executed in parallel with multiple Resque
261
+ Redis servers. ([#29](https://github.com/3scale/apisonator/pull/29))
262
+ - Revamp README.md so that it is more oriented to usage and extract dev
263
+ instructions to DEVELOPMENT.md. ([#33](https://github.com/3scale/apisonator/pull/33))
264
+
265
+ ### Fixes
266
+
267
+ - Fix a race condition in a spec that tests a race condition. ([#32](https://github.com/3scale/apisonator/pull/32))
268
+
269
+ ### Security
270
+
271
+ - Updated Sinatra to version 2.0.3 due to [CVE-2018-11627](https://nvd.nist.gov/vuln/detail/CVE-2018-11627). ([#30](https://github.com/3scale/apisonator/pull/30))
272
+ - Updated Nokogiri to version 1.8.3 due to multiple libxml2 CVEs including
273
+ [CVE-2017-18258](https://nvd.nist.gov/vuln/detail/CVE-2017-18258).
274
+ This library is only used in the test suite. ([#28](https://github.com/3scale/apisonator/pull/28), [#37](https://github.com/3scale/apisonator/pull/37))
275
+
276
+ ## 2.86.0 - 2018-05-10
277
+
278
+ ### Added
279
+
280
+ - The metrics used for reporting transactions and authorizations to the master
281
+ account are now configurable under `master.metrics.transactions` and
282
+ `master.metrics.transactions_authorize`. ([#15](https://github.com/3scale/apisonator/pull/15))
283
+ - There is now a set of rake targets for selectively run tests and specs by type
284
+ (ie. integration, unit, etc) and by specific file. ([#11](https://github.com/3scale/apisonator/issues/11))
285
+ - The `make dev` command supports specifying an env variable `PORT` to expose
286
+ the listener in that port on the local machine. ([#8](https://github.com/3scale/apisonator/pull/8))
287
+ - Minor miscellaneous improvements. ([#7](https://github.com/3scale/apisonator/pull/7), [#9](https://github.com/3scale/apisonator/pull/9), [#12](https://github.com/3scale/apisonator/issues/12), [#16](https://github.com/3scale/apisonator/pull/16), [#17](https://github.com/3scale/apisonator/pull/17), [#20](https://github.com/3scale/apisonator/pull/20), [#23](https://github.com/3scale/apisonator/pull/23), [#24](https://github.com/3scale/apisonator/pull/24))
288
+
289
+ ### Changed
290
+
291
+ - Added extra measures to avoid creating applications through the internal API
292
+ without mandatory attributes. ([#13](https://github.com/3scale/apisonator/pull/13))
293
+ - Some error conditions that produced empty or incorrect responses now behave
294
+ like other errors and output XML bodies. ([#14](https://github.com/3scale/apisonator/pull/14), [#19](https://github.com/3scale/apisonator/pull/19))
295
+
296
+ ### Fixed
297
+
298
+ - Running make in systems with a non-GNU version of `time` should stop failing
299
+ because of using options supported only by GNU time. ([#5](https://github.com/3scale/apisonator/pull/5))
300
+ - Fixed a bug that made extra requests for stats with the inexistent `seconds`
301
+ period. ([#21](https://github.com/3scale/apisonator/pull/21))
302
+ - Fixed a bug in dealing with the `notification_batch` configuration that made
303
+ Apisonator enqueue NotifyJobs continuously when the setting was left
304
+ unspecified. ([#22](https://github.com/3scale/apisonator/pull/22))
305
+
306
+ ## 2.85.0 - 2018-03-19
307
+
308
+ ### Added
309
+
310
+ - Support for specifying Redis Sentinel roles in the configuration file. This
311
+ finished support for Redis HA through Sentinels. Use settings
312
+ `config.redis.role` and `config.queues.role` to specify either `:master` or
313
+ `:slave` _if_ you are using the Sentinel support.
314
+ - Set up the CI for the project in CircleCI with multiple Ruby versions.
315
+ - `make dev` will create a container for you to work in Apisonator sync'ing the
316
+ contents with the repository.
317
+ - `make test` will optionally build the CI image from scratch.
data/Gemfile ADDED
@@ -0,0 +1,11 @@
1
+ eval_gemfile(File.expand_path('../Gemfile.base', __FILE__))
2
+
3
+ platform :ruby do
4
+ gem 'pg', '= 0.20.0'
5
+ end
6
+
7
+ gem 'aws-sdk', '= 2.4.2'
8
+ gem 'whenever', '= 0.9.7'
9
+ gem 'scientist', '= 1.0.0'
10
+ gem 'statsd-ruby', '= 1.4.0'
11
+ gem 'airbrake', '= 4.3.1', require: nil
@@ -0,0 +1,65 @@
1
+ source 'https://rubygems.org'
2
+
3
+ gemspec
4
+
5
+ # C-API only gems
6
+ #
7
+ # It is useful to tag these because not all Ruby implementations support these
8
+ # kinds of gems. In particular, gems here have NO alternative non C-API
9
+ # implementations (ie. pure Ruby, java, etc).
10
+ #
11
+ platform :ruby do
12
+ gem 'hiredis', '= 0.6.1'
13
+ gem 'yajl-ruby', '~> 1.3.1', require: 'yajl'
14
+ gem 'pry-byebug', '~> 3.5.1', groups: [:development]
15
+ end
16
+
17
+ group :test do
18
+ gem 'benchmark-ips', '~> 2.7.2'
19
+ gem 'mocha', '~> 1.3'
20
+ gem 'nokogiri', '~> 1.10.8'
21
+ gem 'pkg-config', '~> 1.1.7'
22
+ gem 'rack-test', '~> 0.8.2'
23
+ gem 'resque_unit', '~> 0.4.4', source: 'https://rubygems.org'
24
+ gem 'test-unit', '~> 3.2.6'
25
+ gem 'resque_spec', '~> 0.17.0'
26
+ gem 'timecop', '~> 0.9.1'
27
+ gem 'rspec', '~> 3.7.0', require: nil
28
+ gem 'geminabox', '~> 0.13.11', require: false
29
+ gem 'codeclimate-test-reporter', '~> 0.6.0', require: nil
30
+ gem 'async-rspec'
31
+ end
32
+
33
+ group :development do
34
+ gem 'sshkit'
35
+ gem 'source2swagger', git: 'https://github.com/3scale/source2swagger', branch: 'backend'
36
+ gem 'pry', '~> 0.11.3'
37
+ gem 'pry-doc', '~> 0.11.1'
38
+ gem 'license_finder', '~> 5'
39
+ end
40
+
41
+ group :development, :test do
42
+ gem 'rspec_api_documentation', '~> 5.0'
43
+ end
44
+
45
+ # Default server by platform
46
+ gem 'puma', git: 'https://github.com/3scale/puma', ref: 'b034371406690d3e6c2a9301c4a48bd721f3efc3'
47
+ # gems required by the runner
48
+ gem 'gli', '~> 2.16.1', require: nil
49
+ # Workers
50
+ gem 'daemons', '= 1.2.4'
51
+
52
+ # Production gems
53
+ gem 'rake', '~> 13.0'
54
+ gem 'builder', '= 3.2.3'
55
+ gem 'redis', '= 4.1.1'
56
+ # Use a patched resque to allow reusing their Airbrake Failure class
57
+ gem 'resque', git: 'https://github.com/3scale/resque', branch: '3scale'
58
+ gem 'rack', '~> 2.0.8'
59
+ gem 'sinatra', '~> 2.0.3'
60
+ gem 'sinatra-contrib', '~> 2.0.3'
61
+ # Optional external error logging services
62
+ gem 'bugsnag', '~> 6', require: nil
63
+ gem 'yabeda-prometheus', '~> 0.5.0'
64
+ gem 'async-redis', '~> 0.4.1'
65
+ gem 'falcon', '~> 0.35'
@@ -0,0 +1,319 @@
1
+ GIT
2
+ remote: https://github.com/3scale/puma
3
+ revision: b034371406690d3e6c2a9301c4a48bd721f3efc3
4
+ ref: b034371406690d3e6c2a9301c4a48bd721f3efc3
5
+ specs:
6
+ puma (2.15.3)
7
+
8
+ GIT
9
+ remote: https://github.com/3scale/resque
10
+ revision: 88839e71756ea9b6edfc9426a0af71e94109c135
11
+ branch: 3scale
12
+ specs:
13
+ resque (1.27.4)
14
+ mono_logger (~> 1.0)
15
+ multi_json (~> 1.0)
16
+ redis-namespace (~> 1.3)
17
+ sinatra (>= 0.9.2)
18
+ vegas (~> 0.1.2)
19
+
20
+ GIT
21
+ remote: https://github.com/3scale/source2swagger
22
+ revision: 9a787007577fc58b5822b55720e977cc063057fd
23
+ branch: backend
24
+ specs:
25
+ source2swagger (0.0.2)
26
+ json
27
+
28
+ PATH
29
+ remote: .
30
+ specs:
31
+ apisonator (2.100.0)
32
+
33
+ GEM
34
+ remote: https://rubygems.org/
35
+ specs:
36
+ activesupport (5.1.4)
37
+ concurrent-ruby (~> 1.0, >= 1.0.2)
38
+ i18n (~> 0.7)
39
+ minitest (~> 5.1)
40
+ tzinfo (~> 1.1)
41
+ airbrake (4.3.1)
42
+ builder
43
+ multi_json
44
+ async (1.24.2)
45
+ console (~> 1.0)
46
+ nio4r (~> 2.3)
47
+ timers (~> 4.1)
48
+ async-container (0.16.4)
49
+ async (~> 1.0)
50
+ async-io (~> 1.26)
51
+ process-group
52
+ async-http (0.50.7)
53
+ async (~> 1.23)
54
+ async-io (~> 1.27.0)
55
+ async-pool (~> 0.2)
56
+ protocol-http (~> 0.15.1)
57
+ protocol-http1 (~> 0.10.0)
58
+ protocol-http2 (~> 0.11.0)
59
+ async-http-cache (0.1.5)
60
+ async-http
61
+ protocol-http (~> 0.14)
62
+ async-io (1.27.5)
63
+ async (~> 1.14)
64
+ async-pool (0.2.0)
65
+ async (~> 1.8)
66
+ async-redis (0.4.1)
67
+ async (~> 1.8)
68
+ async-io (~> 1.10)
69
+ protocol-redis (~> 0.2.0)
70
+ async-rspec (1.13.0)
71
+ rspec (~> 3.0)
72
+ rspec-files (~> 1.0)
73
+ rspec-memory (~> 1.0)
74
+ aws-sdk (2.4.2)
75
+ aws-sdk-resources (= 2.4.2)
76
+ aws-sdk-core (2.4.2)
77
+ jmespath (~> 1.0)
78
+ aws-sdk-resources (2.4.2)
79
+ aws-sdk-core (= 2.4.2)
80
+ backports (3.11.3)
81
+ benchmark-ips (2.7.2)
82
+ bugsnag (6.6.4)
83
+ concurrent-ruby (~> 1.0)
84
+ build-environment (1.13.0)
85
+ builder (3.2.3)
86
+ byebug (9.1.0)
87
+ chronic (0.10.2)
88
+ codeclimate-test-reporter (0.6.0)
89
+ simplecov (>= 0.7.1, < 1.0.0)
90
+ coderay (1.1.2)
91
+ concurrent-ruby (1.0.5)
92
+ console (1.8.2)
93
+ daemons (1.2.4)
94
+ diff-lcs (1.3)
95
+ docile (1.1.5)
96
+ dry-initializer (3.0.3)
97
+ falcon (0.35.6)
98
+ async (~> 1.13)
99
+ async-container (~> 0.16.0)
100
+ async-http (~> 0.50.4)
101
+ async-http-cache (~> 0.1.0)
102
+ async-io (~> 1.22)
103
+ build-environment (~> 1.13)
104
+ localhost (~> 1.1)
105
+ process-metrics (~> 0.1.0)
106
+ rack (>= 1.0)
107
+ samovar (~> 2.1)
108
+ faraday (0.13.1)
109
+ multipart-post (>= 1.2, < 3)
110
+ ffi (1.12.2)
111
+ geminabox (0.13.11)
112
+ builder
113
+ faraday
114
+ httpclient (>= 2.2.7)
115
+ nesty
116
+ reentrant_flock
117
+ sinatra (>= 1.2.7)
118
+ gli (2.16.1)
119
+ hiredis (0.6.1)
120
+ httpclient (2.8.3)
121
+ i18n (0.9.1)
122
+ concurrent-ruby (~> 1.0)
123
+ jmespath (1.3.1)
124
+ json (2.1.0)
125
+ license_finder (5.9.2)
126
+ bundler
127
+ rubyzip
128
+ thor
129
+ toml (= 0.2.0)
130
+ with_env (= 1.1.0)
131
+ xml-simple
132
+ localhost (1.1.6)
133
+ mapping (1.1.1)
134
+ metaclass (0.0.4)
135
+ method_source (0.9.0)
136
+ mini_portile2 (2.4.0)
137
+ minitest (5.10.3)
138
+ mocha (1.3.0)
139
+ metaclass (~> 0.0.1)
140
+ mono_logger (1.1.0)
141
+ multi_json (1.13.1)
142
+ multipart-post (2.0.0)
143
+ mustache (1.0.5)
144
+ mustermann (1.0.2)
145
+ nesty (1.0.2)
146
+ net-scp (1.2.1)
147
+ net-ssh (>= 2.6.5)
148
+ net-ssh (4.2.0)
149
+ nio4r (2.5.2)
150
+ nokogiri (1.10.9)
151
+ mini_portile2 (~> 2.4.0)
152
+ parslet (1.8.2)
153
+ pg (0.20.0)
154
+ pkg-config (1.1.9)
155
+ power_assert (1.1.1)
156
+ process-group (1.2.1)
157
+ process-terminal (~> 0.2.0)
158
+ process-metrics (0.1.1)
159
+ process-terminal (0.2.0)
160
+ ffi
161
+ prometheus-client (1.0.0)
162
+ protocol-hpack (1.4.2)
163
+ protocol-http (0.15.1)
164
+ protocol-http1 (0.10.3)
165
+ protocol-http (~> 0.15)
166
+ protocol-http2 (0.11.6)
167
+ protocol-hpack (~> 1.4)
168
+ protocol-http (~> 0.15)
169
+ protocol-redis (0.2.0)
170
+ pry (0.11.3)
171
+ coderay (~> 1.1.0)
172
+ method_source (~> 0.9.0)
173
+ pry-byebug (3.5.1)
174
+ byebug (~> 9.1)
175
+ pry (~> 0.10)
176
+ pry-doc (0.11.1)
177
+ pry (~> 0.9)
178
+ yard (~> 0.9)
179
+ rack (2.0.9)
180
+ rack-protection (2.0.3)
181
+ rack
182
+ rack-test (0.8.2)
183
+ rack (>= 1.0, < 3)
184
+ rake (13.0.1)
185
+ redis (4.1.1)
186
+ redis-namespace (1.6.0)
187
+ redis (>= 3.0.4)
188
+ reentrant_flock (0.1.1)
189
+ resque_spec (0.17.0)
190
+ resque (>= 1.19.0)
191
+ rspec-core (>= 3.0.0)
192
+ rspec-expectations (>= 3.0.0)
193
+ rspec-mocks (>= 3.0.0)
194
+ resque_unit (0.4.8)
195
+ json (>= 1.4.6)
196
+ rspec (3.7.0)
197
+ rspec-core (~> 3.7.0)
198
+ rspec-expectations (~> 3.7.0)
199
+ rspec-mocks (~> 3.7.0)
200
+ rspec-core (3.7.0)
201
+ rspec-support (~> 3.7.0)
202
+ rspec-expectations (3.7.0)
203
+ diff-lcs (>= 1.2.0, < 2.0)
204
+ rspec-support (~> 3.7.0)
205
+ rspec-files (1.0.1)
206
+ rspec (~> 3.0)
207
+ rspec-memory (1.0.1)
208
+ rspec (~> 3.0)
209
+ rspec-mocks (3.7.0)
210
+ diff-lcs (>= 1.2.0, < 2.0)
211
+ rspec-support (~> 3.7.0)
212
+ rspec-support (3.7.0)
213
+ rspec_api_documentation (5.1.0)
214
+ activesupport (>= 3.0.0)
215
+ mustache (~> 1.0, >= 0.99.4)
216
+ rspec (~> 3.0)
217
+ rubyzip (2.0.0)
218
+ samovar (2.1.4)
219
+ console (~> 1.0)
220
+ mapping (~> 1.0)
221
+ scientist (1.0.0)
222
+ simplecov (0.15.1)
223
+ docile (~> 1.1.0)
224
+ json (>= 1.8, < 3)
225
+ simplecov-html (~> 0.10.0)
226
+ simplecov-html (0.10.2)
227
+ sinatra (2.0.3)
228
+ mustermann (~> 1.0)
229
+ rack (~> 2.0)
230
+ rack-protection (= 2.0.3)
231
+ tilt (~> 2.0)
232
+ sinatra-contrib (2.0.3)
233
+ activesupport (>= 4.0.0)
234
+ backports (>= 2.8.2)
235
+ multi_json
236
+ mustermann (~> 1.0)
237
+ rack-protection (= 2.0.3)
238
+ sinatra (= 2.0.3)
239
+ tilt (>= 1.3, < 3)
240
+ sshkit (1.15.1)
241
+ net-scp (>= 1.1.2)
242
+ net-ssh (>= 2.8.0)
243
+ statsd-ruby (1.4.0)
244
+ test-unit (3.2.6)
245
+ power_assert
246
+ thor (0.20.3)
247
+ thread_safe (0.3.6)
248
+ tilt (2.0.8)
249
+ timecop (0.9.1)
250
+ timers (4.3.0)
251
+ toml (0.2.0)
252
+ parslet (~> 1.8.0)
253
+ tzinfo (1.2.4)
254
+ thread_safe (~> 0.1)
255
+ vegas (0.1.11)
256
+ rack (>= 1.0.0)
257
+ whenever (0.9.7)
258
+ chronic (>= 0.6.3)
259
+ with_env (1.1.0)
260
+ xml-simple (1.1.5)
261
+ yabeda (0.5.0)
262
+ concurrent-ruby
263
+ dry-initializer
264
+ yabeda-prometheus (0.5.0)
265
+ prometheus-client (~> 1.0)
266
+ yabeda (~> 0.5)
267
+ yajl-ruby (1.3.1)
268
+ yard (0.9.20)
269
+
270
+ PLATFORMS
271
+ ruby
272
+
273
+ DEPENDENCIES
274
+ airbrake (= 4.3.1)
275
+ apisonator!
276
+ async-redis (~> 0.4.1)
277
+ async-rspec
278
+ aws-sdk (= 2.4.2)
279
+ benchmark-ips (~> 2.7.2)
280
+ bugsnag (~> 6)
281
+ builder (= 3.2.3)
282
+ codeclimate-test-reporter (~> 0.6.0)
283
+ daemons (= 1.2.4)
284
+ falcon (~> 0.35)
285
+ geminabox (~> 0.13.11)
286
+ gli (~> 2.16.1)
287
+ hiredis (= 0.6.1)
288
+ license_finder (~> 5)
289
+ mocha (~> 1.3)
290
+ nokogiri (~> 1.10.8)
291
+ pg (= 0.20.0)
292
+ pkg-config (~> 1.1.7)
293
+ pry (~> 0.11.3)
294
+ pry-byebug (~> 3.5.1)
295
+ pry-doc (~> 0.11.1)
296
+ puma!
297
+ rack (~> 2.0.8)
298
+ rack-test (~> 0.8.2)
299
+ rake (~> 13.0)
300
+ redis (= 4.1.1)
301
+ resque!
302
+ resque_spec (~> 0.17.0)
303
+ resque_unit (~> 0.4.4)!
304
+ rspec (~> 3.7.0)
305
+ rspec_api_documentation (~> 5.0)
306
+ scientist (= 1.0.0)
307
+ sinatra (~> 2.0.3)
308
+ sinatra-contrib (~> 2.0.3)
309
+ source2swagger!
310
+ sshkit
311
+ statsd-ruby (= 1.4.0)
312
+ test-unit (~> 3.2.6)
313
+ timecop (~> 0.9.1)
314
+ whenever (= 0.9.7)
315
+ yabeda-prometheus (~> 0.5.0)
316
+ yajl-ruby (~> 1.3.1)
317
+
318
+ BUNDLED WITH
319
+ 1.16.6