zuora_connect 3.0.0.pre.t → 3.0.0.pre.y

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: 81197d2fca3e19e8602342a820948d21963735397119b0c992cb316452e25bba
4
- data.tar.gz: 43466f6d39c34bb60fa13e63a57c70dc23b9466c0a15a21b9f404a368e4efef1
3
+ metadata.gz: 84a8e3703c93dd6101a516df7b21df42ccc2e3ffcd9e3452c9554eb797a80dfa
4
+ data.tar.gz: b63dcc260cac82901a95cb53d5146fa1e89609a7ecb0277bb72af590d67a4ee8
5
5
  SHA512:
6
- metadata.gz: 6265d548693f0ff43e39ea5cbec79db9245023f4bc0891ab9c6f7772b795927ef071fd06cadc67043effc0fdab05ecbca7c8dec6064004fa28723617521593f8
7
- data.tar.gz: e1ab4768c5037e459b0111ae1a711c04f0163d061c2460e6e5a6c14e383f5f27ed5eb188d6b891ceb6942784d2e73c03f384896a81799d0e1252ebdfb00a34cd
6
+ metadata.gz: 53c256ae2635f5a0f502351978c2dd70d2781fbc3daa0b09f0c0d45820d45f3f47eafbde3c6ab9be0bb3841e27a3d4d8c3f27dfb9f901f602db10beefff1d01c
7
+ data.tar.gz: db3bbb11f4ad1cdc5f5a9dbbd3ddf3a8ea16266f97ab386e8295af3374a95d805aaa594bdb1364c8963d9d681e52edc26fcfe16e784cc91fe027e4967a58191b
@@ -10,7 +10,7 @@ module ActiveRecord
10
10
 
11
11
  return if loaded_from_cache?(initializer)
12
12
 
13
- if supports_ranges?
13
+ if Rails::VERSION::MAJOR >= 6 || supports_ranges?
14
14
  query = <<-SQL
15
15
  SELECT DISTINCT on (t.typname) t.oid, t.typname, t.typelem, t.typdelim, t.typinput, r.rngsubtype, t.typtype, t.typbasetype
16
16
  FROM pg_type as t
@@ -1,21 +1,24 @@
1
+ # frozen_string_literal: true
2
+
1
3
  ZuoraObservability.configure do |config|
2
4
  config.zecs_service_hook = lambda do |controller|
3
5
  custom_payload = {}
4
- if controller.instance_variable_defined?(:@appinstance)
5
- appinstance = controller.instance_variable_get(:@appinstance)
6
- if appinstance.logitems.present? && appinstance.logitems.class == Hash
7
- ActiveSupport::Deprecation.warn("logitems is deprecated, please use zecs_service_hook. See 'https://gitlab.zeta.tools/extension-products/incubating-projects/zuora_observability/-/blob/master/doc/logging.md' for more details.")
8
- custom_payload.merge!(appinstance.logitems)
9
- end
6
+ appinstance = controller.instance_variable_get(:@appinstance)
7
+
8
+ if appinstance&.logitems.present? && appinstance.logitems.class == Hash
9
+ ActiveSupport::Deprecation.warn("logitems is deprecated, please use zecs_service_hook. See 'https://gitlab.zeta.tools/extension-products/incubating-projects/zuora_observability/-/blob/master/doc/logging.md' for more details.")
10
+ custom_payload.merge!(appinstance.logitems)
10
11
  end
12
+
11
13
  custom_payload
12
14
  end
15
+
13
16
  config.add_custom_payload_hook do |controller|
14
17
  custom_payload = {}
15
- if controller.instance_variable_defined?(:@appinstance)
16
- appinstance = controller.instance_variable_get(:@appinstance)
17
- custom_payload.merge!({ email: appinstance.connect_user })
18
- end
18
+ appinstance = controller.instance_variable_get(:@appinstance)
19
+
20
+ custom_payload.merge!({ email: appinstance.connect_user }) if appinstance
21
+
19
22
  custom_payload
20
23
  end
21
24
  end
data/lib/zuora_connect.rb CHANGED
@@ -31,6 +31,14 @@ module ZuoraConnect
31
31
  @logger ||= ZuoraObservability::Logger.custom_logger(name: "Connect", level: Rails.logger.level)
32
32
  end
33
33
  end
34
+
35
+ def app_name
36
+ if Rails::VERSION::MAJOR >= 6
37
+ Rails.application.class.module_parent_name
38
+ else
39
+ Rails.application.class.parent_name
40
+ end
41
+ end
34
42
  end
35
43
 
36
44
  module Controllers
@@ -86,7 +94,7 @@ module ZuoraConnect
86
94
  ignore_url_patterns: ['^\/admin\/resque.*', '^\/admin\/redis.*', '^\/admin\/peek.*', '^\/peek.*'],
87
95
  verify_server_cert: false,
88
96
  log_level: Logger::INFO,
89
- service_name: ENV['DEIS_APP'].present? ? ENV['DEIS_APP'] : Rails.application.class.parent_name,
97
+ service_name: ENV['DEIS_APP'].present? ? ENV['DEIS_APP'] : ZuoraConnect.app_name,
90
98
  logger: ZuoraObservability::Logger.custom_logger(name: "ElasticAPM", level: Logger::WARN)
91
99
  })
92
100
  defaults.merge!({disable_send: true}) if defined?(Rails::Console)
@@ -43,7 +43,7 @@ module ZuoraConnect
43
43
  @dev_mode_access_key_id = nil
44
44
  @aws_region = "us-west-2"
45
45
  @s3_bucket_name = "rbm-apps"
46
- @s3_folder_name = Rails.application.class.parent_name
46
+ @s3_folder_name = ZuoraConnect.app_name
47
47
  end
48
48
 
49
49
  def private_key
@@ -550,11 +550,11 @@ module ZuoraConnect
550
550
  final_error = output_xml.xpath('//fns:FaultCode', 'fns' =>'http://fault.api.zuora.com/').text
551
551
  session.clear
552
552
  if final_error.blank?
553
- ZuoraConnect.logger.warn("UI Authorization Error", ex, zuora: zuora_details.merge({:error => response.body}))
553
+ ZuoraConnect.logger.warn("UI Authorization Error", ex, response: { params: response.body })
554
554
  elsif final_error != "INVALID_SESSION"
555
- ZuoraConnect.logger.warn("UI Authorization Error", ex, zuora: zuora_details.merge({:error => final_error}))
555
+ ZuoraConnect.logger.warn("UI Authorization Error", ex, response: { params: final_error })
556
556
  else
557
- ZuoraConnect.logger.info("UI Authorization Error", ex, zuora: zuora_details.merge({:error => final_error}))
557
+ ZuoraConnect.logger.info("UI Authorization Error", ex, response: { params: final_error })
558
558
  end
559
559
  redirect_to "https://#{zuora_host}/apps/newlogin.do?retURL=#{request.fullpath}"
560
560
  return
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "3.0.0-t"
2
+ VERSION = "3.0.0-y"
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: 3.0.0.pre.t
4
+ version: 3.0.0.pre.y
5
5
  platform: ruby
6
6
  authors:
7
7
  - Connect Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-07 00:00:00.000000000 Z
11
+ date: 2021-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment
@@ -109,7 +109,7 @@ dependencies:
109
109
  version: 4.1.0
110
110
  - - "<"
111
111
  - !ruby/object:Gem::Version
112
- version: '5.3'
112
+ version: '6.1'
113
113
  type: :runtime
114
114
  prerelease: false
115
115
  version_requirements: !ruby/object:Gem::Requirement
@@ -119,7 +119,7 @@ dependencies:
119
119
  version: 4.1.0
120
120
  - - "<"
121
121
  - !ruby/object:Gem::Version
122
- version: '5.3'
122
+ version: '6.1'
123
123
  - !ruby/object:Gem::Dependency
124
124
  name: raindrops
125
125
  requirement: !ruby/object:Gem::Requirement