blobsterix 0.0.14 → 0.0.19

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 (41) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.txt +9 -0
  3. data/README.md +5 -1
  4. data/blobsterix.gemspec +1 -0
  5. data/lib/blobsterix/blob/blob_api.rb +1 -0
  6. data/lib/blobsterix/blob/blob_url_helper.rb +2 -39
  7. data/lib/blobsterix/helper/blob_access.rb +9 -10
  8. data/lib/blobsterix/helper/config_loader.rb +10 -18
  9. data/lib/blobsterix/helper/directory_list.rb +131 -0
  10. data/lib/blobsterix/helper/http.rb +13 -14
  11. data/lib/blobsterix/helper/jsonizer.rb +45 -0
  12. data/lib/blobsterix/helper/logable.rb +25 -0
  13. data/lib/blobsterix/helper/murmur.rb +14 -0
  14. data/lib/blobsterix/helper/simple_proxy.rb +11 -0
  15. data/lib/blobsterix/helper/template_renderer.rb +4 -0
  16. data/lib/blobsterix/helper/url_helper.rb +41 -0
  17. data/lib/blobsterix/router/app_router.rb +15 -65
  18. data/lib/blobsterix/s3/s3_api.rb +20 -6
  19. data/lib/blobsterix/s3/s3_auth.rb +32 -0
  20. data/lib/blobsterix/s3/s3_auth_key_store.rb +14 -0
  21. data/lib/blobsterix/s3/s3_auth_v2.rb +62 -0
  22. data/lib/blobsterix/s3/s3_auth_v2_helper.rb +42 -0
  23. data/lib/blobsterix/s3/s3_auth_v2_query.rb +37 -0
  24. data/lib/blobsterix/s3/s3_auth_v4.rb +33 -0
  25. data/lib/blobsterix/s3/s3_url_helper.rb +1 -38
  26. data/lib/blobsterix/service.rb +3 -9
  27. data/lib/blobsterix/storage/bucket.rb +6 -3
  28. data/lib/blobsterix/storage/bucket_entry.rb +11 -1
  29. data/lib/blobsterix/storage/cache.rb +13 -21
  30. data/lib/blobsterix/storage/file_system.rb +37 -40
  31. data/lib/blobsterix/storage/storage.rb +2 -2
  32. data/lib/blobsterix/transformation/image_transformation.rb +134 -386
  33. data/lib/blobsterix/version.rb +1 -1
  34. data/lib/blobsterix.rb +22 -1
  35. data/spec/lib/helper/directory_list_spec.rb +51 -0
  36. data/spec/lib/s3/s3_api_spec.rb +27 -0
  37. data/spec/lib/s3/s3_auth_spec.rb +181 -0
  38. data/spec/lib/storage/file_system_spec.rb +14 -0
  39. data/spec/spec_helper.rb +1 -0
  40. data/templates/storage_template.rb +2 -2
  41. metadata +30 -2
@@ -1,439 +1,187 @@
1
1
  module Blobsterix::Transformations::Impl
2
- class ColorSpaceImage < Blobsterix::Transformations::Transformation
3
- def name()
4
- "grayscale"
5
- end
6
- def input_type()
7
- @input_type ||= Blobsterix::AcceptType.new "image/*"
8
- end
9
-
10
- def output_type()
11
- @output_type ||= Blobsterix::AcceptType.new "image/*"
12
- end
2
+ def self.create_simple_trafo(name_, input, output, is_format_=false, &block)
3
+ trafo = ::Class.new Blobsterix::Transformations::Transformation do
13
4
 
14
- def transform(input_path, target_path, value)
15
- image = MiniMagick::Image.open(input_path)
16
- image.colorspace "gray"
17
- image.write target_path
18
- end
19
- end
20
- class RotateImage < Blobsterix::Transformations::Transformation
21
- def name()
22
- "rotate"
23
- end
24
- def input_type()
25
- @input_type ||= Blobsterix::AcceptType.new "image/*"
26
- end
27
-
28
- def output_type()
29
- @output_type ||= Blobsterix::AcceptType.new "image/*"
30
- end
5
+ def self.name=(obj)
6
+ @name=obj
7
+ end
31
8
 
32
- def transform(input_path, target_path, value)
33
- image = MiniMagick::Image.open(input_path)
34
- image.combine_options do |c|
35
- c.background "none"
36
- c.rotate value
9
+ def self.name_
10
+ @name
11
+ end
12
+
13
+ def self.is_format=(obj)
14
+ @is_format=obj
37
15
  end
38
- image.write target_path
39
- end
40
- end
41
16
 
42
- class AdaptiveResizeImage < Blobsterix::Transformations::Transformation
43
- def name()
44
- "aresize"
45
- end
46
- def input_type()
47
- @input_type ||= Blobsterix::AcceptType.new "image/*"
48
- end
17
+ def self.is_format_
18
+ @is_format
19
+ end
20
+
21
+ def self.setTypes(input,output)
22
+ @input= ::Blobsterix::AcceptType.new input
23
+ @output= ::Blobsterix::AcceptType.new output
24
+ end
25
+
26
+ def self.input_type_
27
+ @input
28
+ end
29
+
30
+ def self.output_type_
31
+ @input
32
+ end
49
33
 
50
- def output_type()
51
- @output_type ||= Blobsterix::AcceptType.new "image/*"
52
- end
34
+ def self.body=(obj)
35
+ @body=obj
36
+ end
53
37
 
54
- def transform(input_path, target_path, value)
55
- image = MiniMagick::Image.open(input_path)
56
- image.adaptive_resize value
57
- image.write target_path
58
- end
59
- end
38
+ def self.body_
39
+ @body
40
+ end
60
41
 
61
- class ResizeImage < Blobsterix::Transformations::Transformation
62
- def name()
63
- "resize"
64
- end
65
- def input_type()
66
- @input_type ||= Blobsterix::AcceptType.new "image/*"
67
- end
42
+ def initialize
43
+ end
68
44
 
69
- def output_type()
70
- @output_type ||= Blobsterix::AcceptType.new "image/*"
71
- end
45
+ def name
46
+ self.class.name_
47
+ end
72
48
 
73
- def transform(input_path, target_path, value)
74
- image = MiniMagick::Image.open(input_path)
75
- image.resize value
76
- image.write target_path
77
- end
78
- end
49
+ def is_format?
50
+ self.class.is_format_
51
+ end
79
52
 
80
- class MaxsizeImage < Blobsterix::Transformations::Transformation
81
- def name()
82
- "resizemax"
83
- end
84
- def input_type()
85
- @input_type ||= Blobsterix::AcceptType.new "image/*"
86
- end
53
+ def input_type
54
+ self.class.input_type_
55
+ end
87
56
 
88
- def output_type()
89
- @output_type ||= Blobsterix::AcceptType.new "image/*"
90
- end
57
+ def output_type
58
+ self.class.output_type_
59
+ end
91
60
 
92
- def transform(input_path, target_path, value)
93
- image = MiniMagick::Image.open(input_path)
94
- image.resize "#{value}>"
95
- image.write target_path
61
+ def transform(input_path, target_path, value)
62
+ self.class.body_.call input_path, target_path, value
63
+ end
96
64
  end
65
+ trafo.setTypes(input, output)
66
+ trafo.is_format=is_format_
67
+ trafo.body=block
68
+ trafo.name=name_
69
+ ::Blobsterix::Transformations::Impl.const_set("#{name_.capitalize}Transformation", trafo)
97
70
  end
98
71
 
99
- class ShrinkImage < Blobsterix::Transformations::Transformation
100
- def name()
101
- "shrink"
102
- end
103
- def input_type()
104
- @input_type ||= Blobsterix::AcceptType.new "image/*"
105
- end
106
-
107
- def output_type()
108
- @output_type ||= Blobsterix::AcceptType.new "image/*"
109
- end
110
-
111
- def transform(input_path, target_path, value)
112
- image = MiniMagick::Image.open(input_path)
113
- image.resize "#{image[:width]/value.to_i}x#{image[:height]/value.to_i}"
114
- image.write target_path
115
- end
72
+ create_simple_trafo("grayscale", "image/*", "image/*", false) do |input_path, target_path, value|
73
+ puts "grayscale"
74
+ image = MiniMagick::Image.open(input_path)
75
+ image.colorspace "gray"
76
+ image.write target_path
116
77
  end
117
78
 
118
- class StripImage < Blobsterix::Transformations::Transformation
119
- def name()
120
- "strip"
121
- end
122
- def input_type()
123
- @input_type ||= Blobsterix::AcceptType.new "image/*"
124
- end
125
-
126
- def output_type()
127
- @output_type ||= Blobsterix::AcceptType.new "image/*"
128
- end
129
-
130
- def is_format?()
131
- true
132
- end
133
-
134
- def transform(input_path, target_path, value)
135
- image = MiniMagick::Image.open(input_path)
136
- image.strip
137
- image.write target_path
138
- # system("convert #{input_path} -strip #{target_path}")
139
- end
79
+ create_simple_trafo("resize", "image/*", "image/*", false) do |input_path, target_path, value|
80
+ image = MiniMagick::Image.open(input_path)
81
+ image.resize value
82
+ image.write target_path
140
83
  end
141
84
 
142
- class CropImage < Blobsterix::Transformations::Transformation
143
- def name()
144
- "crop"
145
- end
146
- def input_type()
147
- @input_type ||= Blobsterix::AcceptType.new "image/*"
148
- end
149
-
150
- def output_type()
151
- @output_type ||= Blobsterix::AcceptType.new "image/*"
152
- end
153
-
154
- def transform(input_path, target_path, value)
155
- image = MiniMagick::Image.open(input_path)
156
- image.crop value
157
- image.write target_path
158
- end
85
+ create_simple_trafo("aresize", "image/*", "image/*", false) do |input_path, target_path, value|
86
+ image = MiniMagick::Image.open(input_path)
87
+ image.adaptive_resize value
88
+ image.write target_path
159
89
  end
160
90
 
161
- class Image2HTML < Blobsterix::Transformations::Transformation
162
- def input_type()
163
- @input_type ||= Blobsterix::AcceptType.new "image/*"
164
- end
165
-
166
- def output_type()
167
- @output_type ||= Blobsterix::AcceptType.new "text/html"
168
- end
169
-
170
- def is_format?()
171
- true
172
- end
173
-
174
- def transform(input_path, target_path, value)
175
- type = "image/*"
176
- File.open(input_path) {|file|
177
- type = MimeMagic.by_magic(file).type
178
- }
179
-
180
- image = type === "image/webp" ? {:width => "unknown", :height => "unknown"} : MiniMagick::Image.open(input_path)
181
- File.open(target_path, "w") {|file|
182
- file.write("<html><body>Mimetype: #{type}<br>Width: #{image[:width]}<br>Height: #{image[:height]}</body></html>")
183
- }
184
- end
91
+ create_simple_trafo("resizemax", "image/*", "image/*", false) do |input_path, target_path, value|
92
+ image = MiniMagick::Image.open(input_path)
93
+ image.resize "#{value}>"
94
+ image.write target_path
185
95
  end
186
96
 
187
- class Image2Json < Blobsterix::Transformations::Transformation
188
- def name()
189
- "json"
190
- end
191
-
192
- def input_type()
193
- @input_type ||= Blobsterix::AcceptType.new "image/*"
194
- end
195
-
196
- def output_type()
197
- @output_type ||= Blobsterix::AcceptType.new "text/json"
198
- end
199
-
200
- def is_format?()
201
- true
202
- end
203
-
204
- def transform(input_path, target_path, value)
205
- type = "image/*"
206
- File.open(input_path) {|file|
207
- type = MimeMagic.by_magic(file).type
208
- }
209
-
210
- image = type === "image/webp" ? {:width => "unknown", :height => "unknown"} : MiniMagick::Image.open(input_path)
211
- File.open(target_path, "w") {|file|
212
- file.write({:width => image[:width], :height => image[:height]}.merge(Blobsterix::Storage::FileSystemMetaData.new(input_path).as_json).to_json)
213
- }
97
+ create_simple_trafo("rotate", "image/*", "image/*", false) do |input_path, target_path, value|
98
+ image = MiniMagick::Image.open(input_path)
99
+ image.combine_options do |c|
100
+ c.background "none"
101
+ c.rotate value
214
102
  end
103
+ image.write target_path
215
104
  end
216
105
 
217
- class Image2Json < Blobsterix::Transformations::Transformation
218
- def name()
219
- "json_all"
220
- end
221
-
222
- def input_type()
223
- @input_type ||= Blobsterix::AcceptType.new "*/*"
224
- end
225
-
226
- def output_type()
227
- @output_type ||= Blobsterix::AcceptType.new "text/json"
228
- end
229
-
230
- def is_format?()
231
- true
232
- end
233
-
234
- def transform(input_path, target_path, value)
235
- File.open(target_path, "w") {|file|
236
- file.write(Blobsterix::Storage::FileSystemMetaData.new(input_path).to_json)
237
- }
238
- end
106
+ create_simple_trafo("shrink", "image/*", "image/*", false) do |input_path, target_path, value|
107
+ image = MiniMagick::Image.open(input_path)
108
+ image.resize "#{image[:width]/value.to_i}x#{image[:height]/value.to_i}"
109
+ image.write target_path
239
110
  end
240
111
 
241
- class RawTransformation < Blobsterix::Transformations::Transformation
242
- def name()
243
- "raw"
244
- end
245
-
246
- def is_format?()
247
- true
248
- end
249
-
250
- def input_type()
251
- @input_type ||= Blobsterix::AcceptType.new "image/*"
252
- end
253
-
254
- def output_type()
255
- @output_type ||= Blobsterix::AcceptType.new "image/*"
256
- end
257
-
258
- def transform(input_path, target_path, value)
259
- raise StandardError.new($?) unless system("cp \"#{input_path}\" \"#{target_path}\"")
260
- end
112
+ create_simple_trafo("strip", "image/*", "image/*", true) do |input_path, target_path, value|
113
+ image = MiniMagick::Image.open(input_path)
114
+ image.strip
115
+ image.write target_path
261
116
  end
262
117
 
263
- class AsciiTransformation < Blobsterix::Transformations::Transformation
264
- def name()
265
- "ascii"
266
- end
267
-
268
- def is_format?()
269
- true
270
- end
271
-
272
- def input_type()
273
- @input_type ||= Blobsterix::AcceptType.new "image/*"
274
- end
275
-
276
- def output_type()
277
- @output_type ||= Blobsterix::AcceptType.new "text/plain"
278
- end
279
-
280
- def transform(input_path, target_path, value)
281
- raise StandardError.new($?) unless system("convert \"#{input_path}\" jpg:- | jp2a --width=#{value and value.size > 0 ? value : 100} - > \"#{target_path}\"")
282
- end
118
+ create_simple_trafo("crop", "image/*", "image/*", false) do |input_path, target_path, value|
119
+ image = MiniMagick::Image.open(input_path)
120
+ image.crop value
121
+ image.write target_path
283
122
  end
284
123
 
285
- class AsciiHTMLTransformation < Blobsterix::Transformations::Transformation
286
- def name()
287
- "asciihtml"
288
- end
289
-
290
- def is_format?()
291
- true
292
- end
293
-
294
- def input_type()
295
- @input_type ||= Blobsterix::AcceptType.new "image/*"
296
- end
297
-
298
- def output_type()
299
- @output_type ||= Blobsterix::AcceptType.new "text/plain"
300
- end
124
+ create_simple_trafo("image2HTML", "image/*", "text/html", true) do |input_path, target_path, value|
125
+ type = "image/*"
126
+ File.open(input_path) {|file|
127
+ type = MimeMagic.by_magic(file).type
128
+ }
301
129
 
302
- def transform(input_path, target_path, value)
303
- parts = value.split("x")[0]
304
- lines = parts[0]
305
- em = parts.length > 1 ? parts[1].to_i : 1
306
- raise StandardError.new($?) unless system("convert \"#{input_path}\" jpg:- | jp2a --width=#{lines and lines.to_i > 0 ? value : 100} - > \"#{target_path}\"")
307
- text = File.read(target_path)
308
- File.write(target_path, "<html><body style='font-size: #{em}em'><pre>#{text.gsub("\n", "<br>")}</pre></body></html>")
309
- end
130
+ image = type === "image/webp" ? {:width => "unknown", :height => "unknown"} : MiniMagick::Image.open(input_path)
131
+ File.open(target_path, "w") {|file|
132
+ file.write("<html><body>Mimetype: #{type}<br>Width: #{image[:width]}<br>Height: #{image[:height]}</body></html>")
133
+ }
310
134
  end
311
135
 
312
- class PngTransformation < Blobsterix::Transformations::Transformation
313
- def name()
314
- "png"
315
- end
316
-
317
- def is_format?()
318
- true
319
- end
320
-
321
- def input_type()
322
- @input_type ||= Blobsterix::AcceptType.new "image/*"
323
- end
324
-
325
- def output_type()
326
- @output_type ||= Blobsterix::AcceptType.new "image/png"
327
- end
136
+ create_simple_trafo("json", "image/*", "text/json", true) do |input_path, target_path, value|
137
+ type = "image/*"
138
+ File.open(input_path) {|file|
139
+ type = MimeMagic.by_magic(file).type
140
+ }
328
141
 
329
- def transform(input_path, target_path, value)
330
- raise StandardError.new($?) unless system("convert \"#{input_path}\" png:\"#{target_path}\"")
331
- end
142
+ image = type === "image/webp" ? {:width => "unknown", :height => "unknown"} : MiniMagick::Image.open(input_path)
143
+ File.open(target_path, "w") {|file|
144
+ file.write({:width => image[:width], :height => image[:height]}.merge(Blobsterix::Storage::FileSystemMetaData.new(input_path).as_json).to_json)
145
+ }
332
146
  end
333
147
 
334
- class JPegTransformation < Blobsterix::Transformations::Transformation
335
- def name()
336
- "jpg"
337
- end
338
-
339
- def is_format?()
340
- true
341
- end
342
-
343
- def input_type()
344
- @input_type ||= Blobsterix::AcceptType.new "image/*"
345
- end
346
-
347
- def output_type()
348
- @output_type ||= Blobsterix::AcceptType.new "image/jpeg"
349
- end
350
-
351
- def transform(input_path, target_path, value)
352
- raise StandardError.new($?) unless system("convert \"#{input_path}\" jpg:\"#{target_path}\"")
353
- end
148
+ create_simple_trafo("jsonall", "image/*", "text/json", true) do |input_path, target_path, value|
149
+ File.open(target_path, "w") {|file|
150
+ file.write(Blobsterix::Storage::FileSystemMetaData.new(input_path).to_json)
151
+ }
354
152
  end
355
153
 
356
- class GifTransformation < Blobsterix::Transformations::Transformation
357
- def name()
358
- "gif"
359
- end
360
-
361
- def is_format?()
362
- true
363
- end
364
-
365
- def input_type()
366
- @input_type ||= Blobsterix::AcceptType.new "image/*"
367
- end
368
-
369
- def output_type()
370
- @output_type ||= Blobsterix::AcceptType.new "image/gif"
371
- end
372
-
373
- def transform(input_path, target_path, value)
374
- raise StandardError.new($?) unless system("convert \"#{input_path}\" gif:\"#{target_path}\"")
375
- end
154
+ create_simple_trafo("raw", "image/*", "image/*", true) do |input_path, target_path, value|
155
+ raise StandardError.new($?) unless system("cp \"#{input_path}\" \"#{target_path}\"")
376
156
  end
377
157
 
378
- class WebPTransformation < Blobsterix::Transformations::Transformation
379
- def name()
380
- "webp"
381
- end
382
-
383
- def is_format?()
384
- true
385
- end
386
-
387
- def input_type()
388
- @input_type ||= Blobsterix::AcceptType.new "image/*"
389
- end
390
-
391
- def output_type()
392
- @output_type ||= Blobsterix::AcceptType.new "image/webp"
393
- end
394
-
395
- def transform(input_path, target_path, value)
396
- raise StandardError.new($?) unless system("cwebp \"#{input_path}\" -o \"#{target_path}\"")
397
- #system("cp #{input_path} #{target_path}")
398
- end
158
+ create_simple_trafo("ascii", "image/*", "text/plain", true) do |input_path, target_path, value|
159
+ raise StandardError.new($?) unless system("convert \"#{input_path}\" jpg:- | jp2a --width=#{value and value.size > 0 ? value : 100} - > \"#{target_path}\"")
399
160
  end
400
161
 
401
- class RenderTextTransformation < Blobsterix::Transformations::Transformation
402
- def name()
403
- "text"
404
- end
405
-
406
- def input_type()
407
- @input_type ||= Blobsterix::AcceptType.new "image/*"
408
- end
409
-
410
- def output_type()
411
- @output_type ||= Blobsterix::AcceptType.new "image/*"
412
- end
162
+ create_simple_trafo("png", "image/*", "image/png", true) do |input_path, target_path, value|
163
+ raise StandardError.new($?) unless system("convert \"#{input_path}\" png:\"#{target_path}\"")
164
+ end
413
165
 
414
- def transform(input_path, target_path, value)
415
- puts "Render text"
416
- raise StandardError.new($?) unless system("convert \"#{input_path}\" -pointsize 20 -draw \"gravity center fill white text 0,12 '#{value.gsub("_", " ").gsub("\"", "'")}'\" \"#{target_path}\"")
417
- end
166
+ create_simple_trafo("jpg", "image/*", "image/jpeg", true) do |input_path, target_path, value|
167
+ raise StandardError.new($?) unless system("convert \"#{input_path}\" jpg:\"#{target_path}\"")
418
168
  end
419
169
 
420
- class SleepTransformation < Blobsterix::Transformations::Transformation
421
- def name()
422
- "sleep"
423
- end
170
+ create_simple_trafo("gif", "image/*", "image/gif", true) do |input_path, target_path, value|
171
+ raise StandardError.new($?) unless system("convert \"#{input_path}\" gif:\"#{target_path}\"")
172
+ end
424
173
 
425
- def input_type()
426
- @input_type ||= Blobsterix::AcceptType.new "image/*"
427
- end
174
+ create_simple_trafo("webp", "image/*", "image/webp", true) do |input_path, target_path, value|
175
+ raise StandardError.new($?) unless system("cwebp \"#{input_path}\" -o \"#{target_path}\"")
176
+ end
428
177
 
429
- def output_type()
430
- @output_type ||= Blobsterix::AcceptType.new "image/*"
431
- end
178
+ create_simple_trafo("text", "image/*", "image/*", true) do |input_path, target_path, value|
179
+ raise StandardError.new($?) unless system("convert \"#{input_path}\" -pointsize 20 -draw \"gravity center fill white text 0,12 '#{value.gsub("_", " ").gsub("\"", "'")}'\" \"#{target_path}\"")
180
+ end
432
181
 
433
- def transform(input_path, target_path, value)
434
- p "SLEEEP"
435
- sleep(value.to_i)
436
- raise StandardError.new($?) unless system("cp \"#{input_path}\" \"#{target_path}\"")
437
- end
182
+ create_simple_trafo("sleep", "image/*", "image/*", true) do |input_path, target_path, value|
183
+ p "SLEEEP"
184
+ sleep(value.to_i)
185
+ raise StandardError.new($?) unless system("cp \"#{input_path}\" \"#{target_path}\"")
438
186
  end
439
187
  end
@@ -1,3 +1,3 @@
1
1
  module Blobsterix
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.19"
3
3
  end
data/lib/blobsterix.rb CHANGED
@@ -17,8 +17,11 @@ require 'mini_magick'
17
17
  require 'json'
18
18
  require 'logger'
19
19
  require 'erb'
20
+ require 'openssl'
21
+ require 'base64'
20
22
  require 'goliath/api'
21
23
 
24
+
22
25
  #utility
23
26
  require 'blobsterix/mimemagic/tables'
24
27
  require 'blobsterix/mimemagic/version'
@@ -30,10 +33,14 @@ require 'blobsterix/helper/accept_type'
30
33
  require 'blobsterix/helper/data_response'
31
34
  require 'blobsterix/helper/murmur'
32
35
  require 'blobsterix/helper/logable'
36
+ require 'blobsterix/helper/directory_list'
33
37
  require 'blobsterix/helper/blob_access'
38
+ require 'blobsterix/helper/simple_proxy'
34
39
  require 'blobsterix/helper/status_info'
35
40
  require 'blobsterix/helper/template_renderer'
36
41
  require 'blobsterix/helper/config_loader'
42
+ require 'blobsterix/helper/url_helper'
43
+ require 'blobsterix/helper/jsonizer'
37
44
 
38
45
  #router base
39
46
  require 'blobsterix/router/app_router'
@@ -42,6 +49,12 @@ require 'blobsterix/router/app_router'
42
49
  require 'blobsterix/s3/s3_url_helper'
43
50
  require 'blobsterix/blob/blob_url_helper'
44
51
  require 'blobsterix/status/status_url_helper'
52
+ require 'blobsterix/s3/s3_auth_key_store'
53
+ require 'blobsterix/s3/s3_auth_v2_helper'
54
+ require 'blobsterix/s3/s3_auth_v2'
55
+ require 'blobsterix/s3/s3_auth_v2_query'
56
+ require 'blobsterix/s3/s3_auth_v4'
57
+ require 'blobsterix/s3/s3_auth'
45
58
 
46
59
  #apis
47
60
  require 'blobsterix/s3/s3_api'
@@ -86,7 +99,7 @@ module Blobsterix
86
99
  end
87
100
 
88
101
  def self.logger
89
- @logger ||= Logger.new(STDOUT)
102
+ Thread.current[:in_fiber_logger] ||= BlobsterixLogger.new((@logger||Logger.new(STDOUT)),Logable.next_id)
90
103
  end
91
104
 
92
105
  def self.storage_dir
@@ -150,6 +163,14 @@ module Blobsterix
150
163
  @decrypt_trafo=obj
151
164
  end
152
165
 
166
+ def self.secret_key_store
167
+ @secret_key_store
168
+ end
169
+
170
+ def self.secret_key_store=(obj)
171
+ @secret_key_store=obj
172
+ end
173
+
153
174
  def self.decrypt_trafo(blob_access,trafo_string,logger)
154
175
  @decrypt_trafo||=lambda{|b,t,l|t}
155
176
  if !trafo_string