s3-authorize 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 3fee08d6ec40e17f08b28e712bf9be5d6c94d091
4
- data.tar.gz: 4ba5c90cca1540f162ddca632daae8b691b797d0
2
+ SHA256:
3
+ metadata.gz: 2dd68668dc27f5ea66c7f5bfd806f98696b6a93a27707a06733c59cf055dad72
4
+ data.tar.gz: 02add1101c2fba32f9eb860e8a55c05d104a56c34cacb83aa27da35624ab3167
5
5
  SHA512:
6
- metadata.gz: 7a6e30dc7fed5c5cc52a3c596c233969e5102a09b4fb3a05c53e98bf5b4faed568702c145280c2f56614e1e9a517d582b86f661d19e5d3996a083ba1d7f0ed9c
7
- data.tar.gz: 13a0affa6ef1d5518159a48c1fb4633060e34ffba1a8dac7a5af5c37697881fcb367d6a64f36c6574bb9f4e339ecc13a31d7d774cbc1133f607900a7962d096b
6
+ metadata.gz: 30d82e81a0788f943474663e47500f98f46965dfa1951120fabbf6aad6d18c6789ceda897105814e97850fc43b9157e306b78eface89677f389980d71610191c
7
+ data.tar.gz: 57d25f5c511084d5c7406f453af35400869ec4ae8e3c89507120b93229d7d70b06880e7d830ca8f319d25bde33d1300d23542e41ff142684b030a0ac9362dd76
@@ -1,5 +1,5 @@
1
1
  module S3
2
2
  class Authorize
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
data/lib/s3/authorize.rb CHANGED
@@ -24,6 +24,8 @@ module S3
24
24
  @bucket = args[:bucket]
25
25
  @acl = args[:acl]
26
26
  @secret_key = args[:secret_key]
27
+ @min_file_size = args[:min_file_size] || 0
28
+ @max_file_size = args[:max_file_size] || (10 * 1024 * 1024)
27
29
  end
28
30
 
29
31
  # Generate policy
@@ -46,7 +48,7 @@ module S3
46
48
  { "acl" => acl },
47
49
  [ "starts-with", "$Content-Type", "" ],
48
50
  [ "starts-with", "$filename", "" ],
49
- [ "content-length-range", 0, 10 * 1024 * 1024 ]
51
+ [ "content-length-range", @min_file_size, @max_file_size ]
50
52
  ]
51
53
  }.to_json).gsub(/\n/,'')
52
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3-authorize
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vinh Nguyen
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-26 00:00:00.000000000 Z
11
+ date: 2021-09-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -78,7 +78,7 @@ homepage: https://github.com/vinhnglx/s3-authorize
78
78
  licenses:
79
79
  - MIT
80
80
  metadata: {}
81
- post_install_message:
81
+ post_install_message:
82
82
  rdoc_options: []
83
83
  require_paths:
84
84
  - lib
@@ -93,9 +93,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
93
93
  - !ruby/object:Gem::Version
94
94
  version: '0'
95
95
  requirements: []
96
- rubyforge_project:
97
- rubygems_version: 2.6.2
98
- signing_key:
96
+ rubyforge_project:
97
+ rubygems_version: 2.7.9
98
+ signing_key:
99
99
  specification_version: 4
100
100
  summary: Generate Signature and Policy for upload any files to S3.
101
101
  test_files: []