salesforce_streamer 2.3.0 → 2.4.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.bundler-version +1 -0
- data/.dependabot/config.yml +7 -2
- data/.github/workflows/auto-merge.yml +1 -1
- data/Gemfile.lock +46 -39
- data/lib/core_extensions/cookiejar/cookie_validation.rb +59 -17
- data/lib/salesforce_streamer/push_topic.rb +5 -5
- data/lib/salesforce_streamer/version.rb +1 -1
- data/salesforce_streamer.gemspec +2 -2
- metadata +11 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e6ae6f1fa912c4ac13fca440f74cef9b7a5952f0f555d1c41a193d1ed3d338c1
|
4
|
+
data.tar.gz: 6c9d4655567a7373777b3d1d224488ecebc48fb046f98d930f05171e0199468c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9548b2f8f714b701c8055ba63be30bd5f5057f8e87420c59c7504f438ab3ef15b4f3c986768bb19f70f57310539a8e695636a7c4540f3f00dc1d73e8ff6eed77
|
7
|
+
data.tar.gz: 706ea71664fb1b7b9f28501f3525050d2d651f1189e4360c34df332cc71af01b79997b0aca144de0f6bce4a969837232982afcecb60d8378a3257264b2c39642
|
data/.bundler-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.2.16
|
data/.dependabot/config.yml
CHANGED
@@ -3,9 +3,14 @@ version: 1
|
|
3
3
|
update_configs:
|
4
4
|
- package_manager: "ruby:bundler"
|
5
5
|
directory: "/"
|
6
|
-
update_schedule: "
|
6
|
+
update_schedule: "daily"
|
7
7
|
commit_message:
|
8
8
|
prefix: "[dependabot]"
|
9
9
|
allowed_updates:
|
10
10
|
- match:
|
11
|
-
|
11
|
+
dependency_type: "all"
|
12
|
+
update_type: "security"
|
13
|
+
automerged_updates:
|
14
|
+
- match:
|
15
|
+
dependency_type: "all"
|
16
|
+
update_type: "security:patch"
|
data/Gemfile.lock
CHANGED
@@ -1,24 +1,23 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
salesforce_streamer (2.
|
4
|
+
salesforce_streamer (2.4.0.rc1)
|
5
5
|
dry-initializer (~> 3.0)
|
6
6
|
faye (~> 1.4)
|
7
|
-
restforce (
|
7
|
+
restforce (~> 5.0)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
11
11
|
specs:
|
12
12
|
addressable (2.7.0)
|
13
13
|
public_suffix (>= 2.0.2, < 5.0)
|
14
|
-
ast (2.4.
|
14
|
+
ast (2.4.2)
|
15
15
|
byebug (11.1.3)
|
16
|
-
codecov (0.2
|
17
|
-
|
18
|
-
simplecov
|
16
|
+
codecov (0.5.2)
|
17
|
+
simplecov (>= 0.15, < 0.22)
|
19
18
|
cookiejar (0.3.3)
|
20
19
|
diff-lcs (1.4.4)
|
21
|
-
docile (1.3.
|
20
|
+
docile (1.3.5)
|
22
21
|
dry-initializer (3.0.4)
|
23
22
|
em-http-request (1.1.7)
|
24
23
|
addressable (>= 2.3.4)
|
@@ -29,9 +28,15 @@ GEM
|
|
29
28
|
em-socksify (0.3.2)
|
30
29
|
eventmachine (>= 1.0.0.beta.4)
|
31
30
|
eventmachine (1.2.7)
|
32
|
-
faraday (1.1
|
31
|
+
faraday (1.4.1)
|
32
|
+
faraday-excon (~> 1.1)
|
33
|
+
faraday-net_http (~> 1.0)
|
34
|
+
faraday-net_http_persistent (~> 1.1)
|
33
35
|
multipart-post (>= 1.2, < 3)
|
34
|
-
ruby2_keywords
|
36
|
+
ruby2_keywords (>= 0.0.4)
|
37
|
+
faraday-excon (1.1.0)
|
38
|
+
faraday-net_http (1.0.1)
|
39
|
+
faraday-net_http_persistent (1.1.0)
|
35
40
|
faraday_middleware (1.0.0)
|
36
41
|
faraday (~> 1.0)
|
37
42
|
faye (1.4.0)
|
@@ -47,67 +52,69 @@ GEM
|
|
47
52
|
websocket-driver (>= 0.5.1)
|
48
53
|
hashie (4.1.0)
|
49
54
|
http_parser.rb (0.6.0)
|
50
|
-
|
51
|
-
jwt (2.2.2)
|
55
|
+
jwt (2.2.3)
|
52
56
|
multi_json (1.15.0)
|
53
57
|
multipart-post (2.1.1)
|
54
|
-
parallel (1.20.
|
55
|
-
parser (
|
58
|
+
parallel (1.20.1)
|
59
|
+
parser (3.0.1.1)
|
56
60
|
ast (~> 2.4.1)
|
57
61
|
public_suffix (4.0.6)
|
58
62
|
rack (2.2.3)
|
59
63
|
rainbow (3.0.0)
|
60
|
-
rake (13.0.
|
61
|
-
regexp_parser (1.
|
62
|
-
restforce (5.0.
|
64
|
+
rake (13.0.3)
|
65
|
+
regexp_parser (2.1.1)
|
66
|
+
restforce (5.0.5)
|
63
67
|
faraday (>= 0.9.0, <= 2.0)
|
64
68
|
faraday_middleware (>= 0.8.8, <= 2.0)
|
65
69
|
hashie (>= 1.2.0, < 5.0)
|
66
70
|
jwt (>= 1.5.6)
|
67
|
-
rexml (3.2.
|
71
|
+
rexml (3.2.5)
|
68
72
|
rspec (3.10.0)
|
69
73
|
rspec-core (~> 3.10.0)
|
70
74
|
rspec-expectations (~> 3.10.0)
|
71
75
|
rspec-mocks (~> 3.10.0)
|
72
|
-
rspec-core (3.10.
|
76
|
+
rspec-core (3.10.1)
|
73
77
|
rspec-support (~> 3.10.0)
|
74
|
-
rspec-expectations (3.10.
|
78
|
+
rspec-expectations (3.10.1)
|
75
79
|
diff-lcs (>= 1.2.0, < 2.0)
|
76
80
|
rspec-support (~> 3.10.0)
|
77
|
-
rspec-mocks (3.10.
|
81
|
+
rspec-mocks (3.10.2)
|
78
82
|
diff-lcs (>= 1.2.0, < 2.0)
|
79
83
|
rspec-support (~> 3.10.0)
|
80
|
-
rspec-support (3.10.
|
81
|
-
rubocop (1.
|
84
|
+
rspec-support (3.10.2)
|
85
|
+
rubocop (1.14.0)
|
82
86
|
parallel (~> 1.10)
|
83
|
-
parser (>=
|
87
|
+
parser (>= 3.0.0.0)
|
84
88
|
rainbow (>= 2.2.2, < 4.0)
|
85
|
-
regexp_parser (>= 1.8)
|
89
|
+
regexp_parser (>= 1.8, < 3.0)
|
86
90
|
rexml
|
87
|
-
rubocop-ast (>= 1.0.
|
91
|
+
rubocop-ast (>= 1.5.0, < 2.0)
|
88
92
|
ruby-progressbar (~> 1.7)
|
89
|
-
unicode-display_width (>= 1.4.0, <
|
90
|
-
rubocop-ast (1.
|
91
|
-
parser (>=
|
92
|
-
rubocop-
|
93
|
-
rubocop
|
94
|
-
|
95
|
-
rubocop-rspec (2.0.0)
|
93
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
94
|
+
rubocop-ast (1.5.0)
|
95
|
+
parser (>= 3.0.1.1)
|
96
|
+
rubocop-rake (0.5.1)
|
97
|
+
rubocop
|
98
|
+
rubocop-rspec (2.3.0)
|
96
99
|
rubocop (~> 1.0)
|
97
100
|
rubocop-ast (>= 1.1.0)
|
98
|
-
ruby-progressbar (1.
|
99
|
-
ruby2_keywords (0.0.
|
100
|
-
simplecov (0.
|
101
|
+
ruby-progressbar (1.11.0)
|
102
|
+
ruby2_keywords (0.0.4)
|
103
|
+
simplecov (0.21.2)
|
101
104
|
docile (~> 1.1)
|
102
105
|
simplecov-html (~> 0.11)
|
106
|
+
simplecov_json_formatter (~> 0.1)
|
103
107
|
simplecov-html (0.12.3)
|
104
|
-
|
108
|
+
simplecov_json_formatter (0.1.3)
|
109
|
+
unicode-display_width (2.0.0)
|
105
110
|
websocket-driver (0.7.3)
|
106
111
|
websocket-extensions (>= 0.1.0)
|
107
112
|
websocket-extensions (0.1.5)
|
108
113
|
|
109
114
|
PLATFORMS
|
110
|
-
|
115
|
+
x86_64-darwin-19
|
116
|
+
x86_64-darwin-20
|
117
|
+
x86_64-linux
|
111
118
|
|
112
119
|
DEPENDENCIES
|
113
120
|
byebug
|
@@ -115,9 +122,9 @@ DEPENDENCIES
|
|
115
122
|
rake
|
116
123
|
rspec
|
117
124
|
rubocop
|
118
|
-
rubocop-
|
125
|
+
rubocop-rake
|
119
126
|
rubocop-rspec
|
120
127
|
salesforce_streamer!
|
121
128
|
|
122
129
|
BUNDLED WITH
|
123
|
-
2.
|
130
|
+
2.2.16
|
@@ -1,27 +1,69 @@
|
|
1
|
+
require 'cookiejar/cookie_validation'
|
2
|
+
|
1
3
|
# Original source code at
|
2
4
|
# https://github.com/dwaite/cookiejar/blob/master/lib/cookiejar/cookie_validation.rb
|
3
|
-
|
4
|
-
|
5
|
-
#
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
5
|
+
module CookieJar
|
6
|
+
module CookieValidation
|
7
|
+
# Re-opening the CookieValidation module to rewrite the domains_match method to
|
8
|
+
# skip the validation of domains. Open issue at
|
9
|
+
# https://github.com/restforce/restforce/issues/120
|
10
|
+
def self.domains_match(tested_domain, base_domain)
|
11
|
+
return true if tested_domain[-15..].eql?('.salesforce.com')
|
12
|
+
|
13
|
+
# original implementation
|
14
|
+
base = effective_host base_domain
|
15
|
+
search_domains = compute_search_domains_for_host base
|
16
|
+
search_domains.find do |domain|
|
17
|
+
domain == tested_domain
|
18
|
+
end
|
19
|
+
end
|
13
20
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
21
|
+
# Implements https://github.com/dwaite/cookiejar/commit/adb79c0a14c2b347c5289e79379a1acfe34bf388
|
22
|
+
# which is not part of the cookiejar gem yet and is required to prevent
|
23
|
+
# Unknown cookie parameter 'samesite' (CookieJar::InvalidCookieError)
|
24
|
+
def self.parse_set_cookie(set_cookie_value)
|
25
|
+
args = {}
|
26
|
+
params = set_cookie_value.split(/;\s*/)
|
27
|
+
|
28
|
+
first = true
|
29
|
+
params.each do |param|
|
30
|
+
result = PARAM1.match param
|
31
|
+
unless result
|
32
|
+
fail InvalidCookieError,
|
33
|
+
"Invalid cookie parameter in cookie '#{set_cookie_value}'"
|
34
|
+
end
|
35
|
+
key = result[1].downcase.to_sym
|
36
|
+
keyvalue = result[2]
|
37
|
+
if first
|
38
|
+
args[:name] = result[1]
|
39
|
+
args[:value] = keyvalue
|
40
|
+
first = false
|
41
|
+
else
|
42
|
+
case key
|
43
|
+
when :expires
|
44
|
+
begin
|
45
|
+
args[:expires_at] = Time.parse keyvalue
|
46
|
+
rescue ArgumentError
|
47
|
+
raise unless $ERROR_INFO.message == 'time out of range'
|
48
|
+
args[:expires_at] = Time.at(0x7FFFFFFF)
|
19
49
|
end
|
50
|
+
when :"max-age"
|
51
|
+
args[:max_age] = keyvalue.to_i
|
52
|
+
when :domain, :path
|
53
|
+
args[key] = keyvalue
|
54
|
+
when :secure
|
55
|
+
args[:secure] = true
|
56
|
+
when :httponly
|
57
|
+
args[:http_only] = true
|
58
|
+
when :samesite
|
59
|
+
args[:samesite] = keyvalue.downcase
|
60
|
+
else
|
61
|
+
fail InvalidCookieError, "Unknown cookie parameter '#{key}'"
|
20
62
|
end
|
21
63
|
end
|
22
64
|
end
|
65
|
+
args[:version] = 0
|
66
|
+
args
|
23
67
|
end
|
24
68
|
end
|
25
69
|
end
|
26
|
-
|
27
|
-
CookieJar::CookieValidation.extend(CoreExtensions::CookieJar::CookieValidation)
|
@@ -4,11 +4,11 @@ module SalesforceStreamer
|
|
4
4
|
extend Dry::Initializer
|
5
5
|
|
6
6
|
option :name
|
7
|
-
option :query,
|
8
|
-
option :handler,
|
9
|
-
option :replay,
|
10
|
-
option :api_version, proc(&:to_s), default:
|
11
|
-
option :notify_for_fields, default:
|
7
|
+
option :query, ->(v) { v.gsub(/\s+/, ' ') }
|
8
|
+
option :handler, ->(v) { prepare_handler_proc(Object.const_get(v)) }
|
9
|
+
option :replay, ->(v) { v.to_i }, default: -> { -1 }
|
10
|
+
option :api_version, proc(&:to_s), default: -> { '49.0' }
|
11
|
+
option :notify_for_fields, default: -> { 'Referenced' }
|
12
12
|
option :id, optional: true
|
13
13
|
option :description, optional: true
|
14
14
|
|
data/salesforce_streamer.gemspec
CHANGED
@@ -27,13 +27,13 @@ Gem::Specification.new do |spec|
|
|
27
27
|
|
28
28
|
spec.add_dependency 'dry-initializer', '~> 3.0'
|
29
29
|
spec.add_dependency 'faye', '~> 1.4'
|
30
|
-
spec.add_dependency 'restforce', '
|
30
|
+
spec.add_dependency 'restforce', '~> 5.0'
|
31
31
|
|
32
32
|
spec.add_development_dependency 'byebug'
|
33
33
|
spec.add_development_dependency 'codecov'
|
34
34
|
spec.add_development_dependency 'rake'
|
35
35
|
spec.add_development_dependency 'rspec'
|
36
36
|
spec.add_development_dependency 'rubocop'
|
37
|
-
spec.add_development_dependency 'rubocop-
|
37
|
+
spec.add_development_dependency 'rubocop-rake'
|
38
38
|
spec.add_development_dependency 'rubocop-rspec'
|
39
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salesforce_streamer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.4.0.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Serok
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2021-05-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: dry-initializer
|
@@ -43,22 +43,16 @@ dependencies:
|
|
43
43
|
name: restforce
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
47
|
-
- !ruby/object:Gem::Version
|
48
|
-
version: '4.2'
|
49
|
-
- - "<"
|
46
|
+
- - "~>"
|
50
47
|
- !ruby/object:Gem::Version
|
51
|
-
version: '
|
48
|
+
version: '5.0'
|
52
49
|
type: :runtime
|
53
50
|
prerelease: false
|
54
51
|
version_requirements: !ruby/object:Gem::Requirement
|
55
52
|
requirements:
|
56
|
-
- - "
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
version: '4.2'
|
59
|
-
- - "<"
|
53
|
+
- - "~>"
|
60
54
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
55
|
+
version: '5.0'
|
62
56
|
- !ruby/object:Gem::Dependency
|
63
57
|
name: byebug
|
64
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -130,7 +124,7 @@ dependencies:
|
|
130
124
|
- !ruby/object:Gem::Version
|
131
125
|
version: '0'
|
132
126
|
- !ruby/object:Gem::Dependency
|
133
|
-
name: rubocop-
|
127
|
+
name: rubocop-rake
|
134
128
|
requirement: !ruby/object:Gem::Requirement
|
135
129
|
requirements:
|
136
130
|
- - ">="
|
@@ -166,6 +160,7 @@ executables:
|
|
166
160
|
extensions: []
|
167
161
|
extra_rdoc_files: []
|
168
162
|
files:
|
163
|
+
- ".bundler-version"
|
169
164
|
- ".dependabot/config.yml"
|
170
165
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
171
166
|
- ".github/ISSUE_TEMPLATE/config.yml"
|
@@ -215,11 +210,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
210
|
version: '2.6'
|
216
211
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
212
|
requirements:
|
218
|
-
- - "
|
213
|
+
- - ">"
|
219
214
|
- !ruby/object:Gem::Version
|
220
|
-
version:
|
215
|
+
version: 1.3.1
|
221
216
|
requirements: []
|
222
|
-
rubygems_version: 3.
|
217
|
+
rubygems_version: 3.2.16
|
223
218
|
signing_key:
|
224
219
|
specification_version: 4
|
225
220
|
summary: A wrapper around the Restforce Streaming API with a built-in PushTopic manager.
|