leap_salesforce 1.1.0 → 1.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abbfab4a385a6d834dfcaf784c14d232669e85e0e2f7f9aaa8a4fdc99398b288
4
- data.tar.gz: 4292651ae00e51421a0dc4260cd44e7f77539e8753431008c8fd30e7acd1f5ef
3
+ metadata.gz: 8805308060f18da64cded4e1136a905bea7956eec9d80b251ef573a5afc45641
4
+ data.tar.gz: 6cdc409d63208ce8bbae6aaf909007e4c80ac53cabce2326fff5a84fb2c46e15
5
5
  SHA512:
6
- metadata.gz: 8937117f55d69b733902bb49ded422a5602cb6040da7f987f2de5d36dbdfbab597fef81db1b256cf036cf7dea0ee3452fa7ccbbd10482c57b2f0104500785812
7
- data.tar.gz: 12aa02241dbe430e5b048a0ca6c1bf683cb2fb279592a2adcc6203fe5861dc3ff8029b2573c76c035ec6168f093ead8e3bd0f10a53788399fadcead161302d6d
6
+ metadata.gz: d03e189dfbc7c732dbe2e9e8a0e2ea8373e688ee38fd39fbf84e953807c0be1c0e22829e00c6282e2c8cb8774215f0d2fcf79dd208e929865d1ab61fde5a0e40
7
+ data.tar.gz: 45789647e1f9263722875fee80e016551a237df6603c7faecfd28a396934651caf99b8b21a0503642df47b8b0612916c8082ca8b29effcfa5285afc25da15197
data/ChangeLog CHANGED
@@ -1,3 +1,6 @@
1
+ Version 1.1.1
2
+ * Allow session information from SOAP login to be available with LeapSalesforce::Session class
3
+
1
4
  Version 1.1.0
2
5
  * Proper fix to work with activerecord 7 - requires ruby > 2.7
3
6
 
data/Rakefile CHANGED
@@ -14,6 +14,7 @@ RSpec::Core::RakeTask.new(:spec)
14
14
 
15
15
  desc 'Check Salesforce OAuth2 authentication is working'
16
16
  task :check_oauth do
17
+ Soaspec::OAuth2.debug_oauth = true
17
18
  LeapSalesforce.oauth_working?
18
19
  end
19
20
 
@@ -0,0 +1,38 @@
1
+ require_relative 'auth'
2
+ require 'savon'
3
+ require 'json'
4
+
5
+ module LeapSalesforce
6
+ # Holds information about a login session
7
+ class Session
8
+ # @return [String] Session id returned from SOAP API
9
+ attr_accessor :session_id
10
+ # @return [String] User id returned from SOAP API
11
+ attr_accessor :user_id
12
+
13
+ def initialize(username, password)
14
+ login_body = LeapSalesforce::Session.soap_login username, password
15
+
16
+ self.session_id = login_body[:login_response][:result][:session_id]
17
+ self.user_id = login_body[:login_response][:result][:session_id]
18
+ end
19
+
20
+ class << self
21
+
22
+ # Login via SOAP API
23
+ def soap_login(username, password)
24
+ client = Savon.client do
25
+ endpoint "#{SoqlHandler.instance_url}/services/Soap/u/51.0"
26
+ namespace "urn:partner.soap.sforce.com"
27
+ end
28
+
29
+ response = client.call(:login, message:
30
+ {
31
+ username: username,
32
+ password: password
33
+ })
34
+ response.body
35
+ end
36
+ end
37
+ end
38
+ end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module LeapSalesforce
4
4
  # @return [String] Version of leap salesforce
5
- VERSION = '1.1.0'
5
+ VERSION = '1.1.1'
6
6
  end
@@ -19,6 +19,7 @@ require 'factory_bot' # For mass production of data
19
19
  require 'faker' # For fake data
20
20
  require 'leap_salesforce/error'
21
21
  require 'leap_salesforce/loader'
22
+ require 'leap_salesforce/session'
22
23
 
23
24
  # If variable is present within LeapSalesforce set it
24
25
  def load_variables_from(file)
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: 1.1.0
4
+ version: 1.1.1
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: 2022-01-13 00:00:00.000000000 Z
12
+ date: 2022-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -333,6 +333,7 @@ files:
333
333
  - lib/leap_salesforce/rake.rb
334
334
  - lib/leap_salesforce/rake/setup.rake
335
335
  - lib/leap_salesforce/rake/sfdx.rake
336
+ - lib/leap_salesforce/session.rb
336
337
  - lib/leap_salesforce/soql_data/common_enum_methods.rb
337
338
  - lib/leap_salesforce/soql_data/data_relationships.rb
338
339
  - lib/leap_salesforce/soql_data/meta_data_handler.rb