zuora_connect 2.0.3k → 2.0.3l
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/lib/zuora_connect/controllers/helpers.rb +5 -10
- data/lib/zuora_connect/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d93d7c0e7e64483ffaaf156912c0ee8c6b4f754063076ea079444b50bbb8f9fa
|
4
|
+
data.tar.gz: 49bde2287a5d34a541af49071023442136adf1964e454fa6b85672d8f0f7ba7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f5c7faee03cebff025670ba7d5441c2ef796bbf7af0c8ebb0a21ffe80bc54bbab714d932220cff7882cf64da26bb6d6f8afc05c3c6a2083bcf18562fb156288
|
7
|
+
data.tar.gz: bbb1096b513cf54ac8abae4a77719e76587b80189cafb17d1ceabc52b842cf3aaa5f6a5e1630465370a262a6fab1221fb69549958d2a6ff78524267592b7e45c
|
@@ -63,21 +63,16 @@ module ZuoraConnect
|
|
63
63
|
ElasticAPM.set_tag(:trace_id, request.uuid) if defined?(ElasticAPM) && ElasticAPM.running?
|
64
64
|
Thread.current[:appinstance] = nil
|
65
65
|
|
66
|
-
|
67
|
-
headers = request.headers.env.select do |k, _|
|
68
|
-
k.downcase.start_with?('http') ||
|
69
|
-
k.in?(ActionDispatch::Http::Headers::CGI_VARIABLES)
|
70
|
-
end
|
71
|
-
puts headers
|
72
|
-
|
73
|
-
if request.headers['Zuora-Auth-Token'].present?
|
66
|
+
if request.headers['ZuoraCurrentEntity'].present?
|
74
67
|
|
75
68
|
#Do we need to refresh session identity
|
76
69
|
zuora_host = request.headers["HTTP_X_FORWARDED_HOST"] || "apisandbox.zuora.com"
|
77
70
|
if request.headers["Zuora-Auth-Token"].present?
|
78
71
|
zuora_client = ZuoraAPI::Oauth.new(url: "https://#{zuora_host}", bearer_token: request.headers["Zuora-Auth-Token"], oauth_session_expires_at: Time.now + 5.minutes )
|
79
|
-
|
72
|
+
elsif cookies['ZSession'].present?
|
80
73
|
zuora_client = ZuoraAPI::Basic.new(url: "https://#{zuora_host}", session: cookies['ZSession'])
|
74
|
+
else
|
75
|
+
raise ZuoraConnect::Exceptions::Error.new("Neither the ZSession cookie nor the Zuora-Auth-Token are present in payload.")
|
81
76
|
end
|
82
77
|
zuora_entity_id = request.headers['ZuoraCurrentEntity']
|
83
78
|
zuora_instance_id = params[:sidebar_launch].to_bool ? nil : (params[:app_instance_id] || session["appInstance"])
|
@@ -179,7 +174,7 @@ module ZuoraConnect
|
|
179
174
|
}
|
180
175
|
}
|
181
176
|
|
182
|
-
oauth_response, response = zuora_client.rest_call(method: :post, body: body.to_json, url: zuora_client.rest_endpoint("genesis/clients").gsub('v1/', ''), session_type: :bearer)
|
177
|
+
oauth_response, response = zuora_client.rest_call(method: :post, body: body.to_json, url: zuora_client.rest_endpoint("genesis/clients").gsub('v1/', ''), session_type: zuora_client.class == ZuoraAPI::Oauth ? :bearer : :basic, headers: zuora_client.class == ZuoraAPI::Oauth ? {} : {'Authorization' => "ZSession-a3N2w #{zuora_client.get_session(prefix: false, auth_type: :basic)}"})
|
183
178
|
|
184
179
|
new_zuora_client = ZuoraAPI::Oauth.new(url: "https://#{zuora_host}", oauth_client_id: oauth_response["clientId"], oauth_secret: oauth_response["clientSecret"] )
|
185
180
|
|