zuora_connect 2.0.57q → 2.0.57v

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: c995e980fc49090f445c00d1983f0beff9659d1bad0cce9e4614d049f9ca2d54
4
- data.tar.gz: 4a8c8d1b677c670b2d85556285483ec6e8bfaec5a2b43c8d1f2464c840ea9d57
3
+ metadata.gz: 93c1dee03d87f58c7830c73dccfbfeca3d3bc58843cfa550d5395b8c350dc1b8
4
+ data.tar.gz: 768068d2557358a6931d86f4a75c60830e7fb27f487126cd63bff272e059fbed
5
5
  SHA512:
6
- metadata.gz: 29326ffff3c7c8c7407b1f8c8ac17688112c141f99faa93a58df4bf33f40ebbee48d29a00f6db702309691d77e1f31aa3662dfd5364dc857beb3ba76f2c3c911
7
- data.tar.gz: 2740a87852d216d2e954de4573b45b098ecbcaf53fb28cf77683ed449e24e28c553e9e4aab47ee18a6fc7d62457ae8178b65371e9b052b48418b330c8dc28eaf
6
+ metadata.gz: 62e81faf9dd8b28fa61976624c93c1c4a56124289e3796a4984ce45878a2373716e6c04b317e20a39b19a0673dfe620d30e6f56b1083e6b61ccf4dad1ea5a7f7
7
+ data.tar.gz: 9c107f53da71710702b7086b01bd2eee851ddf1b3281ed82648436e3916dfe34dc2862f2c04061b37a1868d5daf6527ed2686d746467029ea5e924aebd91c4bd
@@ -203,7 +203,7 @@ module ZuoraConnect
203
203
  else
204
204
  self.new_session_message = "REBUILDING - Expires in #{time_expire} seconds"
205
205
  end
206
- ZuoraConnect.logger.debug(self.new_session_message)
206
+ ZuoraConnect.logger.debug(self.new_session_message, self.default_ougai_items)
207
207
  self.build_task(task_data: session["#{self.id}::task_data"], session: session)
208
208
  end
209
209
  end
@@ -1217,6 +1217,16 @@ module ZuoraConnect
1217
1217
  end
1218
1218
  end
1219
1219
 
1220
+ def self.without_sticking
1221
+ if self.connection.respond_to?(:without_sticking)
1222
+ self.connection.without_sticking do
1223
+ yield
1224
+ end
1225
+ else
1226
+ yield
1227
+ end
1228
+ end
1229
+
1220
1230
  method_hook :updateOption, :update_logins, :before => :check_oauth_state
1221
1231
  method_hook :new_session, :refresh, :build_task, :after => :apartment_switch
1222
1232
  end
@@ -19,7 +19,6 @@ module ZuoraConnect
19
19
  ElasticAPM.set_label(:trace_id, request.uuid) if defined?(ElasticAPM) && ElasticAPM.running?
20
20
  end
21
21
  end
22
- start_time = Time.now
23
22
  if request.headers["API-Token"].present?
24
23
  @appinstance = ZuoraConnect::AppInstance.find_by(:api_token => request.headers["API-Token"])
25
24
  ZuoraConnect.logger.debug("API REQUEST - API token") if @appinstance.present?
@@ -48,7 +47,7 @@ module ZuoraConnect
48
47
  render json: {"status": 401, "message": "Missing mapping or no deployment for '#{zuora_host}-#{zuora_entity_id}' ."}, status: :unauthorized
49
48
  return
50
49
  elsif appinstances.size > 1
51
- render json: {"status": 401, "message": "More than one app instance binded to host and entity ids. Please indicate correct instance via 'zuora-instance-id' header", "instances": appinstances.map {|instance| instance.id } }, status: :unauthorized
50
+ render json: {"status": 401, "message": "More than one app instance binded to host and entity ids. Please indicate correct instance via 'zuora-instance-id' header", "instances": appinstances.map {|instance| instance.id }.sort }, status: :unauthorized
52
51
  return
53
52
  else
54
53
  @appinstance = appinstances.first
@@ -65,10 +64,6 @@ module ZuoraConnect
65
64
  else
66
65
  check_instance
67
66
  end
68
-
69
- if @appinstance.present?
70
- ZuoraConnect.logger.debug("Authenticate App API Request Completed In - #{(Time.now - start_time).round(2)}s")
71
- end
72
67
  end
73
68
  end
74
69
 
@@ -101,7 +96,6 @@ module ZuoraConnect
101
96
  ElasticAPM.set_label(:trace_id, request.uuid)
102
97
  end
103
98
  end
104
- start_time = Time.now
105
99
 
106
100
  if ZuoraConnect.configuration.mode == "Production"
107
101
  setup_instance_via_prod_mode
@@ -141,8 +135,6 @@ module ZuoraConnect
141
135
  rescue
142
136
  ZuoraConnect.logger.error(ex)
143
137
  end
144
-
145
- ZuoraConnect.logger.debug("Authenticate App Request Completed In - #{(Time.now - start_time).round(2)}s")
146
138
  end
147
139
  rescue ZuoraConnect::Exceptions::InvalidCredentialSet => ex
148
140
  id = @appinstance.id
@@ -330,8 +322,8 @@ module ZuoraConnect
330
322
  end
331
323
  end
332
324
  end
333
- appinstances ||= ZuoraConnect::AppInstance.where("zuora_entity_ids ?& array[:entities] = true AND zuora_domain = :host", entities: [zuora_entity_id], host: zuora_client.rest_domain).pluck(:id, :name)
334
325
  end
326
+ appinstances ||= ZuoraConnect::AppInstance.where("zuora_entity_ids ?& array[:entities] = true AND zuora_domain = :host", entities: [zuora_entity_id], host: zuora_client.rest_domain).pluck(:id, :name)
335
327
  end
336
328
 
337
329
  zuora_user_id = cookies['Zuora-User-Id'] || session["ZuoraCurrentIdentity"]['userId']
@@ -503,7 +495,7 @@ module ZuoraConnect
503
495
  end
504
496
  return
505
497
  end
506
- elsif request["data"] && /^([A-Za-z0-9+\/\-\_]{4})*([A-Za-z0-9+\/]{4}|[A-Za-z0-9+\/]{3}=|[A-Za-z0-9+\/]{2}==)$/.match(request["data"].to_s)
498
+ elsif request["data"].present? && (request["connectInstanceId"].present? || /^([A-Za-z0-9+\/\-\_]{4})*([A-Za-z0-9+\/]{4}|[A-Za-z0-9+-_\/]{3}=|[A-Za-z0-9+\/]{2}==)$/.match(request["data"].to_s))
507
499
  session.clear
508
500
  values = JSON.parse(ZuoraConnect::AppInstance.decrypt_response(Base64.urlsafe_decode64(request["data"])))
509
501
  values.fetch("param_data", {}).each do |k ,v|
@@ -518,8 +510,6 @@ module ZuoraConnect
518
510
  session["#{values["appInstance"]}::user::email"] = values["current_user"]["email"]
519
511
  end
520
512
 
521
- ZuoraConnect.logger.debug({msg: 'Setup values', connect: values}) if Rails.env != "production"
522
-
523
513
  @appinstance = ZuoraConnect::AppInstance.find_by(:id => values["appInstance"].to_i)
524
514
 
525
515
  if @appinstance.blank?
@@ -13,6 +13,7 @@ module ZuoraConnect
13
13
  PATH_INFO
14
14
  CONTENT_TYPE
15
15
  ORIGINAL_FULLPATH
16
+ QUERY_STRING
16
17
  )
17
18
 
18
19
  config.before_initialize do
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.57q"
2
+ VERSION = "2.0.57v"
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.57q
4
+ version: 2.0.57v
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-12 00:00:00.000000000 Z
11
+ date: 2020-06-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment