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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 239f7a1bb6772f339b0c133922484240ab3d1386977da45fd19c056efe8ab287
4
- data.tar.gz: 953110b10aa289412dba1f78e7d20fef51c25fb7e7d5a727b7cc2e87e46a6bdf
3
+ metadata.gz: c0618f1c601bbe6126bb0c784b0cc182b079be6411cc456c6f47ad59d9b24273
4
+ data.tar.gz: 4ed51983f75b4550f79c3c8abfe3e351b455a9bf4cb1ea4b39e0ae49fe6a21df
5
5
  SHA512:
6
- metadata.gz: d36513091307381a8f13907ccd9e9c1302e2745fb071f7b895edca58d5e769e002ea749a65a55c71d7a1d86a085c54e07df628e208c0b134617021d75696dd4d
7
- data.tar.gz: e422088de704297c8ab7cbf9a876f120059d9ed641ad31d6ed54fa43520e88ee5beb1b81c172e3adb10f9a82e3466a6946c9c057d88a26062e3a38052ec6925b
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
- <% last_line = false %>
63
- <% exception.backtrace.each do |line| %>
64
- <% ending = last_line && !line.include?(Rails.root.to_s) ? false : true %>
65
- <% break if !ending%>
66
- <% if ending %>
67
- <%= line %><br>
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
- <% last_line = line.include?(Rails.root.to_s) %>
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
@@ -3,6 +3,7 @@ module ZuoraConnect
3
3
 
4
4
  class HoldingPattern < StandardError; end
5
5
  class MissMatch < StandardError; end
6
+ class InvalidCredentialSet < StandardError; end
6
7
  class Error < StandardError; end
7
8
  class AuthorizationNotPerformed < Error; end
8
9
 
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.26"
2
+ VERSION = "2.0.27"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.26
4
+ version: 2.0.27
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team