restforce 7.3.0 → 7.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +2 -2
- data/README.md +15 -3
- data/lib/restforce/middleware/gzip.rb +1 -0
- data/lib/restforce/patches/parts.rb +2 -0
- data/lib/restforce/version.rb +1 -1
- data/spec/unit/config_spec.rb +27 -0
- data/spec/unit/middleware/gzip_spec.rb +2 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f34ecbdf8bef8fa7068bef79572000b9766bd9c3be35f8aebe87f43630180910
|
4
|
+
data.tar.gz: 8644247ec7b8201da773efef8d87084b2e91f864fe307eb7d9d0de681c4acc21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df91e270270256472f9a56a384ddf3884d18cdc227910a08132ed6bed8e26063460a7702a0211ea04e93392ffeffaf655211083edfb9013839e63f9ab1eacaf3
|
7
|
+
data.tar.gz: d348b9e29964e071883c40158da5f97a10766b05dc093309f71338ec72f01def17238fc9a65ad3014088cf45a5d7f5e72b11a9ec8d9ad0c446947650ce783c62
|
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -17,6 +17,6 @@ gem 'rspec', '~> 3.13.0'
|
|
17
17
|
gem 'rspec-collection_matchers', '~> 1.2.0'
|
18
18
|
gem 'rspec-its', '~> 1.3.0'
|
19
19
|
gem 'rspec_junit_formatter', '~> 0.6.0'
|
20
|
-
gem 'rubocop', '~> 1.
|
20
|
+
gem 'rubocop', '~> 1.62.1'
|
21
21
|
gem 'simplecov', '~> 0.22.0'
|
22
|
-
gem 'webmock', '~> 3.
|
22
|
+
gem 'webmock', '~> 3.23.0'
|
data/README.md
CHANGED
@@ -27,7 +27,7 @@ Features include:
|
|
27
27
|
|
28
28
|
Add this line to your application's Gemfile:
|
29
29
|
|
30
|
-
gem 'restforce', '~> 7.3.
|
30
|
+
gem 'restforce', '~> 7.3.1'
|
31
31
|
|
32
32
|
And then execute:
|
33
33
|
|
@@ -155,7 +155,7 @@ client = Restforce.new
|
|
155
155
|
|
156
156
|
**Note:** Restforce library does not cache JWT Bearer tokens automatically. This means that every instantiation of the Restforce class will be treated as a new login by Salesforce. Remember that Salesforce enforces [rate limits on login requests](https://help.salesforce.com/s/articleView?id=000312767&type=1). If you are building an application that will instantiate the Restforce class more than this specified rate limit, you might want to consider caching the Bearer token either in-memory or in your own storage by leveraging the `authentication_callback` method.
|
157
157
|
|
158
|
-
|
158
|
+
#### Client Credentials
|
159
159
|
|
160
160
|
If you want to authenticate as an application, you can use the [Client Credentials flow](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_client_credentials_flow.htm&type=5):
|
161
161
|
|
@@ -163,7 +163,7 @@ If you want to authenticate as an application, you can use the [Client Credentia
|
|
163
163
|
client = Restforce.new(client_id: 'client_id',
|
164
164
|
client_secret: 'client_secret',
|
165
165
|
api_version: '55.0',
|
166
|
-
|
166
|
+
host: 'MYDOMAIN.my.salesforce.com')
|
167
167
|
```
|
168
168
|
|
169
169
|
#### Sandbox Organizations
|
@@ -842,6 +842,18 @@ client.create!("CustomField", {
|
|
842
842
|
})
|
843
843
|
```
|
844
844
|
|
845
|
+
## Configuration Precedence
|
846
|
+
|
847
|
+
Here's the order of precedence from highest to lowest:
|
848
|
+
|
849
|
+
Arguments on new: passing configuration options directly as arguments has the highest precedence. These settings will override any other configuration.
|
850
|
+
|
851
|
+
Configuration block: using Restforce.configure to set configuration options is the next in line. They will take precedence over environment variables and defaults but will be overridden by direct arguments on instantiation.
|
852
|
+
|
853
|
+
Environment variables: has the lowest precedence. If you set options using environment variables, they will be overridden by any other configuration method.
|
854
|
+
|
855
|
+
Defaults: If none of the above methods are used, Restforce falls back to its default configuration values.
|
856
|
+
|
845
857
|
## Contributing
|
846
858
|
|
847
859
|
We welcome all contributions - they help us make Restforce the best gem possible.
|
data/lib/restforce/version.rb
CHANGED
data/spec/unit/config_spec.rb
CHANGED
@@ -70,6 +70,21 @@ describe Restforce do
|
|
70
70
|
expect(Restforce.configuration.send(attr)).to eq 'foobar'
|
71
71
|
end
|
72
72
|
end
|
73
|
+
|
74
|
+
it 'takes precedence over environment variables' do
|
75
|
+
{ 'SALESFORCE_USERNAME' => 'env_foo',
|
76
|
+
'SALESFORCE_CLIENT_ID' => 'env_client id' }.
|
77
|
+
each { |var, value| ENV.stub(:fetch).with(var, anything).and_return(value) }
|
78
|
+
|
79
|
+
{ username: 'config_foo', client_id: nil }.each do |attr, value|
|
80
|
+
Restforce.configure do |config|
|
81
|
+
config.send("#{attr}=", value)
|
82
|
+
end
|
83
|
+
end
|
84
|
+
|
85
|
+
expect(Restforce.configuration.send(:username)).to eq 'config_foo'
|
86
|
+
expect(Restforce.configuration.send(:client_id)).to eq 'env_client id'
|
87
|
+
end
|
73
88
|
end
|
74
89
|
|
75
90
|
describe '#log?' do
|
@@ -138,5 +153,17 @@ describe Restforce do
|
|
138
153
|
checker.check!
|
139
154
|
end
|
140
155
|
end
|
156
|
+
|
157
|
+
it 'shows the precedence over config' do
|
158
|
+
ENV['SALESFORCE_USERNAME'] = 'env_foo'
|
159
|
+
Restforce.configure do |config|
|
160
|
+
config.username = 'config_foo'
|
161
|
+
end
|
162
|
+
client = Restforce.new(username: 'foo')
|
163
|
+
|
164
|
+
expect(client.options[:username]).to eq 'foo'
|
165
|
+
|
166
|
+
Restforce.instance_variable_set :@configuration, nil
|
167
|
+
end
|
141
168
|
end
|
142
169
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: restforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.3.
|
4
|
+
version: 7.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Rogers
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2024-
|
12
|
+
date: 2024-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|