salesforce_flo 0.0.2 → 0.0.3
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40f64c8308126581e55b62be28f827e031cdc2c7
|
4
|
+
data.tar.gz: b679a5e2c6fd4c52b98843706a3661e9073583a7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 466e589eb863a98eaa92502da9dd5e70152fe5d50f50e3b6d72409bf007e874822618e5f5e6e413fd9ec476ec92f2e965b50591207af831f22f13e4209eabaa6
|
7
|
+
data.tar.gz: 85ea278979344ec97f67887e6e124e979eb11f02dca7e8805de8ba469ab219bd6ecd672a6e1c867e81c30947f63786190182b7dd9e019a8ee9c26d65ce42320f
|
@@ -13,7 +13,7 @@ module SalesforceFlo
|
|
13
13
|
class OauthWrapper
|
14
14
|
|
15
15
|
OAUTH_ENDPOINT = '/services/oauth2/authorize'
|
16
|
-
|
16
|
+
DEFAULT_AUTH_HOST = 'https://login.salesforce.com'
|
17
17
|
DEFAULT_CLIENT_ID = '3MVG9CEn_O3jvv0zPd34OzgiH037XR5Deez3GW8PpsMdzoxecdKUW1s.8oYU9GoLS2Tykr4qTrCizaQBjRXNT'
|
18
18
|
DEFAULT_REDIRECT_HOSTNAME = 'localhost'
|
19
19
|
DEFAULT_LISTEN_PORT = '3835'
|
@@ -26,15 +26,18 @@ module SalesforceFlo
|
|
26
26
|
# that the user will be redirected to at the end of the Oauth authorization flow. This MUST match the
|
27
27
|
# redirect URL specified in the connected app settings.
|
28
28
|
# @option opts [String] :port (3835) The port that the user will be redirected to at the end of the Oauth
|
29
|
+
# @option opts [String] :auth_host (https://login.salesforce.com) The hostname where the user will be directed for
|
30
|
+
# authentication. This is useful if your org utilizes a custom domain.
|
29
31
|
# flow. This will be appended to the redirect_hostname
|
30
32
|
# @option opts [#call] :client An object that produces a client when called with initialization options
|
31
33
|
# @raise [ArgumentError] If client object does not respond_to?(:call)
|
32
34
|
#
|
33
35
|
def initialize(opts={})
|
34
|
-
@client_id = opts
|
35
|
-
@redirect_hostname = opts
|
36
|
-
@port = opts
|
37
|
-
@
|
36
|
+
@client_id = opts.fetch(:client_id, DEFAULT_CLIENT_ID)
|
37
|
+
@redirect_hostname = opts.fetch(:redirect_hostname, DEFAULT_REDIRECT_HOSTNAME)
|
38
|
+
@port = opts.fetch(:port, DEFAULT_LISTEN_PORT)
|
39
|
+
@auth_host = opts.fetch(:auth_host, DEFAULT_AUTH_HOST)
|
40
|
+
@client = opts.fetch(:client, -> (options) { Restforce.new(options) })
|
38
41
|
|
39
42
|
raise ArgumentError.new(':client must respond to #call, try a lambda') unless @client.respond_to?(:call)
|
40
43
|
end
|
@@ -62,7 +65,7 @@ module SalesforceFlo
|
|
62
65
|
|
63
66
|
trap "INT" do server.shutdown end
|
64
67
|
|
65
|
-
Launchy.open("#{
|
68
|
+
Launchy.open("#{@auth_host}#{OAUTH_ENDPOINT}?#{oauth_query_string}")
|
66
69
|
server.start
|
67
70
|
|
68
71
|
merged_options = opts.merge(auth_details).merge(client_id: @client_id, api_version: '39.0').inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: salesforce_flo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Powers
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-09-
|
11
|
+
date: 2017-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|