zuora_connect 3.0.0.pre.u → 3.0.0

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: 4f4b9ba5ffc7b21aa937be3cdcaa7f0eaea83049a03df11099eab23388618c49
4
- data.tar.gz: 27335db91d64f7a61d3f06a497ac623877d6cca2af5853dfcf31f4d632d41147
3
+ metadata.gz: 3b1edf54ef7faa617e8137eb6d1b4cf650175d8afff5c3a151cac0bc44bd93a3
4
+ data.tar.gz: fbe951e3cba35a3d62826600b6010d4eadf4bb6c63182f3b99309a16462e2e28
5
5
  SHA512:
6
- metadata.gz: f57f2047d27820c01e7f6022fb820a4f36748190a79a56916e438a93d45f341467b0b348a925f31044137fecef867edc040b109cb6a3534ceba6de9766cc2a70
7
- data.tar.gz: 41e9d77f37ee9712e48a56fc61bd36c0f586e1375ca063e528fce26da5702ce7ef1ec47cc4c9549deb54675685c36376c72c2726ad6f632831588056aac75461
6
+ metadata.gz: 4afe91d76cf445e9c32e905a7d18a084df21ca84532b18f87306b4472975be4308351f436dfdf94ea42b7f73e1d8e5072817e3d69304a9a6ab494f77a995cc21
7
+ data.tar.gz: 1b77362a64488f0f40d8bec796ddd1d730686ceac2aa1f84da96c01db052df912ec4426a574017d052bb26aeb601f95cdc7a570cbcdef8e0929ba3cb8231e886
@@ -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-u"
2
+ VERSION = "3.0.0"
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.u
4
+ version: 3.0.0
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-09 00:00:00.000000000 Z
11
+ date: 2021-04-20 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
@@ -426,9 +426,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
426
426
  version: '0'
427
427
  required_rubygems_version: !ruby/object:Gem::Requirement
428
428
  requirements:
429
- - - ">"
429
+ - - ">="
430
430
  - !ruby/object:Gem::Version
431
- version: 1.3.1
431
+ version: '0'
432
432
  requirements: []
433
433
  rubygems_version: 3.2.15
434
434
  signing_key: