zuora_connect 2.0.5zz → 2.0.5

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: 89eb67971713f7c5d1f482041a612b88baad3447b060f8bad6158e7716b1fd78
4
- data.tar.gz: 05e431bddf12100125276f9f26863ed858fcad0df15433dfd34b52884668135e
3
+ metadata.gz: 5143516252b30663cce6eff40b07c9364cdcbe566b5a17fea4b55a6d86d23dbd
4
+ data.tar.gz: e967de5bf2ec2a7ba2c6160472e7ca222ca5102827257c69abc96638f15a40f5
5
5
  SHA512:
6
- metadata.gz: 74ddb5fdb50aa38ea8e7a217993898347be48270660760f5e9a963f124ffcaafbe5fa1732dd236e67c57866bb98bc250906ee2d13b6569fb93a6f0009f3d774f
7
- data.tar.gz: 655ecce962805517669a68eb6f1e4517fe0296be77694676c9440d5cedf4d87118fd785ecb4ae8af9bb770fd7012c29fa7f94e57ca2b751ba3b1684dfd0c1f4e
6
+ metadata.gz: bab2c1ec88ec22ab427921e538aeb1133fef59016fa8b019970a421e0909c94ede7ed51888915e0856a276b4113cfdac703e1062c379a621f07d919695d66628
7
+ data.tar.gz: 1334c2fbe71031f57d182f5a2e5364491189f9ce475c4b271be364f78be78c2bb47b098ec95b6ab57292b6d2557bbdcfcc89053711be77976afe0725a6f8cd33
@@ -1,11 +1,25 @@
1
1
  module ZuoraConnect
2
2
  class StaticController < ApplicationController
3
- before_action :authenticate_connect_app_request, :except => [:metrics, :health, :initialize_app]
4
- before_action :clear_connect_app_session, :only => [:metrics, :health, :initialize_app]
5
- after_action :persist_connect_app_session, :except => [:metrics, :health, :initialize_app]
3
+ before_action :authenticate_connect_app_request, :except => [:metrics, :health, :session_error, :invalid_app_instance_error, :initialize_app]
4
+ before_action :clear_connect_app_session, :only => [:metrics, :health, :session_error, :invalid_app_instance_error, :initialize_app]
5
+ after_action :persist_connect_app_session, :except => [:metrics, :health, :session_error, :invalid_app_instance_error, :initialize_app]
6
6
 
7
7
  skip_before_action :verify_authenticity_token, :only => [:initialize_app]
8
8
 
9
+ def session_error
10
+ respond_to do |format|
11
+ format.html
12
+ format.json { render json: { message: "Session Error", status: 500 }, status: 500 }
13
+ end
14
+ end
15
+
16
+ def invalid_app_instance_error
17
+ respond_to do |format|
18
+ format.html
19
+ format.json {render json: { message: "Invalid App Instance", status: 500 }, status: 500 }
20
+ end
21
+ end
22
+
9
23
  def metrics
10
24
  type = params[:type].present? ? params[:type] : "versions"
11
25
  render json: ZuoraConnect::AppInstance.get_metrics(type).to_json, status: 200
@@ -34,7 +48,6 @@ module ZuoraConnect
34
48
  def initialize_app
35
49
  begin
36
50
  authenticate_connect_app_request
37
- @appinstance.new_session(:session => @appinstance.data_lookup(:session => session))
38
51
  render json: {
39
52
  message: "Success",
40
53
  status: 200
@@ -1,15 +1,5 @@
1
1
  module ZuoraConnect
2
2
  module ApplicationHelper
3
- def is_app_admin?
4
- return @appinstance.blank? ? false : session["#{@appinstance.id}::admin"]
5
- end
6
3
 
7
- def zuora_user
8
- return @zuora_user
9
- end
10
-
11
- def connect_meta_tags
12
- "<meta name=\"z-hallway-prefix\" content=\"#{ Thread.current[:isHallway] }\">".html_safe
13
- end
14
4
  end
15
5
  end
@@ -16,7 +16,7 @@ module ZuoraConnect
16
16
  BLANK_OBJECT_ID_LOOKUP = 'BlankValueSupplied'
17
17
  HOLDING_PATTERN_SLEEP = 5.seconds
18
18
  CONNECT_COMMUNICATION_SLEEP= 5.seconds
19
- IGNORED_LOCALS = ['fr', 'ja', 'es', 'zh', 'de']
19
+ IGNORED_LOCALS = ['fr', 'ja', 'sp']
20
20
  INTERNAL_HOSTS = []
21
21
  LOGIN_TENANT_DESTINATION = 'target_login'
22
22
 
@@ -89,11 +89,7 @@ module ZuoraConnect
89
89
  Thread.current[:appinstance] = self
90
90
  end
91
91
 
92
- def default_ougai_items
93
- return {app_instance_id: self.id}
94
- end
95
-
96
- def new_session(session: self.data_lookup, username: self.access_token, password: self.refresh_token, holding_pattern: false, **args)
92
+ def new_session(session: self.data_lookup, username: self.access_token, password: self.refresh_token, holding_pattern: false, log_level: Logger::DEBUG)
97
93
  self.api_version = "v2"
98
94
  self.username = username
99
95
  self.password = password
@@ -127,26 +123,26 @@ module ZuoraConnect
127
123
 
128
124
  if session.empty?
129
125
  self.new_session_message = "REFRESHING - Session Empty"
130
- ZuoraConnect.logger.debug(self.new_session_message, self.default_ougai_items)
126
+ ZuoraConnect.logger.add(log_level, self.new_session_message)
131
127
  raise ZuoraConnect::Exceptions::HoldingPattern if holding_pattern && !self.mark_for_refresh
132
128
  self.refresh(session: session)
133
129
 
134
130
  elsif (self.id != session["appInstance"].to_i)
135
131
  self.new_session_message = "REFRESHING - AppInstance ID(#{self.id}) does not match session id(#{session["appInstance"].to_i})"
136
- ZuoraConnect.logger.debug(self.new_session_message, self.default_ougai_items)
132
+ ZuoraConnect.logger.add(log_level, self.new_session_message)
137
133
  raise ZuoraConnect::Exceptions::HoldingPattern if holding_pattern && !self.mark_for_refresh
138
134
  self.refresh(session: session)
139
135
 
140
136
  elsif session["#{self.id}::task_data"].blank?
141
137
  self.new_session_message = "REFRESHING - Task Data Blank"
142
- ZuoraConnect.logger.debug(self.new_session_message, self.default_ougai_items)
138
+ ZuoraConnect.logger.add(log_level, self.new_session_message)
143
139
  raise ZuoraConnect::Exceptions::HoldingPattern if holding_pattern && !self.mark_for_refresh
144
140
  self.refresh(session: session)
145
141
 
146
142
  elsif session["#{self.id}::last_refresh"].blank?
147
143
  self.new_session_message = "REFRESHING - No Time on Cookie"
148
144
  recoverable_session = true
149
- ZuoraConnect.logger.debug(self.new_session_message, self.default_ougai_items)
145
+ ZuoraConnect.logger.add(log_level, self.new_session_message)
150
146
  raise ZuoraConnect::Exceptions::HoldingPattern if holding_pattern && !self.mark_for_refresh
151
147
  self.refresh(session: session)
152
148
 
@@ -154,7 +150,7 @@ module ZuoraConnect
154
150
  elsif (session["#{self.id}::last_refresh"].to_i < INSTANCE_REFRESH_WINDOW.ago.to_i) && self.mark_for_refresh
155
151
  self.new_session_message = "REFRESHING - Session Old by #{time_expire.abs} second"
156
152
  recoverable_session = true
157
- ZuoraConnect.logger.debug(self.new_session_message, self.default_ougai_items)
153
+ ZuoraConnect.logger.add(log_level, self.new_session_message)
158
154
  self.refresh(session: session)
159
155
 
160
156
  else
@@ -163,14 +159,14 @@ module ZuoraConnect
163
159
  else
164
160
  self.new_session_message = "REBUILDING - Expires in #{time_expire} seconds"
165
161
  end
166
- ZuoraConnect.logger.debug(self.new_session_message, self.default_ougai_items)
162
+ ZuoraConnect.logger.add(log_level, self.new_session_message)
167
163
  self.build_task(task_data: session["#{self.id}::task_data"], session: session)
168
164
  end
169
165
  end
170
166
  return self
171
167
  rescue ZuoraConnect::Exceptions::HoldingPattern => ex
172
168
  while self.marked_for_refresh?
173
- ZuoraConnect.logger.info("Holding - Expires in #{self.reset_mark_expires_at}. '#{self.new_session_message}'", self.default_ougai_items)
169
+ ZuoraConnect.logger.info("Holding - Expires in #{self.reset_mark_expires_at}. '#{self.new_session_message}'")
174
170
  sleep(HOLDING_PATTERN_SLEEP)
175
171
  end
176
172
  self.reload_attributes([:refresh_token, :oauth_expires_at, :access_token])
@@ -178,7 +174,7 @@ module ZuoraConnect
178
174
  retry
179
175
  rescue => ex
180
176
  if recoverable_session
181
- ZuoraConnect.logger.warn("REBUILDING - Using backup expired cache", self.default_ougai_items)
177
+ ZuoraConnect.logger.warn("REBUILDING - Using backup expired cache")
182
178
  self.build_task(task_data: session["#{self.id}::task_data"], session: session)
183
179
  return self
184
180
  else
@@ -200,10 +196,10 @@ module ZuoraConnect
200
196
  self.logitem(item: {tenant_ids: tenants, organization: organizations})
201
197
  params = {
202
198
  :name => self.task_data.dig('name'),
203
- :zuora_entity_ids => (self.task_data.dig(LOGIN_TENANT_DESTINATION,'entities') || []).map{|e| e['id']},
204
- :zuora_tenant_ids => self.task_data.fetch('tenant_ids', []).map(&:to_s),
199
+ :zuora_domain => self.target_login.client.rest_domain,
200
+ :zuora_entity_ids => self.task_data.dig(LOGIN_TENANT_DESTINATION,'entities').map{|e| e['id']},
201
+ :zuora_tenant_ids => self.task_data['tenant_ids'],
205
202
  }
206
- params.merge!({:zuora_domain => self.send(LOGIN_TENANT_DESTINATION).client.rest_domain })
207
203
  params = params.reject{|k,v| !self.attributes.keys.member?(k.to_s) || self[k] == v}
208
204
  self.update_columns(params) if params.present?
209
205
  end
@@ -211,12 +207,12 @@ module ZuoraConnect
211
207
  def refresh(session: {}, session_fallback: false)
212
208
  refresh_count ||= 0
213
209
  #Check how app was deployed
214
- if !self['zuora_logins'].present?
210
+ if !self.zuora_logins.present?
215
211
  start = Time.now
216
212
  response = HTTParty.get(ZuoraConnect.configuration.url + "/api/#{self.api_version}/tools/tasks/#{self.id}.json",:body => {:access_token => self.access_token})
217
213
  response_time = Time.now - start
218
214
 
219
- ZuoraConnect.logger.debug("REFRESH TASK - Connect Task Info Request Time #{response_time.round(2).to_s}", self.default_ougai_items)
215
+ ZuoraConnect.logger.debug("[#{self.id}] REFRESH TASK - Connect Task Info Request Time #{response_time.round(2).to_s}")
220
216
  if response.code == 200
221
217
  self.build_task(task_data: JSON.parse(response.body), session: session)
222
218
  self.last_refresh = Time.now.to_i
@@ -226,68 +222,35 @@ module ZuoraConnect
226
222
  raise ZuoraConnect::Exceptions::ConnectCommunicationError.new("Error Communicating with Connect", response.body, response.code)
227
223
  end
228
224
  else
229
- self.build_task(task_data: self.zuora_logins, session: session)
225
+ self.build_task(task_data: JSON.parse(self.zuora_logins), session: session)
230
226
  self.last_refresh = Time.now.to_i
231
227
  self.cache_app_instance
232
228
  self.reset_mark_for_refresh
233
229
  end
234
230
  rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
235
231
  if (refresh_count += 1) < 3
236
- sleep(30)
237
- ZuoraConnect.logger.info("REFRESH TASK - #{ex.class} Retrying(#{refresh_count})", self.default_ougai_items)
232
+ ZuoraConnect.logger.info("[#{self.id}] REFRESH TASK - #{ex.class} Retrying(#{refresh_count})")
238
233
  retry
239
234
  else
240
- ZuoraConnect.logger.fatal("REFRESH TASK - #{ex.class} Failed #{refresh_count}x", self.default_ougai_items)
235
+ ZuoraConnect.logger.fatal("[#{self.id}] REFRESH TASK - #{ex.class} Failed #{refresh_count}x")
241
236
  raise
242
237
  end
243
238
  rescue ZuoraConnect::Exceptions::ConnectCommunicationError => ex
244
239
  if (refresh_count += 1) < 3
245
240
  if ex.code == 401
246
- ZuoraConnect.logger.info("REFRESH TASK - Failed #{ex.code} - Retrying(#{refresh_count})", self.default_ougai_items)
241
+ ZuoraConnect.logger.info("[#{self.id}] REFRESH TASK - Failed #{ex.code} - Retrying(#{refresh_count})")
247
242
  self.refresh_oauth
248
243
  else
249
- ZuoraConnect.logger.warn("REFRESH TASK - Failed #{ex.code} - Retrying(#{refresh_count})", self.default_ougai_items)
244
+ ZuoraConnect.logger.warn("[#{self.id}] REFRESH TASK - Failed #{ex.code} - Retrying(#{refresh_count})")
250
245
  end
251
246
  retry
252
247
  else
253
- ZuoraConnect.logger.fatal("REFRESH TASK - Failed #{ex.code} - #{refresh_count}x", self.default_ougai_items)
248
+ ZuoraConnect.logger.fatal("[#{self.id}] REFRESH TASK - Failed #{ex.code} - #{refresh_count}x")
254
249
  raise
255
250
  end
256
251
  end
257
252
 
258
- #### START KMS ENCRYPTION Methods ####
259
- def zuora_logins=(val)
260
- write_attribute(:zuora_logins, kms_encrypt(val.to_json))
261
- end
262
-
263
- def zuora_logins
264
- return JSON.parse(kms_decrypt(super))
265
- end
266
-
267
- def kms_decrypt(value)
268
- kms_client = Aws::KMS::Client.new({region: Rails.application.secrets.aws['AWS_REGION'], credentials: self.aws_auth_client}.delete_if { |k, v| v.blank? })
269
- resp = kms_client.decrypt({ciphertext_blob: [value].pack("H*") })
270
- return resp.plaintext
271
- end
272
-
273
- def kms_encrypt(value)
274
- kms_client = Aws::KMS::Client.new({region: Rails.application.secrets.aws['AWS_REGION'], credentials: self.aws_auth_client}.delete_if {|k,v| v.blank? })
275
- kms_key = ENV['AWS_KMS_ARN'] || Rails.application.secrets.aws['AWS_KMS_ARN']
276
-
277
- resp = kms_client.encrypt({key_id: kms_key, plaintext: value})
278
- return resp.ciphertext_blob.unpack('H*').first
279
- end
280
-
281
- def aws_auth_client
282
- if Rails.env.to_s == 'development'
283
- return Aws::Credentials.new(Rails.application.secrets.aws['AWS_ACCESS_KEY_ID'], Rails.application.secrets.aws['AWS_SECRET_ACCESS_KEY'])
284
- else
285
- return nil
286
- end
287
- end
288
- #### END KMS ENCRYPTION Methods ####
289
-
290
- #### START Metrics Methods ####
253
+ #### START Metrics Mathods ####
291
254
  def logitem(item: {}, reset: false)
292
255
  self.logitems = {} if self.logitems.class != Hash
293
256
  if item.class == Hash
@@ -371,9 +334,9 @@ module ZuoraConnect
371
334
  end
372
335
  return @data
373
336
  end
374
- #### END Task Methods ####
337
+ #### END Task Mathods ####
375
338
 
376
- #### START Task Methods ####
339
+ #### START Task Mathods ####
377
340
  def build_task(task_data: {}, session: {})
378
341
  session = {} if session.blank?
379
342
  self.task_data = task_data
@@ -482,13 +445,13 @@ module ZuoraConnect
482
445
  raise
483
446
  end
484
447
  end
485
- #### END Task Methods ####
448
+ #### END Task Mathods ####
486
449
 
487
- #### START Connect OAUTH Methods ####
450
+ #### START Connect OAUTH methods ####
488
451
  def check_oauth_state(method)
489
452
  #Refresh token if already expired
490
453
  if self.oauth_expired?
491
- ZuoraConnect.logger.debug("Before '#{method}' method, Oauth expired", self.default_ougai_items)
454
+ ZuoraConnect.logger.debug("[#{self.id}] Before '#{method}' method, Oauth expired")
492
455
  self.refresh_oauth
493
456
  end
494
457
  end
@@ -507,7 +470,7 @@ module ZuoraConnect
507
470
  }
508
471
  response = HTTParty.post("#{ZuoraConnect.configuration.url}/oauth/token",:body => params)
509
472
  response_time = Time.now - start
510
- ZuoraConnect.logger.debug("REFRESH OAUTH - In #{response_time.round(2).to_s}", self.default_ougai_items)
473
+ ZuoraConnect.logger.debug("[#{self.id}] REFRESH OAUTH - In #{response_time.round(2).to_s}")
511
474
 
512
475
  if response.code == 200
513
476
  response_body = JSON.parse(response.body)
@@ -521,10 +484,10 @@ module ZuoraConnect
521
484
  end
522
485
  rescue *(ZuoraAPI::Login::CONNECTION_EXCEPTIONS).concat(ZuoraAPI::Login::CONNECTION_READ_EXCEPTIONS) => ex
523
486
  if (refresh_oauth_count += 1) < 3
524
- ZuoraConnect.logger.info("REFRESH OAUTH - #{ex.class} Retrying(#{refresh_oauth_count})", self.default_ougai_items)
487
+ ZuoraConnect.logger.info("[#{self.id}] REFRESH OAUTH - #{ex.class} Retrying(#{refresh_oauth_count})")
525
488
  retry
526
489
  else
527
- ZuoraConnect.logger.fatal("REFRESH OAUTH - #{ex.class} Failed #{refresh_oauth_count}x", self.default_ougai_items)
490
+ ZuoraConnect.logger.fatal("[#{self.id}] REFRESH OAUTH - #{ex.class} Failed #{refresh_oauth_count}x")
528
491
  raise
529
492
  end
530
493
  rescue ZuoraConnect::Exceptions::ConnectCommunicationError => ex
@@ -535,14 +498,14 @@ module ZuoraConnect
535
498
  return if !self.oauth_expired?
536
499
 
537
500
  if (refresh_oauth_count += 1) < 3
538
- ZuoraConnect.logger.info("REFRESH OAUTH - Failed #{ex.code} - Retrying(#{refresh_oauth_count})", self.default_ougai_items)
501
+ ZuoraConnect.logger.info("[#{self.id}] REFRESH OAUTH - Failed #{ex.code} - Retrying(#{refresh_oauth_count})")
539
502
  retry
540
503
  else
541
- ZuoraConnect.logger.fatal("REFRESH OAUTH - Failed #{ex.code} - #{refresh_oauth_count}x", self.default_ougai_items)
504
+ ZuoraConnect.logger.fatal("[#{self.id}] REFRESH OAUTH - Failed #{ex.code} - #{refresh_oauth_count}x")
542
505
  raise
543
506
  end
544
507
  end
545
- #### END Connect OAUTH Methods ####
508
+ #### END Connect OAUTH methods ####
546
509
 
547
510
  #### START AppInstance Temporary Persistance Methods ####
548
511
  def marked_for_refresh?
@@ -588,10 +551,10 @@ module ZuoraConnect
588
551
  end
589
552
  end
590
553
  if cached_instance.blank?
591
- ZuoraConnect.logger.debug("Cached AppInstance Missing", self.default_ougai_items)
554
+ ZuoraConnect.logger.debug("[#{self.id}] Cached AppInstance Missing")
592
555
  return session
593
556
  else
594
- ZuoraConnect.logger.debug("Cached AppInstance Found", self.default_ougai_items)
557
+ ZuoraConnect.logger.debug("[#{self.id}] Cached AppInstance Found")
595
558
  return decrypt_data(data: cached_instance, rescue_return: session).merge(session)
596
559
  end
597
560
  else
@@ -603,7 +566,7 @@ module ZuoraConnect
603
566
  if defined?(Redis.current)
604
567
  #Task data must be present and the last refresh cannot be old. We dont want to overwite new cache data with old
605
568
  if self.task_data.present? && (self.last_refresh.to_i > INSTANCE_REFRESH_WINDOW.ago.to_i)
606
- ZuoraConnect.logger.debug("Caching AppInstance", self.default_ougai_items)
569
+ ZuoraConnect.logger.debug("[#{self.id}] Caching AppInstance")
607
570
  Redis.current.setex("AppInstance:#{self.id}", INSTANCE_REDIS_CACHE_PERIOD.to_i, self.encrypt_data(data: self.save_data))
608
571
  end
609
572
  end
@@ -664,7 +627,7 @@ module ZuoraConnect
664
627
  begin
665
628
  return JSON.parse(encryptor.decrypt_and_verify(CGI::unescape(data)))
666
629
  rescue ActiveSupport::MessageVerifier::InvalidSignature => ex
667
- ZuoraConnect.logger.error("Error Decrypting", self.default_ougai_items) if log_fatal
630
+ ZuoraConnect.logger.add(Logger::ERROR, "Error Decrypting for #{self.id}") if log_fatal
668
631
  return rescue_return
669
632
  rescue JSON::ParserError => ex
670
633
  return encryptor.decrypt_and_verify(CGI::unescape(data))
@@ -1033,7 +996,9 @@ module ZuoraConnect
1033
996
 
1034
997
  def method_missing(method_sym, *arguments, &block)
1035
998
  if method_sym.to_s.include?("login")
1036
- ZuoraConnect.logger.fatal("Method Missing #{method_sym}. Instance Data: #{self.task_data} Instance Logins: #{self.logins}", self.default_ougai_items)
999
+ ZuoraConnect.logger.fatal("Method Missing #{method_sym}")
1000
+ ZuoraConnect.logger.fatal("Instance Data: #{self.task_data}")
1001
+ ZuoraConnect.logger.fatal("Instance Logins: #{self.logins}")
1037
1002
  end
1038
1003
  super
1039
1004
  end
@@ -1,7 +1,6 @@
1
1
  module ZuoraConnect
2
2
  class ZuoraUser < ActiveRecord::Base
3
3
  self.table_name = "zuora_users"
4
- attr_accessor :session
5
4
 
6
5
  end
7
6
  end
@@ -0,0 +1,65 @@
1
+ <html><head>
2
+ <title>We're sorry, but something went wrong</title>
3
+ <meta name="viewport" content="width=device-width,initial-scale=1">
4
+ <style>
5
+ body {
6
+ background-color: #EFEFEF;
7
+ color: #2E2F30;
8
+ text-align: center;
9
+ font-family: arial, sans-serif;
10
+ margin: 0;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 95%;
15
+ max-width: 33em;
16
+ margin: 4em auto 0;
17
+ }
18
+
19
+ div.dialog > div {
20
+ border: 1px solid #CCC;
21
+ border-right-color: #999;
22
+ border-left-color: #999;
23
+ border-bottom-color: #BBB;
24
+ border-top: #B00100 solid 4px;
25
+ border-top-left-radius: 9px;
26
+ border-top-right-radius: 9px;
27
+ background-color: white;
28
+ padding: 7px 12% 0;
29
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
30
+ }
31
+
32
+ h1 {
33
+ font-size: 100%;
34
+ color: #730E15;
35
+ line-height: 1.5em;
36
+ }
37
+
38
+ div.dialog > p {
39
+ margin: 0 0 1em;
40
+ padding: 1em;
41
+ background-color: #F7F7F7;
42
+ border: 1px solid #CCC;
43
+ border-right-color: #999;
44
+ border-left-color: #999;
45
+ border-bottom-color: #999;
46
+ border-bottom-left-radius: 4px;
47
+ border-bottom-right-radius: 4px;
48
+ border-top-color: #DADADA;
49
+ color: #666;
50
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
51
+ }
52
+ </style>
53
+ </head>
54
+
55
+ <body>
56
+ <!-- This file lives in public/500.html -->
57
+ <div class="dialog">
58
+ <div>
59
+ <h1>We're sorry, but this request could not be verified.</h1>
60
+ </div>
61
+ <p>Please try relaunching this application at connect.zuora.com</p>
62
+ </div>
63
+
64
+
65
+ </body></html>
@@ -0,0 +1,81 @@
1
+ <html><head>
2
+ <title>We're sorry, but something went wrong</title>
3
+ <meta name="viewport" content="width=device-width,initial-scale=1">
4
+ <style>
5
+ body {
6
+ background-color: #EFEFEF;
7
+ color: #2E2F30;
8
+ text-align: center;
9
+ font-family: arial, sans-serif;
10
+ margin: 0;
11
+ }
12
+
13
+ div.dialog {
14
+ width: 95%;
15
+ max-width: 33em;
16
+ margin: 4em auto 0;
17
+ }
18
+
19
+ div.dialog > div {
20
+ border: 1px solid #CCC;
21
+ border-right-color: #999;
22
+ border-left-color: #999;
23
+ border-bottom-color: #BBB;
24
+ border-top: #B00100 solid 4px;
25
+ border-top-left-radius: 9px;
26
+ border-top-right-radius: 9px;
27
+ background-color: white;
28
+ padding: 7px 12% 0;
29
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
30
+ }
31
+
32
+ h1 {
33
+ font-size: 100%;
34
+ color: #730E15;
35
+ line-height: 1.5em;
36
+ }
37
+
38
+ div.dialog > p {
39
+ margin: 0 0 1em;
40
+ padding: 1em;
41
+ background-color: #F7F7F7;
42
+ border: 1px solid #CCC;
43
+ border-right-color: #999;
44
+ border-left-color: #999;
45
+ border-bottom-color: #999;
46
+ border-bottom-left-radius: 4px;
47
+ border-bottom-right-radius: 4px;
48
+ border-top-color: #DADADA;
49
+ color: #666;
50
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
51
+ }
52
+ div#main{
53
+ background: white;
54
+ }
55
+ </style>
56
+ </head>
57
+
58
+ <body >
59
+ <div style='background: white;'>
60
+ <!-- This file lives in public/500.html -->
61
+ <% if defined?(exception) %>
62
+ <div class="dialog" style='max-width: 74em;'>
63
+ <div>
64
+ <h1><%= exception.class %> - '<%= exception.message %>'</h1>
65
+ </div>
66
+ <p style='text-align: left;'>
67
+ <% exception.backtrace.each do |line| %>
68
+ <%= line %><br>
69
+ <% end %>
70
+ </p>
71
+ </div>
72
+ <% else %>
73
+ <div class="dialog">
74
+ <div>
75
+ <h1>The launch url was invalid.</h1>
76
+ </div>
77
+ <p>Please try relaunching this application</p>
78
+ </div>
79
+ <% end %>
80
+ </div>
81
+ </body></html>