leap_salesforce 0.2.16 → 0.2.17
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/.idea/leap-salesforce.iml +5 -5
- data/.leap_salesforce.yml +1 -1
- data/ChangeLog +4 -0
- data/README.md +5 -2
- data/lib/leap_salesforce/auth.rb +20 -5
- data/lib/leap_salesforce/parameters.rb +1 -1
- data/lib/leap_salesforce/version.rb +1 -1
- data/lib/leap_salesforce.rb +1 -7
- 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: 906a5f6573d0bf393082eadac1e9935fcda4e89c6886a8e2d5fffa15010db289
|
4
|
+
data.tar.gz: 8b8343640b11e301fc53f6c8c5ba6a7253b206a14caaf9f723d74ed4f834318c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: afecc4803505fb9599c49855d7105a9262e79e65f28156b3989508df973365d2f23a9525b306b845d2d30309561c39bcfc66bd092840a26ccf03a9df8de1675b
|
7
|
+
data.tar.gz: 1b4b06ee4497c02852afd97ee9bdfa9d80b88a2df9e9498d6795d0d5fc7a39cad2150f6e2f5138075890d72a6220bc03380c72a83dd2c01914e4e66e449ef021
|
data/.idea/leap-salesforce.iml
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
<orderEntry type="library" scope="PROVIDED" name="docile (v1.3.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
25
25
|
<orderEntry type="library" scope="PROVIDED" name="domain_name (v0.5.20190701, RVM: ruby-2.6.3) [gem]" level="application" />
|
26
26
|
<orderEntry type="library" scope="PROVIDED" name="factory_bot (v5.1.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
27
|
-
<orderEntry type="library" scope="PROVIDED" name="faker (v2.
|
27
|
+
<orderEntry type="library" scope="PROVIDED" name="faker (v2.8.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
28
28
|
<orderEntry type="library" scope="PROVIDED" name="gyoku (v1.3.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
29
29
|
<orderEntry type="library" scope="PROVIDED" name="hashie (v4.0.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
30
30
|
<orderEntry type="library" scope="PROVIDED" name="http-accept (v1.7.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
@@ -45,9 +45,9 @@
|
|
45
45
|
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.14.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
46
46
|
<orderEntry type="library" scope="PROVIDED" name="mustermann (v1.0.3, RVM: ruby-2.6.3) [gem]" level="application" />
|
47
47
|
<orderEntry type="library" scope="PROVIDED" name="netrc (v0.11.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
48
|
-
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.10.
|
48
|
+
<orderEntry type="library" scope="PROVIDED" name="nokogiri (v1.10.7, RVM: ruby-2.6.3) [gem]" level="application" />
|
49
49
|
<orderEntry type="library" scope="PROVIDED" name="nori (v2.6.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
50
|
-
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.19.
|
50
|
+
<orderEntry type="library" scope="PROVIDED" name="parallel (v1.19.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
51
51
|
<orderEntry type="library" scope="PROVIDED" name="parser (v2.6.5.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
52
52
|
<orderEntry type="library" scope="PROVIDED" name="pry (v0.12.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
53
53
|
<orderEntry type="library" scope="PROVIDED" name="public_suffix (v4.0.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
@@ -72,7 +72,7 @@
|
|
72
72
|
<orderEntry type="library" scope="PROVIDED" name="sinatra (v2.0.4, RVM: ruby-2.6.3) [gem]" level="application" />
|
73
73
|
<orderEntry type="library" scope="PROVIDED" name="sinatra-basic-auth (v0.1.0, RVM: ruby-2.6.3) [gem]" level="application" />
|
74
74
|
<orderEntry type="library" scope="PROVIDED" name="sinatra-docdsl (v0.8.6, RVM: ruby-2.6.3) [gem]" level="application" />
|
75
|
-
<orderEntry type="library" scope="PROVIDED" name="soaspec (v0.3.
|
75
|
+
<orderEntry type="library" scope="PROVIDED" name="soaspec (v0.3.8, RVM: ruby-2.6.3) [gem]" level="application" />
|
76
76
|
<orderEntry type="library" scope="PROVIDED" name="socksify (v1.7.1, RVM: ruby-2.6.3) [gem]" level="application" />
|
77
77
|
<orderEntry type="library" scope="PROVIDED" name="thor (v0.20.3, RVM: ruby-2.6.3) [gem]" level="application" />
|
78
78
|
<orderEntry type="library" scope="PROVIDED" name="thread_safe (v0.3.6, RVM: ruby-2.6.3) [gem]" level="application" />
|
@@ -87,7 +87,7 @@
|
|
87
87
|
<orderEntry type="library" scope="PROVIDED" name="xml-simple (v1.1.5, RVM: ruby-2.6.3) [gem]" level="application" />
|
88
88
|
<orderEntry type="library" scope="PROVIDED" name="yard (v0.9.20, RVM: ruby-2.6.3) [gem]" level="application" />
|
89
89
|
<orderEntry type="library" scope="PROVIDED" name="yard-doctest (v0.1.17, RVM: ruby-2.6.3) [gem]" level="application" />
|
90
|
-
<orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.2.
|
90
|
+
<orderEntry type="library" scope="PROVIDED" name="zeitwerk (v2.2.2, RVM: ruby-2.6.3) [gem]" level="application" />
|
91
91
|
</component>
|
92
92
|
<component name="RModuleSettingsStorage">
|
93
93
|
<LOAD_PATH number="1" string0="$MODULE_DIR$/spec/support" />
|
data/.leap_salesforce.yml
CHANGED
data/ChangeLog
CHANGED
data/README.md
CHANGED
@@ -158,8 +158,11 @@ The `LEAP_ENV` environment variable can be used to change environment in non sfd
|
|
158
158
|
`.leap_salesforce.yml` environment key.
|
159
159
|
|
160
160
|
In sfdx mode, setting env variable `SCRATCH_ORG` to `true`
|
161
|
-
will tell leap salesforce to authenticate against a SCRATCH ORG. It will
|
162
|
-
environment variable
|
161
|
+
will tell leap salesforce to authenticate against a SCRATCH ORG. It will attempt to use either the `SCRATCH_ORG_ALIAS`
|
162
|
+
environment variable.
|
163
|
+
|
164
|
+
Alternatively, set the environment variables `SCRATCH_INSTANCE_URL` and `SCRATCH_ACCESS_TOKEN` from `sfdx:org:display`
|
165
|
+
to enable tests to use that to authenticate to environment directly.
|
163
166
|
|
164
167
|
#### Test Users
|
165
168
|
Test users are defined using the `LeapSalesforce::Users` module. Following is an example of setting up a few test
|
data/lib/leap_salesforce/auth.rb
CHANGED
@@ -59,19 +59,34 @@ module LeapSalesforce
|
|
59
59
|
true
|
60
60
|
end
|
61
61
|
|
62
|
+
# @return [Boolean] Whether SFDX Access token and instance url have been manually set
|
63
|
+
# If not they will be attempted to be retrieved via JWT, SF_USERNAME & SF_CONSUMER_KEY
|
64
|
+
def manually_set_auth?
|
65
|
+
ENV['SFDX_ACCESS_TOKEN'] ||= ENV['SCRATCH_ACCESS_TOKEN']
|
66
|
+
ENV['SFDX_INSTANCE_URL'] ||= ENV['SCRATCH_INSTANCE_URL']
|
67
|
+
return false unless ENV['SFDX_ACCESS_TOKEN'] && ENV['SFDX_INSTANCE_URL']
|
68
|
+
|
69
|
+
!ENV['SFDX_ACCESS_TOKEN'].empty? && !ENV['SFDX_INSTANCE_URL'].empty?
|
70
|
+
end
|
71
|
+
|
62
72
|
# Extract sfdx variables and store them
|
63
73
|
# Set ENV['SCRATCH_ORG'] to true to authenticate and run against sandbox
|
64
74
|
def extract_sfdx_variables
|
75
|
+
return unless LeapSalesforce.sfdx
|
76
|
+
|
65
77
|
LeapSalesforce.client_id = ENV['SF_CONSUMER_KEY']
|
66
|
-
|
67
|
-
|
68
|
-
if ENV['SCRATCH_ACCESS_TOKEN'] && ENV['SCRATCH_INSTANCE_URL']
|
69
|
-
url_obtained = ENV['SCRATCH_INSTANCE_URL']
|
78
|
+
if manually_set_auth?
|
79
|
+
url_obtained = ENV['SFDX_INSTANCE_URL']
|
70
80
|
self.instance_url = url_obtained[-1] == '/' ? url_obtained[0..-2] : url_obtained
|
71
|
-
self.access_token = ENV['
|
81
|
+
self.access_token = ENV['SFDX_ACCESS_TOKEN']
|
72
82
|
return
|
73
83
|
end
|
74
84
|
|
85
|
+
unless ENV['SF_USERNAME'] && ENV['SF_CONSUMER_KEY']
|
86
|
+
logger.error "No CREDENTIALS FILE found at #{CREDENTIAL_FILE}." unless File.exist? CREDENTIAL_FILE
|
87
|
+
raise SetupError,
|
88
|
+
'Please set SF_USERNAME and SF_CONSUMER_KEY environment variables'
|
89
|
+
end
|
75
90
|
script_name = if ENV['SCRATCH_ORG'] && !ENV['SCRATCH_ORG'].empty?
|
76
91
|
raise "Please set SCRATCH_ORG_ALIAS when SCRATCH_ORG(#{ENV['SCRATCH_ORG']}) is set" unless ENV['SCRATCH_ORG_ALIAS']
|
77
92
|
|
@@ -65,7 +65,7 @@ module LeapSalesforce
|
|
65
65
|
# logged
|
66
66
|
# @return [Boolean] Whether sfdx is setup correctly
|
67
67
|
def sfdx_auth_setup?
|
68
|
-
Auth.jwt_file?
|
68
|
+
Auth.manually_set_auth? || Auth.jwt_file?
|
69
69
|
return true if LeapSalesforce::Auth.sfdx_variables?
|
70
70
|
|
71
71
|
raise LeapSalesforce::SetupError, 'LeapSalesforce::Auth.access_token and ' \
|
data/lib/leap_salesforce.rb
CHANGED
@@ -59,13 +59,7 @@ module LeapSalesforce
|
|
59
59
|
require general_file if File.exist? "#{general_file}.rb"
|
60
60
|
|
61
61
|
if sfdx
|
62
|
-
|
63
|
-
unless ENV['SF_USERNAME'] && ENV['SF_CONSUMER_KEY']
|
64
|
-
logger.error "No CREDENTIALS FILE found at #{CREDENTIAL_FILE}." unless File.exist? CREDENTIAL_FILE
|
65
|
-
raise SetupError,
|
66
|
-
'Please set SF_USERNAME and SF_CONSUMER_KEY environment variables'
|
67
|
-
end
|
68
|
-
Auth.jwt_file?
|
62
|
+
sfdx_auth_setup?
|
69
63
|
else
|
70
64
|
%w[client_id client_secret password].each do |param|
|
71
65
|
if send(param).nil?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: leap_salesforce
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- IQA
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-12-
|
12
|
+
date: 2019-12-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|