zuora_connect 2.0.57o → 2.0.57t

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: 1692b9f860fffa7a5803c1b8b350ff8993776c1429f38856003e2e26616bd3f2
4
- data.tar.gz: e27e7374bf7bb8702bd91d6a56192a52d57972b97bbfa1190215b2dc621a7d4e
3
+ metadata.gz: a6a432dac08dcd5fd8991267982829432b40f48269373750fef562dea155470d
4
+ data.tar.gz: 7d937dabdcc5041cf8d530bd6097697eb1daa49fc3e5b47dcd0e5a12f2b430be
5
5
  SHA512:
6
- metadata.gz: 163c992e5c65874e64319b125844372caef0f47f6bfa97d7b4c7f20ad1b51892caebf094e37b03c6dbececb1457891fd2a699ce3334ee09faef7fd917a5544eb
7
- data.tar.gz: 01bb8be466e1bfe9d4ce25627ef0046fd4f6ebb1bf4136edb847ca95f8f2d34b41a9feb16cb859c9f421c589f5f6afbf79ddd2ec2654ff4147c06711af32353e
6
+ metadata.gz: f236a77c9ad30b8c414d2e98e26fcc03a1552297d59563a6570383ea63d9653b1f805c337dca0ddad0d465562c358083be0b53f258e312907e9a45c7059f5bc5
7
+ data.tar.gz: 5dd6d0add7818a99206e9d8f53d5ebabd587304db00ade4afec9e99eb348225415880c316c40674d85f21d8158995a10875662628dec717b1abb7042eadb0fc1
@@ -210,7 +210,7 @@ module ZuoraConnect
210
210
  return self
211
211
  rescue ZuoraConnect::Exceptions::HoldingPattern => ex
212
212
  while self.marked_for_refresh?
213
- ZuoraConnect.logger.info("Holding - Expires in #{self.reset_mark_expires_at}. '#{self.new_session_message}'")
213
+ ZuoraConnect.logger.info("Holding - Expires in #{self.reset_mark_expires_at}. '#{self.new_session_message}'", self.default_ougai_items)
214
214
  sleep(HOLDING_PATTERN_SLEEP)
215
215
  end
216
216
  self.reload_attributes([:refresh_token, :oauth_expires_at, :access_token])
@@ -219,7 +219,7 @@ module ZuoraConnect
219
219
  rescue ZuoraConnect::Exceptions::MissMatch => ex
220
220
  self.delete_app_instance
221
221
  session = {}
222
- ZuoraConnect.logger.error(ex, app_instance_id_new: self.task_data['id'])
222
+ ZuoraConnect.logger.error(ex, self.default_ougai_items.merge({app_instance_id_new: self.task_data['id']}))
223
223
  retry
224
224
  rescue ZuoraConnect::Exceptions::InvalidCredentialSet => ex
225
225
  raise
@@ -229,7 +229,7 @@ module ZuoraConnect
229
229
  self.build_task(task_data: session["#{self.id}::task_data"], session: session)
230
230
  return self
231
231
  else
232
- ZuoraConnect.logger.error("Failed new session", ex)
232
+ ZuoraConnect.logger.error("Failed new session", ex, self.default_ougai_items)
233
233
  raise
234
234
  end
235
235
  ensure
@@ -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
@@ -48,7 +48,7 @@ module ZuoraConnect
48
48
  render json: {"status": 401, "message": "Missing mapping or no deployment for '#{zuora_host}-#{zuora_entity_id}' ."}, status: :unauthorized
49
49
  return
50
50
  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
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 }.sort }, status: :unauthorized
52
52
  return
53
53
  else
54
54
  @appinstance = appinstances.first
@@ -316,18 +316,22 @@ module ZuoraConnect
316
316
  }, :layout => false
317
317
  return
318
318
  end
319
- ZuoraConnect::Exceptions::APIError.new(message: "#{app_env} navbar url was blank", response: response)
319
+ raise ZuoraConnect::Exceptions::APIError.new(message: "#{app_env} navbar url was blank", response: response)
320
320
  else
321
- begin
322
- task_ids = JSON.parse(Base64.urlsafe_decode64(CGI.parse(URI.parse(url).query)["app_instance_ids"][0]))
323
- rescue => ex
324
- raise ZuoraConnect::Exceptions::APIError.new(message: "Failure in parsing the navbar urls.", response: response)
321
+ query_params = CGI.parse(URI.parse(url).query)
322
+ app_instance_ids = query_params["app_instance_ids"][0]
323
+ if app_instance_ids.present?
324
+ begin
325
+ task_ids = JSON.parse(Base64.urlsafe_decode64(app_instance_ids))
326
+
327
+ appinstances = ZuoraConnect::AppInstance.where(:id => task_ids).pluck(:id, :name)
328
+ rescue => ex
329
+ raise ZuoraConnect::Exceptions::APIError.new(message: "Failure in parsing the navbar urls.", response: response)
330
+ end
325
331
  end
326
332
  end
327
- appinstances = ZuoraConnect::AppInstance.where(:id => task_ids).pluck(:id, :name)
328
- else
329
- 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)
330
333
  end
334
+ 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)
331
335
  end
332
336
 
333
337
  zuora_user_id = cookies['Zuora-User-Id'] || session["ZuoraCurrentIdentity"]['userId']
@@ -499,7 +503,7 @@ module ZuoraConnect
499
503
  end
500
504
  return
501
505
  end
502
- 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)
506
+ 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))
503
507
  session.clear
504
508
  values = JSON.parse(ZuoraConnect::AppInstance.decrypt_response(Base64.urlsafe_decode64(request["data"])))
505
509
  values.fetch("param_data", {}).each do |k ,v|
@@ -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.57o"
2
+ VERSION = "2.0.57t"
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.57o
4
+ version: 2.0.57t
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-05 00:00:00.000000000 Z
11
+ date: 2020-06-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment