zuora_connect 2.0.5zj → 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 +4 -4
- data/app/controllers/zuora_connect/static_controller.rb +17 -4
- data/app/helpers/zuora_connect/application_helper.rb +0 -10
- data/app/models/zuora_connect/app_instance_base.rb +66 -109
- data/app/models/zuora_connect/telegraf.rb +2 -2
- data/app/models/zuora_connect/zuora_user.rb +0 -1
- data/app/views/zuora_connect/static/invalid_app_instance_error.html.erb +65 -0
- data/app/views/zuora_connect/static/invalid_launch_request.html.erb +81 -0
- data/app/views/zuora_connect/static/launch.html.erb +75 -74
- data/app/views/zuora_connect/static/permission_error.html.erb +80 -0
- data/app/views/zuora_connect/static/session_error.html.erb +63 -0
- data/config/routes.rb +2 -0
- data/lib/middleware/request_id_middleware.rb +1 -1
- data/lib/resque/plugins/custom_logger.rb +1 -1
- data/lib/zuora_connect.rb +42 -59
- data/lib/zuora_connect/configuration.rb +3 -3
- data/lib/zuora_connect/controllers/helpers.rb +183 -253
- data/lib/zuora_connect/engine.rb +1 -2
- data/lib/zuora_connect/railtie.rb +6 -10
- data/lib/zuora_connect/version.rb +1 -1
- data/lib/zuora_connect/views/helpers.rb +9 -0
- metadata +54 -54
- data/app/views/zuora_connect/static/error_handled.html.erb +0 -77
- data/app/views/zuora_connect/static/error_unhandled.erb +0 -82
- data/config/initializers/patches.rb +0 -9
- data/db/migrate/20190520232222_add_unique_index.rb +0 -6
- data/lib/middleware/json_parse_errors.rb +0 -22
@@ -1,9 +0,0 @@
|
|
1
|
-
#Used to ensure encode of UploadedFile for lograge does not dump entire file.
|
2
|
-
class ActionDispatch::Http::UploadedFile
|
3
|
-
def as_json(options = nil)
|
4
|
-
%w(headers).inject({}) do |hash, attr|
|
5
|
-
hash[attr] = send(attr).force_encoding('utf-8')
|
6
|
-
hash
|
7
|
-
end
|
8
|
-
end
|
9
|
-
end
|
@@ -1,6 +0,0 @@
|
|
1
|
-
class AddUniqueIndex < ActiveRecord::Migration[5.0]
|
2
|
-
def change
|
3
|
-
add_index :zuora_connect_app_instances, :api_token, unique: true unless ActiveRecord::Base.connection.index_exists?(:zuora_connect_app_instances, :api_token, unique: true)
|
4
|
-
add_index :zuora_connect_app_instances, :token, unique: true unless ActiveRecord::Base.connection.index_exists?(:zuora_connect_app_instances, :token, unique: true)
|
5
|
-
end
|
6
|
-
end
|
@@ -1,22 +0,0 @@
|
|
1
|
-
module ZuoraConnect
|
2
|
-
class JsonParseErrors
|
3
|
-
def initialize(app)
|
4
|
-
@app = app
|
5
|
-
end
|
6
|
-
|
7
|
-
def call(env)
|
8
|
-
begin
|
9
|
-
@app.call(env)
|
10
|
-
rescue ActionDispatch::ParamsParser::ParseError => error
|
11
|
-
if env['HTTP_ACCEPT'] =~ /application\/json/ || env['CONTENT_TYPE'] =~ /application\/json/
|
12
|
-
return [
|
13
|
-
400, { "Content-Type" => "application/json" },
|
14
|
-
[{"success": false, "reasons": [{"code": 50000090, "message": "Malformed json was submitted." }]}.to_json ]
|
15
|
-
]
|
16
|
-
else
|
17
|
-
raise error
|
18
|
-
end
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|