filestack 2.1.0 → 2.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +2 -2
- data/VERSION +1 -1
- data/docs/AV.html +557 -0
- data/docs/Filestack.html +115 -0
- data/docs/Filestack/Ruby.html +115 -0
- data/docs/FilestackClient.html +702 -0
- data/docs/FilestackCommon.html +884 -0
- data/docs/FilestackConfig.html +197 -0
- data/docs/FilestackFilelink.html +1277 -0
- data/docs/FilestackSecurity.html +654 -0
- data/docs/IntelligentState.html +729 -0
- data/docs/IntelligentUtils.html +1639 -0
- data/docs/MultipartUploadUtils.html +1543 -0
- data/docs/Transform.html +1152 -0
- data/docs/TransformConfig.html +138 -0
- data/docs/TransformUtils.html +272 -0
- data/docs/UploadUtils.html +673 -0
- data/docs/_index.html +227 -0
- data/docs/class_list.html +51 -0
- data/docs/css/common.css +1 -0
- data/docs/css/full_list.css +58 -0
- data/docs/css/style.css +492 -0
- data/docs/file.README.html +210 -0
- data/docs/file_list.html +56 -0
- data/docs/frames.html +17 -0
- data/docs/index.html +210 -0
- data/docs/js/app.js +248 -0
- data/docs/js/full_list.js +216 -0
- data/docs/js/jquery.js +4 -0
- data/docs/method_list.html +643 -0
- data/docs/top-level-namespace.html +145 -0
- data/examples/file_transformations.rb +6 -0
- data/examples/intelligent_upload.rb +7 -0
- data/examples/normal_upload.rb +5 -0
- data/examples/upload_external_url.rb +7 -0
- data/examples/upload_with_security.rb +6 -0
- data/examples/video_convert.rb +10 -0
- data/filestack-ruby.gemspec +1 -0
- data/lib/filestack/config.rb +9 -5
- data/lib/filestack/mixins/filestack_common.rb +17 -1
- data/lib/filestack/models/filelink.rb +8 -1
- data/lib/filestack/models/filestack_client.rb +17 -3
- data/lib/filestack/ruby/version.rb +1 -1
- data/lib/filestack/utils/multipart_upload_utils.rb +91 -36
- data/lib/filestack/utils/utils.rb +309 -1
- metadata +52 -3
@@ -0,0 +1,654 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: FilestackSecurity
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.9
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
|
16
|
+
|
17
|
+
<script type="text/javascript" charset="utf-8">
|
18
|
+
pathId = "FilestackSecurity";
|
19
|
+
relpath = '';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="_index.html">Index (F)</a> »
|
40
|
+
|
41
|
+
|
42
|
+
<span class="title">FilestackSecurity</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: FilestackSecurity
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">FilestackSecurity</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/filestack/models/filestack_security.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>This class represents a Filestack Security object that you must passed in
|
106
|
+
with your calls if your account has security enabled. You can manage your
|
107
|
+
Filestack app's security and secret by logging into the Filestack Dev
|
108
|
+
portal.</p>
|
109
|
+
|
110
|
+
|
111
|
+
</div>
|
112
|
+
</div>
|
113
|
+
<div class="tags">
|
114
|
+
|
115
|
+
|
116
|
+
</div>
|
117
|
+
<h2>Constant Summary</h2>
|
118
|
+
<dl class="constants">
|
119
|
+
|
120
|
+
<dt id="DEFAULT_EXPIRY-constant" class="">DEFAULT_EXPIRY =
|
121
|
+
|
122
|
+
</dt>
|
123
|
+
<dd><pre class="code"><span class='int'>3600</span></pre></dd>
|
124
|
+
|
125
|
+
</dl>
|
126
|
+
|
127
|
+
|
128
|
+
|
129
|
+
|
130
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
131
|
+
<ul class="summary">
|
132
|
+
|
133
|
+
<li class="public ">
|
134
|
+
<span class="summary_signature">
|
135
|
+
|
136
|
+
<a href="#policy-instance_method" title="#policy (instance method)">#<strong>policy</strong> ⇒ Object </a>
|
137
|
+
|
138
|
+
|
139
|
+
|
140
|
+
</span>
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
|
153
|
+
<span class="summary_desc"><div class='inline'>
|
154
|
+
<p>Returns the value of attribute policy.</p>
|
155
|
+
</div></span>
|
156
|
+
|
157
|
+
</li>
|
158
|
+
|
159
|
+
|
160
|
+
<li class="public ">
|
161
|
+
<span class="summary_signature">
|
162
|
+
|
163
|
+
<a href="#signature-instance_method" title="#signature (instance method)">#<strong>signature</strong> ⇒ Object </a>
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
</span>
|
168
|
+
|
169
|
+
|
170
|
+
|
171
|
+
|
172
|
+
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
<span class="summary_desc"><div class='inline'>
|
181
|
+
<p>Returns the value of attribute signature.</p>
|
182
|
+
</div></span>
|
183
|
+
|
184
|
+
</li>
|
185
|
+
|
186
|
+
|
187
|
+
</ul>
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
|
192
|
+
|
193
|
+
<h2>
|
194
|
+
Instance Method Summary
|
195
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
196
|
+
</h2>
|
197
|
+
|
198
|
+
<ul class="summary">
|
199
|
+
|
200
|
+
<li class="public ">
|
201
|
+
<span class="summary_signature">
|
202
|
+
|
203
|
+
<a href="#generate-instance_method" title="#generate (instance method)">#<strong>generate</strong>(secret, options) ⇒ Object </a>
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
</span>
|
208
|
+
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
|
214
|
+
|
215
|
+
|
216
|
+
|
217
|
+
<span class="summary_desc"><div class='inline'>
|
218
|
+
<p>Generate the security policy and signature given a string and options.</p>
|
219
|
+
</div></span>
|
220
|
+
|
221
|
+
</li>
|
222
|
+
|
223
|
+
|
224
|
+
<li class="public ">
|
225
|
+
<span class="summary_signature">
|
226
|
+
|
227
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(secret, options: {}) ⇒ FilestackSecurity </a>
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
</span>
|
232
|
+
|
233
|
+
|
234
|
+
<span class="note title constructor">constructor</span>
|
235
|
+
|
236
|
+
|
237
|
+
|
238
|
+
|
239
|
+
|
240
|
+
|
241
|
+
|
242
|
+
|
243
|
+
<span class="summary_desc"><div class='inline'>
|
244
|
+
<p>Initialize FilestackSecurity object.</p>
|
245
|
+
</div></span>
|
246
|
+
|
247
|
+
</li>
|
248
|
+
|
249
|
+
|
250
|
+
<li class="public ">
|
251
|
+
<span class="summary_signature">
|
252
|
+
|
253
|
+
<a href="#sign_url-instance_method" title="#sign_url (instance method)">#<strong>sign_url</strong>(url) ⇒ String </a>
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
</span>
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
|
266
|
+
|
267
|
+
<span class="summary_desc"><div class='inline'>
|
268
|
+
<p>Sign the URL by appending policy and signature URL parameters.</p>
|
269
|
+
</div></span>
|
270
|
+
|
271
|
+
</li>
|
272
|
+
|
273
|
+
|
274
|
+
</ul>
|
275
|
+
|
276
|
+
|
277
|
+
<div id="constructor_details" class="method_details_list">
|
278
|
+
<h2>Constructor Details</h2>
|
279
|
+
|
280
|
+
<div class="method_details first">
|
281
|
+
<h3 class="signature first" id="initialize-instance_method">
|
282
|
+
|
283
|
+
#<strong>initialize</strong>(secret, options: {}) ⇒ <tt><span class='object_link'><a href="" title="FilestackSecurity (class)">FilestackSecurity</a></span></tt>
|
284
|
+
|
285
|
+
|
286
|
+
|
287
|
+
|
288
|
+
|
289
|
+
</h3><div class="docstring">
|
290
|
+
<div class="discussion">
|
291
|
+
|
292
|
+
<p>Initialize FilestackSecurity object</p>
|
293
|
+
|
294
|
+
|
295
|
+
</div>
|
296
|
+
</div>
|
297
|
+
<div class="tags">
|
298
|
+
<p class="tag_title">Parameters:</p>
|
299
|
+
<ul class="param">
|
300
|
+
|
301
|
+
<li>
|
302
|
+
|
303
|
+
<span class='name'>secret</span>
|
304
|
+
|
305
|
+
|
306
|
+
<span class='type'>(<tt>String</tt>)</span>
|
307
|
+
|
308
|
+
|
309
|
+
|
310
|
+
—
|
311
|
+
<div class='inline'>
|
312
|
+
<p>Your filestack security secret</p>
|
313
|
+
</div>
|
314
|
+
|
315
|
+
</li>
|
316
|
+
|
317
|
+
<li>
|
318
|
+
|
319
|
+
<span class='name'>options</span>
|
320
|
+
|
321
|
+
|
322
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
323
|
+
|
324
|
+
|
325
|
+
|
326
|
+
—
|
327
|
+
<div class='inline'>
|
328
|
+
<p>Hash of options: call: The calls that you allow this policy to</p>
|
329
|
+
|
330
|
+
<pre class="code ruby"><code class="ruby">make, e.g convert, exif, pick, read, remove,
|
331
|
+
stat, store, write, writeUrl</code></pre>
|
332
|
+
|
333
|
+
<p>container: (regex) store must match container</p>
|
334
|
+
|
335
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_that'>that</span> <span class='id identifier rubyid_the'>the</span> <span class='id identifier rubyid_files'>files</span> <span class='id identifier rubyid_will'>will</span> <span class='id identifier rubyid_be'>be</span> <span class='id identifier rubyid_stored'>stored</span> <span class='id identifier rubyid_under'>under</span>
|
336
|
+
</code></pre>
|
337
|
+
|
338
|
+
<p>expiry: (timestamp) epoch_timestamp expire,</p>
|
339
|
+
|
340
|
+
<pre class="code ruby"><code class="ruby">defaults to 1hr</code></pre>
|
341
|
+
|
342
|
+
<p>handle: specific file this policy can access maxSize: (number) maximum file
|
343
|
+
size in bytes</p>
|
344
|
+
|
345
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_that'>that</span> <span class='id identifier rubyid_can'>can</span> <span class='id identifier rubyid_be'>be</span> <span class='id identifier rubyid_stored'>stored</span> <span class='id identifier rubyid_by'>by</span> <span class='id identifier rubyid_requests'>requests</span> <span class='id identifier rubyid_with'>with</span> <span class='id identifier rubyid_policy'>policy</span>
|
346
|
+
</code></pre>
|
347
|
+
|
348
|
+
<p>minSize: (number) minimum file size in bytes</p>
|
349
|
+
|
350
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_that'>that</span> <span class='id identifier rubyid_can'>can</span> <span class='id identifier rubyid_be'>be</span> <span class='id identifier rubyid_stored'>stored</span> <span class='id identifier rubyid_by'>by</span> <span class='id identifier rubyid_requests'>requests</span> <span class='id identifier rubyid_with'>with</span> <span class='id identifier rubyid_policy'>policy</span>
|
351
|
+
</code></pre>
|
352
|
+
|
353
|
+
<p>path: (regex) store must match the path that</p>
|
354
|
+
|
355
|
+
<pre class="code ruby"><code class="ruby">the files will be stored under.</code></pre>
|
356
|
+
|
357
|
+
<p>url: (regex) subset of external URL domains</p>
|
358
|
+
|
359
|
+
<pre class="code ruby"><code class="ruby">that are allowed to be image/document
|
360
|
+
sources for processing</code></pre>
|
361
|
+
</div>
|
362
|
+
|
363
|
+
</li>
|
364
|
+
|
365
|
+
</ul>
|
366
|
+
|
367
|
+
|
368
|
+
</div><table class="source_code">
|
369
|
+
<tr>
|
370
|
+
<td>
|
371
|
+
<pre class="lines">
|
372
|
+
|
373
|
+
|
374
|
+
37
|
375
|
+
38
|
376
|
+
39</pre>
|
377
|
+
</td>
|
378
|
+
<td>
|
379
|
+
<pre class="code"><span class="info file"># File 'lib/filestack/models/filestack_security.rb', line 37</span>
|
380
|
+
|
381
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='id identifier rubyid_secret'>secret</span><span class='comma'>,</span> <span class='label'>options:</span> <span class='lbrace'>{</span><span class='rbrace'>}</span><span class='rparen'>)</span>
|
382
|
+
<span class='id identifier rubyid_generate'>generate</span><span class='lparen'>(</span><span class='id identifier rubyid_secret'>secret</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
383
|
+
<span class='kw'>end</span></pre>
|
384
|
+
</td>
|
385
|
+
</tr>
|
386
|
+
</table>
|
387
|
+
</div>
|
388
|
+
|
389
|
+
</div>
|
390
|
+
|
391
|
+
<div id="instance_attr_details" class="attr_details">
|
392
|
+
<h2>Instance Attribute Details</h2>
|
393
|
+
|
394
|
+
|
395
|
+
<span id="policy=-instance_method"></span>
|
396
|
+
<div class="method_details first">
|
397
|
+
<h3 class="signature first" id="policy-instance_method">
|
398
|
+
|
399
|
+
#<strong>policy</strong> ⇒ <tt>Object</tt>
|
400
|
+
|
401
|
+
|
402
|
+
|
403
|
+
|
404
|
+
|
405
|
+
</h3><div class="docstring">
|
406
|
+
<div class="discussion">
|
407
|
+
|
408
|
+
<p>Returns the value of attribute policy</p>
|
409
|
+
|
410
|
+
|
411
|
+
</div>
|
412
|
+
</div>
|
413
|
+
<div class="tags">
|
414
|
+
|
415
|
+
|
416
|
+
</div><table class="source_code">
|
417
|
+
<tr>
|
418
|
+
<td>
|
419
|
+
<pre class="lines">
|
420
|
+
|
421
|
+
|
422
|
+
14
|
423
|
+
15
|
424
|
+
16</pre>
|
425
|
+
</td>
|
426
|
+
<td>
|
427
|
+
<pre class="code"><span class="info file"># File 'lib/filestack/models/filestack_security.rb', line 14</span>
|
428
|
+
|
429
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_policy'>policy</span>
|
430
|
+
<span class='ivar'>@policy</span>
|
431
|
+
<span class='kw'>end</span></pre>
|
432
|
+
</td>
|
433
|
+
</tr>
|
434
|
+
</table>
|
435
|
+
</div>
|
436
|
+
|
437
|
+
|
438
|
+
<span id="signature=-instance_method"></span>
|
439
|
+
<div class="method_details ">
|
440
|
+
<h3 class="signature " id="signature-instance_method">
|
441
|
+
|
442
|
+
#<strong>signature</strong> ⇒ <tt>Object</tt>
|
443
|
+
|
444
|
+
|
445
|
+
|
446
|
+
|
447
|
+
|
448
|
+
</h3><div class="docstring">
|
449
|
+
<div class="discussion">
|
450
|
+
|
451
|
+
<p>Returns the value of attribute signature</p>
|
452
|
+
|
453
|
+
|
454
|
+
</div>
|
455
|
+
</div>
|
456
|
+
<div class="tags">
|
457
|
+
|
458
|
+
|
459
|
+
</div><table class="source_code">
|
460
|
+
<tr>
|
461
|
+
<td>
|
462
|
+
<pre class="lines">
|
463
|
+
|
464
|
+
|
465
|
+
14
|
466
|
+
15
|
467
|
+
16</pre>
|
468
|
+
</td>
|
469
|
+
<td>
|
470
|
+
<pre class="code"><span class="info file"># File 'lib/filestack/models/filestack_security.rb', line 14</span>
|
471
|
+
|
472
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_signature'>signature</span>
|
473
|
+
<span class='ivar'>@signature</span>
|
474
|
+
<span class='kw'>end</span></pre>
|
475
|
+
</td>
|
476
|
+
</tr>
|
477
|
+
</table>
|
478
|
+
</div>
|
479
|
+
|
480
|
+
</div>
|
481
|
+
|
482
|
+
|
483
|
+
<div id="instance_method_details" class="method_details_list">
|
484
|
+
<h2>Instance Method Details</h2>
|
485
|
+
|
486
|
+
|
487
|
+
<div class="method_details first">
|
488
|
+
<h3 class="signature first" id="generate-instance_method">
|
489
|
+
|
490
|
+
#<strong>generate</strong>(secret, options) ⇒ <tt>Object</tt>
|
491
|
+
|
492
|
+
|
493
|
+
|
494
|
+
|
495
|
+
|
496
|
+
</h3><div class="docstring">
|
497
|
+
<div class="discussion">
|
498
|
+
|
499
|
+
<p>Generate the security policy and signature given a string and options</p>
|
500
|
+
|
501
|
+
|
502
|
+
</div>
|
503
|
+
</div>
|
504
|
+
<div class="tags">
|
505
|
+
<p class="tag_title">Parameters:</p>
|
506
|
+
<ul class="param">
|
507
|
+
|
508
|
+
<li>
|
509
|
+
|
510
|
+
<span class='name'>secret</span>
|
511
|
+
|
512
|
+
|
513
|
+
<span class='type'>(<tt>String</tt>)</span>
|
514
|
+
|
515
|
+
|
516
|
+
|
517
|
+
—
|
518
|
+
<div class='inline'>
|
519
|
+
<p>Your filestack security secret</p>
|
520
|
+
</div>
|
521
|
+
|
522
|
+
</li>
|
523
|
+
|
524
|
+
<li>
|
525
|
+
|
526
|
+
<span class='name'>options</span>
|
527
|
+
|
528
|
+
|
529
|
+
<span class='type'>(<tt>Hash</tt>)</span>
|
530
|
+
|
531
|
+
|
532
|
+
|
533
|
+
—
|
534
|
+
<div class='inline'>
|
535
|
+
<p>Hash of options - see constructor</p>
|
536
|
+
</div>
|
537
|
+
|
538
|
+
</li>
|
539
|
+
|
540
|
+
</ul>
|
541
|
+
|
542
|
+
|
543
|
+
</div><table class="source_code">
|
544
|
+
<tr>
|
545
|
+
<td>
|
546
|
+
<pre class="lines">
|
547
|
+
|
548
|
+
|
549
|
+
45
|
550
|
+
46
|
551
|
+
47
|
552
|
+
48
|
553
|
+
49</pre>
|
554
|
+
</td>
|
555
|
+
<td>
|
556
|
+
<pre class="code"><span class="info file"># File 'lib/filestack/models/filestack_security.rb', line 45</span>
|
557
|
+
|
558
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_generate'>generate</span><span class='lparen'>(</span><span class='id identifier rubyid_secret'>secret</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
559
|
+
<span class='id identifier rubyid_policy_json'>policy_json</span> <span class='op'>=</span> <span class='id identifier rubyid_create_policy_string'>create_policy_string</span><span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
|
560
|
+
<span class='ivar'>@policy</span> <span class='op'>=</span> <span class='const'>Base64</span><span class='period'>.</span><span class='id identifier rubyid_urlsafe_encode64'>urlsafe_encode64</span><span class='lparen'>(</span><span class='id identifier rubyid_policy_json'>policy_json</span><span class='rparen'>)</span>
|
561
|
+
<span class='ivar'>@signature</span> <span class='op'>=</span> <span class='const'>OpenSSL</span><span class='op'>::</span><span class='const'>HMAC</span><span class='period'>.</span><span class='id identifier rubyid_hexdigest'>hexdigest</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>sha256</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_secret'>secret</span><span class='comma'>,</span> <span class='id identifier rubyid_policy'>policy</span><span class='rparen'>)</span>
|
562
|
+
<span class='kw'>end</span></pre>
|
563
|
+
</td>
|
564
|
+
</tr>
|
565
|
+
</table>
|
566
|
+
</div>
|
567
|
+
|
568
|
+
<div class="method_details ">
|
569
|
+
<h3 class="signature " id="sign_url-instance_method">
|
570
|
+
|
571
|
+
#<strong>sign_url</strong>(url) ⇒ <tt>String</tt>
|
572
|
+
|
573
|
+
|
574
|
+
|
575
|
+
|
576
|
+
|
577
|
+
</h3><div class="docstring">
|
578
|
+
<div class="discussion">
|
579
|
+
|
580
|
+
<p>Sign the URL by appending policy and signature URL parameters</p>
|
581
|
+
|
582
|
+
|
583
|
+
</div>
|
584
|
+
</div>
|
585
|
+
<div class="tags">
|
586
|
+
<p class="tag_title">Parameters:</p>
|
587
|
+
<ul class="param">
|
588
|
+
|
589
|
+
<li>
|
590
|
+
|
591
|
+
<span class='name'>url</span>
|
592
|
+
|
593
|
+
|
594
|
+
<span class='type'>(<tt>String</tt>)</span>
|
595
|
+
|
596
|
+
|
597
|
+
|
598
|
+
—
|
599
|
+
<div class='inline'>
|
600
|
+
<p>The URL to sign</p>
|
601
|
+
</div>
|
602
|
+
|
603
|
+
</li>
|
604
|
+
|
605
|
+
</ul>
|
606
|
+
|
607
|
+
<p class="tag_title">Returns:</p>
|
608
|
+
<ul class="return">
|
609
|
+
|
610
|
+
<li>
|
611
|
+
|
612
|
+
|
613
|
+
<span class='type'>(<tt>String</tt>)</span>
|
614
|
+
|
615
|
+
|
616
|
+
|
617
|
+
</li>
|
618
|
+
|
619
|
+
</ul>
|
620
|
+
|
621
|
+
</div><table class="source_code">
|
622
|
+
<tr>
|
623
|
+
<td>
|
624
|
+
<pre class="lines">
|
625
|
+
|
626
|
+
|
627
|
+
56
|
628
|
+
57
|
629
|
+
58</pre>
|
630
|
+
</td>
|
631
|
+
<td>
|
632
|
+
<pre class="code"><span class="info file"># File 'lib/filestack/models/filestack_security.rb', line 56</span>
|
633
|
+
|
634
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_sign_url'>sign_url</span><span class='lparen'>(</span><span class='id identifier rubyid_url'>url</span><span class='rparen'>)</span>
|
635
|
+
<span class='id identifier rubyid_format'>format</span><span class='lparen'>(</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>%s&policy=%s&signature=%s</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='id identifier rubyid_url'>url</span><span class='comma'>,</span> <span class='id identifier rubyid_policy'>policy</span><span class='comma'>,</span> <span class='id identifier rubyid_signature'>signature</span><span class='rparen'>)</span>
|
636
|
+
<span class='kw'>end</span></pre>
|
637
|
+
</td>
|
638
|
+
</tr>
|
639
|
+
</table>
|
640
|
+
</div>
|
641
|
+
|
642
|
+
</div>
|
643
|
+
|
644
|
+
</div>
|
645
|
+
|
646
|
+
<div id="footer">
|
647
|
+
Generated on Thu Aug 17 10:04:38 2017 by
|
648
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
649
|
+
0.9.9 (ruby-2.4.0).
|
650
|
+
</div>
|
651
|
+
|
652
|
+
</div>
|
653
|
+
</body>
|
654
|
+
</html>
|