zuora_connect 2.0.5ze → 2.0.5zg

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
  SHA256:
3
- metadata.gz: 4b1540c24b739efcb771d3b5b7306012e1a335ec0266dba93be95bce836e9f06
4
- data.tar.gz: fb1b24336de23f6dd21056114ced51a513a48004cbd200e2617453465f39fc7e
3
+ metadata.gz: 9b2c5af96c2a7a00a74b397b942817ab2ce03622761e92c2b25ff81c4734eba4
4
+ data.tar.gz: 293379013a5d86e12b8eab8f735ca92879ef0b1874d973059d24aa7358e2e4d0
5
5
  SHA512:
6
- metadata.gz: b0bee3bb92cffa26681e6a6f4787073e5bbe1fc4bbea92e3952d01145cd245c72b9d9d34a40c7188078e44db2d90cf3eb2b6af174283360be929c5b87afc82a9
7
- data.tar.gz: ec6a9d717083b8033eab8869159ba86418fd1a50ebe47d9fda89182edf37f71af224697448d139dee81a0dd89d315ba72856e80877c2dea9d1ae7e9cd6baf81d
6
+ metadata.gz: df998490776be8d9147eb2a4aea83d48b8bce197d96218e94f72fe539601f0ee295720e9aa32d9519ca9fd6a5e3684f77a4aa5a556c2680d78889b325e4d6824
7
+ data.tar.gz: 37305db8b3f4eb55034f36b170ba88ee50df7ffae2c9fe8194f9742b4b6c2f6df5a0c6ab9b8c112984a9fa6545f1d886f3413b8bbd774262ac7df2211ddb9c05
@@ -191,21 +191,24 @@ module ZuoraConnect
191
191
  ZuoraConnect.logger.error(ex) if !IGNORED_LOCALS.include?(ex.locale.to_s.downcase)
192
192
  end
193
193
  Time.zone = self.timezone
194
- tenants = self.task_data.dig('tenant_ids') || []
195
- organizations = self.task_data.dig('organizations') || []
196
- if defined?(ElasticAPM) && ElasticAPM.running?
197
- ElasticAPM.set_tag(:tenant_id, tenants.first)
198
- ElasticAPM.set_tag(:organization, organizations.first)
194
+ if self.task_data.present?
195
+ tenants = self.task_data.fetch('tenant_ids', [])
196
+ organizations = self.task_data.fetch('organizations', [])
197
+ if defined?(ElasticAPM) && ElasticAPM.running?
198
+ ElasticAPM.set_tag(:tenant_id, tenants.first)
199
+ ElasticAPM.set_tag(:organization, organizations.first)
200
+ end
201
+ self.logitem(item: {tenant_ids: tenants, organization: organizations})
202
+
203
+ params = {
204
+ :name => self.task_data.dig('name'),
205
+ :zuora_entity_ids => (self.task_data.dig(LOGIN_TENANT_DESTINATION,'entities') || []).map{|e| e['id']},
206
+ :zuora_tenant_ids => tenants.map(&:to_s),
207
+ }
208
+ params.merge!({:zuora_domain => self.send(LOGIN_TENANT_DESTINATION).client.rest_domain }) if self.methods.include?(LOGIN_TENANT_DESTINATION.to_sym)
209
+ params = params.reject{|k,v| !self.attributes.keys.member?(k.to_s) || self[k] == v}
210
+ self.update_columns(params) if params.present?
199
211
  end
200
- self.logitem(item: {tenant_ids: tenants, organization: organizations})
201
- params = {
202
- :name => self.task_data.dig('name'),
203
- :zuora_entity_ids => (self.task_data.dig(LOGIN_TENANT_DESTINATION,'entities') || []).map{|e| e['id']},
204
- :zuora_tenant_ids => self.task_data.fetch('tenant_ids', []).map(&:to_s),
205
- }
206
- params.merge!({:zuora_domain => self.send(LOGIN_TENANT_DESTINATION).client.rest_domain })
207
- params = params.reject{|k,v| !self.attributes.keys.member?(k.to_s) || self[k] == v}
208
- self.update_columns(params) if params.present?
209
212
  end
210
213
 
211
214
  def refresh(session: {}, session_fallback: false)
@@ -231,7 +234,7 @@ module ZuoraConnect
231
234
  self.cache_app_instance
232
235
  self.reset_mark_for_refresh
233
236
  end
234
- rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
237
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
235
238
  if (refresh_count += 1) < 3
236
239
  sleep(30)
237
240
  ZuoraConnect.logger.info("REFRESH TASK - #{ex.class} Retrying(#{refresh_count})", self.default_ougai_items)
@@ -438,7 +441,7 @@ module ZuoraConnect
438
441
  else
439
442
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
440
443
  end
441
- rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
444
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
442
445
  if (update_login_count += 1) < 3
443
446
  retry
444
447
  else
@@ -466,7 +469,7 @@ module ZuoraConnect
466
469
  else
467
470
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
468
471
  end
469
- rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
472
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
470
473
  if (update_task_count += 1) < 3
471
474
  retry
472
475
  else
@@ -519,7 +522,7 @@ module ZuoraConnect
519
522
  else
520
523
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Refreshing Access Token for #{self.id}", response.body, response.code)
521
524
  end
522
- rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
525
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
523
526
  if (refresh_oauth_count += 1) < 3
524
527
  ZuoraConnect.logger.info("REFRESH OAUTH - #{ex.class} Retrying(#{refresh_oauth_count})", self.default_ougai_items)
525
528
  retry
@@ -580,7 +583,7 @@ module ZuoraConnect
580
583
  begin
581
584
  redis_get_command ||= 0
582
585
  cached_instance = Redis.current.get("AppInstance:#{self.id}")
583
- rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
586
+ rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS + ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
584
587
  if (redis_get_command += 1) < 3
585
588
  retry
586
589
  else
@@ -59,8 +59,14 @@
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 %>
62
63
  <% exception.backtrace.each do |line| %>
63
- <%= line %><br>
64
+ <% ending = last_line && !line.include?(Rails.root.to_s) ? false : true %>
65
+ <% break if !ending%>
66
+ <% if ending %>
67
+ <%= line %><br>
68
+ <% end %>
69
+ <% last_line = line.include?(Rails.root.to_s) %>
64
70
  <% end %>
65
71
  </p>
66
72
  </div>
@@ -103,7 +103,7 @@ module ZuoraConnect
103
103
  }
104
104
  return
105
105
  end
106
- zuora_instance_id = params[:sidebar_launch].to_bool ? nil : (params[:app_instance_id] || session["appInstance"])
106
+ zuora_instance_id = params[:sidebar_launch].to_s.to_bool ? nil : (params[:app_instance_id] || session["appInstance"])
107
107
 
108
108
  #Identity blank or current entity different
109
109
  if (session["ZuoraCurrentIdentity"].blank? || (session["ZuoraCurrentEntity"] != zuora_entity_id) || (session["ZSession"] != cookies['ZSession']))
@@ -385,7 +385,7 @@ module ZuoraConnect
385
385
  if @appinstance.access_token_changed? && @appinstance.refresh_token_changed?
386
386
  @appinstance.save(:validate => false)
387
387
  else
388
- raise ZuoraConnect::Exceptions::AccessDenied.new("Authorization mistmatch. Possible tampering")
388
+ raise ZuoraConnect::Exceptions::AccessDenied.new("Authorization mismatch. Possible tampering")
389
389
  end
390
390
  end
391
391
  end
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.5ze"
2
+ VERSION = "2.0.5zg"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zuora_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5ze
4
+ version: 2.0.5zg
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-08-21 00:00:00.000000000 Z
11
+ date: 2019-08-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -418,44 +418,44 @@ signing_key:
418
418
  specification_version: 4
419
419
  summary: Summary of Connect.
420
420
  test_files:
421
- - test/lib/generators/zuora_connect/datatable_generator_test.rb
422
421
  - test/integration/navigation_test.rb
423
- - test/test_helper.rb
424
- - test/models/zuora_connect/app_instance_test.rb
425
- - test/fixtures/zuora_connect/app_instances.yml
426
422
  - test/controllers/zuora_connect/api/v1/app_instance_controller_test.rb
427
- - test/zuora_connect_test.rb
428
- - test/dummy/README.rdoc
429
- - test/dummy/Rakefile
423
+ - test/fixtures/zuora_connect/app_instances.yml
424
+ - test/dummy/app/controllers/application_controller.rb
425
+ - test/dummy/app/views/layouts/application.html.erb
430
426
  - test/dummy/app/assets/stylesheets/application.css
431
427
  - test/dummy/app/assets/javascripts/application.js
432
- - test/dummy/app/controllers/application_controller.rb
433
428
  - test/dummy/app/helpers/application_helper.rb
434
- - test/dummy/app/views/layouts/application.html.erb
435
- - test/dummy/config/environments/test.rb
429
+ - test/dummy/bin/setup
430
+ - test/dummy/bin/bundle
431
+ - test/dummy/bin/rake
432
+ - test/dummy/bin/rails
433
+ - test/dummy/config/routes.rb
434
+ - test/dummy/config/environment.rb
435
+ - test/dummy/config/application.rb
436
+ - test/dummy/config/boot.rb
437
+ - test/dummy/config/database.yml
436
438
  - test/dummy/config/environments/production.rb
437
439
  - test/dummy/config/environments/development.rb
438
- - test/dummy/config/database.yml
439
- - test/dummy/config/routes.rb
440
- - test/dummy/config/initializers/assets.rb
441
- - test/dummy/config/initializers/cookies_serializer.rb
442
- - test/dummy/config/initializers/mime_types.rb
440
+ - test/dummy/config/environments/test.rb
441
+ - test/dummy/config/secrets.yml
442
+ - test/dummy/config/locales/en.yml
443
+ - test/dummy/config/initializers/inflections.rb
443
444
  - test/dummy/config/initializers/backtrace_silencers.rb
445
+ - test/dummy/config/initializers/mime_types.rb
444
446
  - test/dummy/config/initializers/filter_parameter_logging.rb
447
+ - test/dummy/config/initializers/assets.rb
448
+ - test/dummy/config/initializers/cookies_serializer.rb
445
449
  - test/dummy/config/initializers/session_store.rb
446
450
  - test/dummy/config/initializers/wrap_parameters.rb
447
- - test/dummy/config/initializers/inflections.rb
448
- - test/dummy/config/locales/en.yml
449
- - test/dummy/config/environment.rb
450
- - test/dummy/config/application.rb
451
- - test/dummy/config/boot.rb
452
- - test/dummy/config/secrets.yml
453
- - test/dummy/bin/setup
454
- - test/dummy/bin/rails
455
- - test/dummy/bin/bundle
456
- - test/dummy/bin/rake
457
- - test/dummy/config.ru
458
- - test/dummy/public/422.html
459
- - test/dummy/public/500.html
460
451
  - test/dummy/public/favicon.ico
452
+ - test/dummy/public/500.html
461
453
  - test/dummy/public/404.html
454
+ - test/dummy/public/422.html
455
+ - test/dummy/Rakefile
456
+ - test/dummy/README.rdoc
457
+ - test/dummy/config.ru
458
+ - test/lib/generators/zuora_connect/datatable_generator_test.rb
459
+ - test/test_helper.rb
460
+ - test/zuora_connect_test.rb
461
+ - test/models/zuora_connect/app_instance_test.rb