zuora_connect 2.0.5u → 2.0.5v

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: 378a400286be7170e3b66905822916f0f31c94151d3bcf0ae916223d4494ea75
4
- data.tar.gz: '0592885553ba2d34ed9e42f8f7046257b6eb7e85dfe0b471e29550a30e1d0275'
3
+ metadata.gz: f1f2b88fd1b3305c5c677d14f745aea85335bee8cedac9200de6f827958c69d8
4
+ data.tar.gz: 4fcd495431d0068a304f725607e0269c3a6eaab05eb0d2e0f59ec8630deaad6d
5
5
  SHA512:
6
- metadata.gz: 8d15211442ee1bd0dc9125394e28c04dffc85795eeff8eb68fa543caff972a4f4e80feaec58607f2b7158e38bcd89de9652bb2d76cb6043ffc97793185fc4f46
7
- data.tar.gz: 340d94c610a2b42cadbc0e716c0ff8a4658e20359919066df4e873704f032a0dd29b9047accde103db8ef579a2181db523675412f24fd3cf5abdc912cc181136
6
+ metadata.gz: 0b5d44b0ce40d3a170245a72f21b7a986913d2ccdc8f2c65c43cd9ab60ff1cd869d31b7ea591c45257858f3aeab51509f7a9c4bb4074566835799489ba85915d
7
+ data.tar.gz: 301b473fe5774e8dfb3526daa2a7fb854f68253c7c438a4e5398249822395db2cd37708f5b65015366c1f2b78232abdde7c03d2e1efff2920d59b9750e298a10
@@ -112,14 +112,10 @@ module ZuoraConnect
112
112
  session["ZuoraCurrentEntity"] = identity['entityId']
113
113
  session["ZSession"] = cookies['ZSession']
114
114
  zuora_instance_id = nil
115
-
116
- begin
117
- client_describe, response = zuora_client.rest_call(url: zuora_client.rest_endpoint("genesis/user/info").gsub('v1/', ''), session_type: zuora_client.class == ZuoraAPI::Oauth ? :bearer : :basic, headers: zuora_client.class == ZuoraAPI::Oauth ? {} : {'Authorization' => "ZSession-a3N2w #{zuora_client.get_session(prefix: false, auth_type: :basic)}"})
118
- session["ZuoraCurrentUserInfo"] = client_describe
119
- rescue => ex
120
- ZuoraConnect.logger.error(ex)
121
- end
122
115
 
116
+ client_describe, response = zuora_client.rest_call(url: zuora_client.rest_endpoint("genesis/user/info").gsub('v1/', ''), session_type: zuora_client.class == ZuoraAPI::Oauth ? :bearer : :basic, headers: zuora_client.class == ZuoraAPI::Oauth ? {} : {'Authorization' => "ZSession-a3N2w #{zuora_client.get_session(prefix: false, auth_type: :basic)}"})
117
+ session["ZuoraCurrentUserInfo"] = client_describe
118
+
123
119
  raise ZuoraConnect::Exceptions::Error.new("Header entity id, '#{zuora_entity_id}' does not match identity call entity id, '#{identity['entityId']}'.") if zuora_entity_id != identity['entityId']
124
120
  end
125
121
 
@@ -187,11 +183,10 @@ module ZuoraConnect
187
183
 
188
184
  ActiveRecord::Base.transaction do
189
185
  ActiveRecord::Base.connection.execute('LOCK public.zuora_users IN ACCESS EXCLUSIVE MODE')
190
- sleep(5) #Sleep needed to wait for instance insertion
191
186
  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)
187
+
192
188
  if appinstances.size > 0
193
- ZuoraConnect.logger.warn("Double tenant create for '#{zuora_client.rest_domain}' - '#{zuora_entity_id}' - '#{session["ZuoraCurrentIdentity"]["username"]}'")
194
- redirect_to "https://#{zuora_host}/apps/newlogin.do?retURL=#{CGI.escape(request.fullpath)}"
189
+ redirect_to "https://#{zuora_host}/apps/newlogin.do?retURL=#{request.fullpath}"
195
190
  return
196
191
  end
197
192
 
@@ -234,7 +229,7 @@ module ZuoraConnect
234
229
  },
235
230
  "tenant_ids": available_entities.map{|e| e['entityId'] }.push(client_describe["tenantId"]).uniq,
236
231
  }
237
- mapped_values = {:id => next_id, :api_token => rand(36**64).to_s(36), :token => rand(36**64).to_s(36), :zuora_logins => task_data, :oauth_expires_at => Time.now + 1000.years}
232
+ mapped_values = {:id => next_id, :api_token => rand(36**64).to_s(36), :token => rand(36**64).to_s(36), :zuora_logins => task_data, :oauth_expires_at => Time.now + 1000.years, :zuora_domain => zuora_client.rest_domain, :zuora_entity_ids => [zuora_entity_id]}
238
233
  @appinstance = ZuoraConnect::AppInstance.new(mapped_values)
239
234
  retry_count = 0
240
235
  begin
@@ -1,3 +1,3 @@
1
1
  module ZuoraConnect
2
- VERSION = "2.0.5u"
2
+ VERSION = "2.0.5v"
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.5u
4
+ version: 2.0.5v
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-06-26 00:00:00.000000000 Z
11
+ date: 2019-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: apartment