boxr 1.21.0 → 1.22.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/lib/boxr/chunked_uploads.rb +4 -4
- data/lib/boxr/version.rb +1 -1
- data/lib/boxr/webhook_validator.rb +4 -5
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fc54a36782e08382d054e9ae513dc57068c6863248a150d929b3556697e7498d
|
4
|
+
data.tar.gz: a272930b0bd35e2cf6e7cea800e73b85df37642821cdfde99fda811e71a3cfdc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a9a2d42cee09c8612b98e91db459cbe266a20faea28466dd2bdcd4fe39f6778d82c1fdfa358c5699dd03090bfebc0449093c374b3cc6f7d2ea2fec15e4ede6d
|
7
|
+
data.tar.gz: f04ae30c4919d836d948ac595df01aea192b64fc4d26d3d42f72ce740bd29b8af7e699b18d8fd5cbcf93808cbf8f1aad5c2149bb8274ae884997dd907a861d5a
|
data/lib/boxr/chunked_uploads.rb
CHANGED
@@ -14,7 +14,7 @@ module Boxr
|
|
14
14
|
|
15
15
|
uri = "#{UPLOAD_URI}/files/upload_sessions"
|
16
16
|
body = {folder_id: parent_id, file_size: io.size, file_name: name}
|
17
|
-
session_info, response = post(uri, body, content_type: "application/json")
|
17
|
+
session_info, response = post(uri, body, content_type: "application/json", success_codes: [200,201,202])
|
18
18
|
|
19
19
|
session_info
|
20
20
|
end
|
@@ -31,7 +31,7 @@ module Boxr
|
|
31
31
|
file_id = ensure_id(file)
|
32
32
|
uri = "#{UPLOAD_URI}/files/#{file_id}/upload_sessions"
|
33
33
|
body = {file_size: io.size, file_name: name}
|
34
|
-
session_info, response = post(uri, body, content_type: "application/json")
|
34
|
+
session_info, response = post(uri, body, content_type: "application/json", success_codes: [200,201,202])
|
35
35
|
|
36
36
|
session_info
|
37
37
|
end
|
@@ -60,7 +60,7 @@ module Boxr
|
|
60
60
|
|
61
61
|
uri = "#{UPLOAD_URI}/files/upload_sessions/#{session_id}"
|
62
62
|
body = data
|
63
|
-
part_info, response = put(uri, body, process_body: false, digest: digest, content_type: "application/octet-stream", content_range: range)
|
63
|
+
part_info, response = put(uri, body, process_body: false, digest: digest, content_type: "application/octet-stream", content_range: range, success_codes: [200,201,202])
|
64
64
|
|
65
65
|
part_info.part
|
66
66
|
end
|
@@ -99,7 +99,7 @@ module Boxr
|
|
99
99
|
parts: parts,
|
100
100
|
attributes: attributes
|
101
101
|
}
|
102
|
-
commit_info, response = post(uri, body, process_body: true, digest: digest, content_type: "application/json", if_match: if_match, if_non_match: if_non_match)
|
102
|
+
commit_info, response = post(uri, body, process_body: true, digest: digest, content_type: "application/json", if_match: if_match, if_non_match: if_non_match, success_codes: [200,201,202])
|
103
103
|
|
104
104
|
commit_info
|
105
105
|
end
|
data/lib/boxr/version.rb
CHANGED
@@ -35,9 +35,8 @@ module Boxr
|
|
35
35
|
end
|
36
36
|
|
37
37
|
def generate_signature(key)
|
38
|
-
|
39
|
-
|
40
|
-
Base64.encode64(digest)
|
38
|
+
digest = OpenSSL::HMAC.digest('SHA256', key, "#{payload}#{timestamp}")
|
39
|
+
Base64.strict_encode64(digest)
|
41
40
|
end
|
42
41
|
|
43
42
|
private
|
@@ -49,11 +48,11 @@ module Boxr
|
|
49
48
|
def delivery_time
|
50
49
|
Time.parse(timestamp).utc
|
51
50
|
rescue ArgumentError
|
52
|
-
raise BoxrError.new(boxr_message:
|
51
|
+
raise BoxrError.new(boxr_message: 'Webhook authenticity not verified: invalid timestamp')
|
53
52
|
end
|
54
53
|
|
55
54
|
def message_age
|
56
55
|
current_time - delivery_time
|
57
56
|
end
|
58
57
|
end
|
59
|
-
end
|
58
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: boxr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.22.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chad Burnette
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-12-06 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
275
275
|
- !ruby/object:Gem::Version
|
276
276
|
version: '0'
|
277
277
|
requirements: []
|
278
|
-
rubygems_version: 3.
|
278
|
+
rubygems_version: 3.5.11
|
279
279
|
signing_key:
|
280
280
|
specification_version: 4
|
281
281
|
summary: A Ruby client library for the Box V2 Content API.
|