workato-connector-sdk 1.3.9 → 1.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/workato/connector/sdk/action.rb +1 -1
- data/lib/workato/connector/sdk/blank.rb +1 -0
- data/lib/workato/connector/sdk/connector.rb +1 -1
- data/lib/workato/connector/sdk/dsl/workato_package.rb +66 -0
- data/lib/workato/connector/sdk/errors.rb +2 -0
- data/lib/workato/connector/sdk/request.rb +2 -2
- data/lib/workato/connector/sdk/streams.rb +1 -1
- data/lib/workato/extension/string.rb +1 -1
- metadata +24 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a4307598e8aa6c86eb54f75b63648f20bc192be58e22a6a5f7c5aa0b4efefd01
|
4
|
+
data.tar.gz: 1db7b500cec4f2e761a2ca3eb9d21c11b14b0a7b67c239f600348bbdac0ec393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4e29f03eed4679751a90297de15988ac154cd83404da08a95484d2651c95c2bdc3aa7bc6a3647225bbb78776de222fe482ef846e21f0d6e8a5cc4d7953be620
|
7
|
+
data.tar.gz: 9d82d01badd7c60f971d3b2bbecf452d6d80314a7833f414b05fd8eb4d6510d7c7328a7c893c99daa6b713c7a66714e4f04d086f4bf2161bfb114e6f08639a47
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.3.
|
1
|
+
1.3.10
|
@@ -40,6 +40,12 @@ module Workato
|
|
40
40
|
ALLOWED_KEY_SIZES = [128, 192, 256].freeze
|
41
41
|
private_constant :ALLOWED_KEY_SIZES
|
42
42
|
|
43
|
+
ALLOWED_INITIALIZATION_VECTOR_SIZE = 96
|
44
|
+
private_constant :ALLOWED_INITIALIZATION_VECTOR_SIZE
|
45
|
+
|
46
|
+
ALLOWED_AUTH_TAG_SIZES = [96, 104, 112, 120, 128].freeze
|
47
|
+
private_constant :ALLOWED_AUTH_TAG_SIZES
|
48
|
+
|
43
49
|
def initialize(streams:, connection:)
|
44
50
|
@streams = streams
|
45
51
|
@connection = connection
|
@@ -163,6 +169,33 @@ module Workato
|
|
163
169
|
Types::Binary.new(cipher.update(string) + cipher.final)
|
164
170
|
end
|
165
171
|
|
172
|
+
def aes_gcm_encrypt(string, key, init_vector, auth_data = '')
|
173
|
+
unless string.is_a?(String) && key.is_a?(String) && init_vector.is_a?(String) && auth_data.is_a?(String)
|
174
|
+
raise Sdk::ArgumentError, 'All arguments must be of type String'
|
175
|
+
end
|
176
|
+
|
177
|
+
unless string.valid_encoding?
|
178
|
+
raise Sdk::ArgumentEncodingError, 'Data to be encrypted must have valid encoding'
|
179
|
+
end
|
180
|
+
|
181
|
+
raise Sdk::ArgumentError, 'Data to be encrypted must not be empty' if string.empty?
|
182
|
+
|
183
|
+
key_size = key.bytesize * 8
|
184
|
+
raise Sdk::ArgumentError, 'Incorrect key size for AES' unless ALLOWED_KEY_SIZES.include?(key_size)
|
185
|
+
|
186
|
+
init_vector_size = init_vector.bytesize * 8
|
187
|
+
unless init_vector_size == ALLOWED_INITIALIZATION_VECTOR_SIZE
|
188
|
+
raise Sdk::ArgumentError, 'Incorrect key size for Initialization Vector'
|
189
|
+
end
|
190
|
+
|
191
|
+
cipher = ::OpenSSL::Cipher.new("AES-#{key_size}-GCM")
|
192
|
+
cipher.encrypt
|
193
|
+
cipher.key = key
|
194
|
+
cipher.iv = init_vector
|
195
|
+
cipher.auth_data = auth_data
|
196
|
+
[cipher.update(string) + cipher.final, cipher.auth_tag].map { |v| Types::Binary.new(v) }
|
197
|
+
end
|
198
|
+
|
166
199
|
def aes_cbc_decrypt(string, key, init_vector = nil)
|
167
200
|
key_size = key.bytesize * 8
|
168
201
|
unless ALLOWED_KEY_SIZES.include?(key_size)
|
@@ -178,6 +211,39 @@ module Workato
|
|
178
211
|
raise Sdk::ArgumentError, e.message
|
179
212
|
end
|
180
213
|
|
214
|
+
def aes_gcm_decrypt(encrypted, key, auth_tag, init_vector, auth_data = '')
|
215
|
+
unless encrypted.is_a?(String) &&
|
216
|
+
key.is_a?(String) &&
|
217
|
+
auth_tag.is_a?(String) &&
|
218
|
+
init_vector.is_a?(String) &&
|
219
|
+
auth_data.is_a?(String)
|
220
|
+
raise Sdk::ArgumentError, 'All arguments must be of type String'
|
221
|
+
end
|
222
|
+
|
223
|
+
unless encrypted.valid_encoding?
|
224
|
+
raise Sdk::ArgumentEncodingError, 'Data to be decrypted must have valid encoding'
|
225
|
+
end
|
226
|
+
|
227
|
+
raise Sdk::ArgumentError, 'Data to be decrypted must not be empty' if encrypted.blank?
|
228
|
+
|
229
|
+
auth_tag_size = auth_tag.bytesize * 8
|
230
|
+
unless ALLOWED_AUTH_TAG_SIZES.include?(auth_tag_size)
|
231
|
+
raise Sdk::ArgumentError, 'Incorrect authentication tag size'
|
232
|
+
end
|
233
|
+
|
234
|
+
key_size = key.bytesize * 8
|
235
|
+
raise Sdk::ArgumentError, 'Incorrect key size for AES' unless ALLOWED_KEY_SIZES.include?(key_size)
|
236
|
+
|
237
|
+
decipher = ::OpenSSL::Cipher.new("AES-#{key_size}-GCM").decrypt
|
238
|
+
decipher.key = key
|
239
|
+
decipher.iv = init_vector
|
240
|
+
decipher.auth_data = auth_data
|
241
|
+
decipher.auth_tag = auth_tag
|
242
|
+
Types::Binary.new(decipher.update(encrypted) + decipher.final)
|
243
|
+
rescue OpenSSL::Cipher::CipherError
|
244
|
+
raise Sdk::ArgumentError, 'Not able to decrypt, please check input values again'
|
245
|
+
end
|
246
|
+
|
181
247
|
def pbkdf2_hmac_sha1(string, salt, iterations = 1000, key_len = 16)
|
182
248
|
Types::Binary.new(::OpenSSL::PKCS5.pbkdf2_hmac_sha1(string, salt, iterations, key_len))
|
183
249
|
end
|
@@ -155,8 +155,8 @@ module Workato
|
|
155
155
|
self
|
156
156
|
end
|
157
157
|
|
158
|
-
def format_xml(root_element_name, namespaces = {}, strip_response_namespaces: false)
|
159
|
-
request_format_xml(root_element_name, namespaces)
|
158
|
+
def format_xml(root_element_name, namespaces = {}, strip_response_namespaces: false, **kwargs)
|
159
|
+
request_format_xml(root_element_name, namespaces.merge(kwargs))
|
160
160
|
.response_format_xml(strip_response_namespaces: strip_response_namespaces)
|
161
161
|
end
|
162
162
|
|
@@ -35,7 +35,7 @@ module Workato
|
|
35
35
|
|
36
36
|
sig { params(streams_source: SorbetTypes::SourceHash).void }
|
37
37
|
def define_action_methods(streams_source)
|
38
|
-
streams_source.
|
38
|
+
streams_source.each_key do |stream|
|
39
39
|
define_singleton_method(stream) do |input = {}, from = 0, to = nil, frame_size = Stream::DEFAULT_FRAME_SIZE|
|
40
40
|
to ||= from + frame_size
|
41
41
|
self[stream].chunk(input, from, to, frame_size)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workato-connector-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Abolmasov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -34,14 +34,20 @@ dependencies:
|
|
34
34
|
name: aws-sigv4
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
36
36
|
requirements:
|
37
|
-
- -
|
37
|
+
- - "~>"
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: '1.2'
|
40
|
+
- - ">="
|
38
41
|
- !ruby/object:Gem::Version
|
39
42
|
version: 1.2.4
|
40
43
|
type: :runtime
|
41
44
|
prerelease: false
|
42
45
|
version_requirements: !ruby/object:Gem::Requirement
|
43
46
|
requirements:
|
44
|
-
- -
|
47
|
+
- - "~>"
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: '1.2'
|
50
|
+
- - ">="
|
45
51
|
- !ruby/object:Gem::Version
|
46
52
|
version: 1.2.4
|
47
53
|
- !ruby/object:Gem::Dependency
|
@@ -90,14 +96,20 @@ dependencies:
|
|
90
96
|
name: gyoku
|
91
97
|
requirement: !ruby/object:Gem::Requirement
|
92
98
|
requirements:
|
93
|
-
- -
|
99
|
+
- - "~>"
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
version: '1.3'
|
102
|
+
- - ">="
|
94
103
|
- !ruby/object:Gem::Version
|
95
104
|
version: 1.3.1
|
96
105
|
type: :runtime
|
97
106
|
prerelease: false
|
98
107
|
version_requirements: !ruby/object:Gem::Requirement
|
99
108
|
requirements:
|
100
|
-
- -
|
109
|
+
- - "~>"
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '1.3'
|
112
|
+
- - ">="
|
101
113
|
- !ruby/object:Gem::Version
|
102
114
|
version: 1.3.1
|
103
115
|
- !ruby/object:Gem::Dependency
|
@@ -158,16 +170,16 @@ dependencies:
|
|
158
170
|
name: net-http-digest_auth
|
159
171
|
requirement: !ruby/object:Gem::Requirement
|
160
172
|
requirements:
|
161
|
-
- -
|
173
|
+
- - "~>"
|
162
174
|
- !ruby/object:Gem::Version
|
163
|
-
version: 1.4
|
175
|
+
version: '1.4'
|
164
176
|
type: :runtime
|
165
177
|
prerelease: false
|
166
178
|
version_requirements: !ruby/object:Gem::Requirement
|
167
179
|
requirements:
|
168
|
-
- -
|
180
|
+
- - "~>"
|
169
181
|
- !ruby/object:Gem::Version
|
170
|
-
version: 1.4
|
182
|
+
version: '1.4'
|
171
183
|
- !ruby/object:Gem::Dependency
|
172
184
|
name: nokogiri
|
173
185
|
requirement: !ruby/object:Gem::Requirement
|
@@ -177,7 +189,7 @@ dependencies:
|
|
177
189
|
version: 1.13.10
|
178
190
|
- - "<"
|
179
191
|
- !ruby/object:Gem::Version
|
180
|
-
version: '1.
|
192
|
+
version: '1.16'
|
181
193
|
type: :runtime
|
182
194
|
prerelease: false
|
183
195
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -187,7 +199,7 @@ dependencies:
|
|
187
199
|
version: 1.13.10
|
188
200
|
- - "<"
|
189
201
|
- !ruby/object:Gem::Version
|
190
|
-
version: '1.
|
202
|
+
version: '1.16'
|
191
203
|
- !ruby/object:Gem::Dependency
|
192
204
|
name: rack
|
193
205
|
requirement: !ruby/object:Gem::Requirement
|