zuora_connect 2.0.26 → 2.0.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/zuora_connect/app_instance_base.rb +8 -2
- data/app/models/zuora_connect/login.rb +1 -0
- data/app/views/zuora_connect/static/error_unhandled.erb +11 -7
- data/lib/zuora_connect/controllers/helpers.rb +18 -0
- data/lib/zuora_connect/exceptions.rb +1 -0
- 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: c0618f1c601bbe6126bb0c784b0cc182b079be6411cc456c6f47ad59d9b24273
|
4
|
+
data.tar.gz: 4ed51983f75b4550f79c3c8abfe3e351b455a9bf4cb1ea4b39e0ae49fe6a21df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aee44be1d63cf6f8d4fb732583cc8ef4082d6e4e11cb5d6e004f080527e0b83e50d909c52f1359e112c0fe69bd7ab9ae7d4fd972b1c458a9d66eed6b69de891f
|
7
|
+
data.tar.gz: 93ad97bd1aecb2f0056e682fbf9b488a178bc93dc8b09437721d2c614d3b8236a01e4e56e471ac53f88d1feddcc55af9a3935d447a8d424b7e79aa04025c8fb5
|
@@ -206,6 +206,8 @@ module ZuoraConnect
|
|
206
206
|
session = {}
|
207
207
|
ZuoraConnect.logger.error(ex, self.default_ougai_items.merge({app_instance_id_new: self.task_data['id']}))
|
208
208
|
retry
|
209
|
+
rescue ZuoraConnect::Exceptions::InvalidCredentialSet => ex
|
210
|
+
raise
|
209
211
|
rescue => ex
|
210
212
|
if recoverable_session
|
211
213
|
ZuoraConnect.logger.warn("REBUILDING - Using backup expired cache", ex, self.default_ougai_items)
|
@@ -333,10 +335,11 @@ module ZuoraConnect
|
|
333
335
|
resp = kms_client.decrypt({ciphertext_blob: [value].pack("H*") })
|
334
336
|
return resp.plaintext
|
335
337
|
rescue *AWS_AUTH_ERRORS => ex
|
336
|
-
Rails.logger.error(AWS_AUTH_ERRORS_MSG, ex)
|
337
338
|
if (kms_tries += 1) < 3
|
339
|
+
Rails.logger.warn(AWS_AUTH_ERRORS_MSG, ex)
|
338
340
|
retry
|
339
341
|
else
|
342
|
+
Rails.logger.error(AWS_AUTH_ERRORS_MSG, ex)
|
340
343
|
raise
|
341
344
|
end
|
342
345
|
end
|
@@ -348,10 +351,11 @@ module ZuoraConnect
|
|
348
351
|
resp = kms_client.encrypt({key_id: kms_key, plaintext: value})
|
349
352
|
return resp.ciphertext_blob.unpack('H*').first
|
350
353
|
rescue *AWS_AUTH_ERRORS => ex
|
351
|
-
Rails.logger.error(AWS_AUTH_ERRORS_MSG, ex)
|
352
354
|
if (kms_tries += 1) < 3
|
355
|
+
Rails.logger.warn(AWS_AUTH_ERRORS_MSG, ex)
|
353
356
|
retry
|
354
357
|
else
|
358
|
+
Rails.logger.error(AWS_AUTH_ERRORS_MSG, ex)
|
355
359
|
raise
|
356
360
|
end
|
357
361
|
end
|
@@ -495,6 +499,8 @@ module ZuoraConnect
|
|
495
499
|
end
|
496
500
|
rescue ZuoraConnect::Exceptions::MissMatch => ex
|
497
501
|
raise
|
502
|
+
rescue ZuoraConnect::Exceptions::InvalidCredentialSet => ex
|
503
|
+
raise
|
498
504
|
rescue => ex
|
499
505
|
ZuoraConnect.logger.error(ex)
|
500
506
|
ZuoraConnect.logger.error("Task Data: #{task_data}") if task_data.present?
|
@@ -7,6 +7,7 @@ module ZuoraConnect
|
|
7
7
|
login_fields = fields.map{|k,v| [k.to_sym, v]}.to_h
|
8
8
|
login_type = fields.dig("authentication_type").blank? ? 'Basic' : fields.dig("authentication_type").capitalize
|
9
9
|
|
10
|
+
raise ZuoraConnect::Exceptions::InvalidCredentialSet.new("Cannot setup application with ZSession Login.") if login_type == "Session"
|
10
11
|
@clients["Default"] = "::ZuoraAPI::#{login_type}".constantize.new(login_fields)
|
11
12
|
@default_entity = fields["entities"][0]["id"] if (fields.dig("entities") || []).size == 1
|
12
13
|
if fields["entities"] && fields["entities"].size > 0
|
@@ -59,14 +59,18 @@
|
|
59
59
|
<div class="dialog" style='max-width: 74em;'>
|
60
60
|
<div><h1><%= exception.class %> - '<%= exception.message %>'</h1></div>
|
61
61
|
<p style='text-align: left;'>
|
62
|
-
<%
|
63
|
-
|
64
|
-
<%
|
65
|
-
|
66
|
-
|
67
|
-
|
62
|
+
<% if !defined?(skip_exception) %>
|
63
|
+
<% last_line = false %>
|
64
|
+
<% exception.backtrace.each do |line| %>
|
65
|
+
<% ending = last_line && !line.include?(Rails.root.to_s) ? false : true %>
|
66
|
+
<% break if !ending%>
|
67
|
+
<% if ending %>
|
68
|
+
<%= line %><br>
|
69
|
+
<% end %>
|
70
|
+
<% last_line = line.include?(Rails.root.to_s) %>
|
68
71
|
<% end %>
|
69
|
-
|
72
|
+
<% else %>
|
73
|
+
Please contact Zuora Support. RequestId: <%= request.uuid %>
|
70
74
|
<% end %>
|
71
75
|
</p>
|
72
76
|
</div>
|
@@ -365,6 +365,24 @@ module ZuoraConnect
|
|
365
365
|
end
|
366
366
|
|
367
367
|
ZuoraConnect.logger.debug("[#{@appinstance.blank? ? "N/A" : @appinstance.id}] Authenticate App Request Completed In - #{(Time.now - start_time).round(2)}s")
|
368
|
+
|
369
|
+
rescue ZuoraConnect::Exceptions::InvalidCredentialSet => ex
|
370
|
+
id = @appinstance.id
|
371
|
+
ZuoraConnect::AppInstance.destroy(id)
|
372
|
+
Apartment::Tenant.drop(id)
|
373
|
+
render "zuora_connect/static/error_handled", :locals => {
|
374
|
+
:title => "Application Setup Error",
|
375
|
+
:message => "Application cannot be run using Zuora Session. Delete old application \
|
376
|
+
deployment and create new with Zuora Basic or OAuth credentials."
|
377
|
+
}, :layout => false
|
378
|
+
return
|
379
|
+
rescue => ex
|
380
|
+
ZuoraConnect.logger.error("UI Authorization Error", ex)
|
381
|
+
respond_to do |format|
|
382
|
+
format.html { render 'zuora_connect/static/error_unhandled', :locals => {:exception => ex, :skip_exception => true}, status: 500, layout: false }
|
383
|
+
format.js { render 'zuora_connect/static/error_unhandled', :locals => {:exception => ex, :skip_exception => true}, status: 500, layout: false}
|
384
|
+
end
|
385
|
+
return
|
368
386
|
end
|
369
387
|
|
370
388
|
def persist_connect_app_session
|