zuora_connect 3.1.4 → 3.1.5.pre.c
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 46d27ab8e67bb535b556c6691e8f3e699bede791df15ef15a1017b89044db1f1
|
4
|
+
data.tar.gz: 5bed177dd9a2974e416b344c70060b22239554c60d0ed078907c0069b6eec230
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 72bba22075d8d4990c36206db79ae31683759efa35af50b5338df0b9d93d751e35dbb465a2a399ea512e4b0f9b8fb5e7e5872e2a5f1f2d327b8f7cb427e34f93
|
7
|
+
data.tar.gz: 53233188e104192526968fc1973f065172e82a6cd637e5d5b9bdf3d4102c7dae2cffd150780c71349803872db9b4e46fc3a547c48c3350b0ac7f6dee31c874e3
|
@@ -4,10 +4,9 @@ module ZuoraConnect
|
|
4
4
|
before_action :clear_connect_app_session, :only => [:health, :initialize_app, :provision, :instance_user, :instance_drop]
|
5
5
|
after_action :persist_connect_app_session, :except => [:health, :initialize_app, :provision, :instance_user, :instance_drop]
|
6
6
|
|
7
|
-
skip_before_action :verify_authenticity_token, :only => [:initialize_app, :provision]
|
7
|
+
skip_before_action :verify_authenticity_token, :only => [:initialize_app, :provision, :instance_drop]
|
8
8
|
http_basic_authenticate_with name: ENV['PROVISION_USER'], password: ENV['PROVISION_SECRET'], :only => [:provision, :instance_user, :instance_drop]
|
9
9
|
|
10
|
-
|
11
10
|
def health
|
12
11
|
if params[:error].present?
|
13
12
|
begin
|
@@ -52,6 +51,10 @@ module ZuoraConnect
|
|
52
51
|
end
|
53
52
|
|
54
53
|
def provision
|
54
|
+
if ZuoraConnect.configuration.disable_provisioning
|
55
|
+
render(json: { status: 403, message: 'Provisioning is suspended' }, status: 403) && return
|
56
|
+
end
|
57
|
+
|
55
58
|
create_new_instance
|
56
59
|
unless performed?
|
57
60
|
render json: {
|
@@ -120,25 +123,30 @@ module ZuoraConnect
|
|
120
123
|
end
|
121
124
|
|
122
125
|
def instance_drop
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
ZuoraConnect::AppInstance.
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
126
|
+
host = request.headers.fetch("HOST", nil)
|
127
|
+
if host.present? && ZuoraConnect::AppInstance::INTERNAL_HOSTS.include?(host)
|
128
|
+
ZuoraConnect::AppInstance.read_master_db do
|
129
|
+
instance_id = params[:id]
|
130
|
+
@appinstance = ZuoraConnect::AppInstance.find(instance_id)
|
131
|
+
if @appinstance.drop_instance
|
132
|
+
ZuoraConnect::AppInstance.destroy(instance_id)
|
133
|
+
msg = Apartment::Tenant.drop(instance_id)
|
134
|
+
|
135
|
+
if msg.error_message.present?
|
136
|
+
render json: { "message" => msg.error_message }, status: :bad_request
|
137
|
+
else
|
138
|
+
render json: {
|
139
|
+
status: 200,
|
140
|
+
message: 'Success',
|
141
|
+
app_instance_id: instance_id
|
142
|
+
}, status: 200
|
143
|
+
end
|
132
144
|
else
|
133
|
-
render json: {
|
134
|
-
status: 200,
|
135
|
-
message: 'Success',
|
136
|
-
app_instance_id: instance_id
|
137
|
-
}, status: 200
|
145
|
+
render json: { "message" => @appinstance.drop_message }, status: :bad_request
|
138
146
|
end
|
139
|
-
else
|
140
|
-
render json: { "message" => @appinstance.drop_message }, status: :bad_request
|
141
147
|
end
|
148
|
+
else
|
149
|
+
render json: { "message" => "Host #{host} is not internal" }, status: :bad_request
|
142
150
|
end
|
143
151
|
rescue StandardError => e
|
144
152
|
message = 'Failed to drop instance'
|
@@ -516,8 +516,11 @@ module ZuoraConnect
|
|
516
516
|
else
|
517
517
|
ZuoraConnect::Exceptions::Error.new("Invalid encryption method '#{encryption_type}'.")
|
518
518
|
end
|
519
|
-
rescue ArgumentError => ex
|
520
|
-
if
|
519
|
+
rescue ArgumentError, OpenSSL::Cipher::CipherError => ex
|
520
|
+
if (
|
521
|
+
ex.is_a?(ArgumentError) && ['invalid base64'].include?(ex.message) ||
|
522
|
+
ex.is_a?(OpenSSL::Cipher::CipherError) && ['wrong final block length', 'bad decrypt'].include?(ex.message)
|
523
|
+
) && encryption_type == :envelope && (kms_tries += 1) < 3
|
521
524
|
ZuoraConnect.logger.warn("Fallback to encryption 'direct', from '#{encryption_type}'", ex, self.default_ougai_items)
|
522
525
|
encryption_type = :direct
|
523
526
|
retry
|
@@ -7,7 +7,7 @@ module ZuoraConnect
|
|
7
7
|
|
8
8
|
attr_accessor :oauth_client_id, :oauth_client_secret, :oauth_client_redirect_uri
|
9
9
|
|
10
|
-
attr_accessor :dev_mode_logins, :dev_mode_options, :dev_mode_mode, :dev_mode_appinstance, :dev_mode_user, :dev_mode_pass, :dev_mode_admin, :dev_mode_secret_access_key,:dev_mode_access_key_id,:aws_region, :s3_bucket_name, :s3_folder_name, :insert_migrations, :skip_connect, :encryption_type, :local_task_data
|
10
|
+
attr_accessor :dev_mode_logins, :dev_mode_options, :dev_mode_mode, :dev_mode_appinstance, :dev_mode_user, :dev_mode_pass, :dev_mode_admin, :dev_mode_secret_access_key,:dev_mode_access_key_id,:aws_region, :s3_bucket_name, :s3_folder_name, :insert_migrations, :skip_connect, :encryption_type, :local_task_data, :disable_provisioning
|
11
11
|
|
12
12
|
def initialize
|
13
13
|
@default_locale = :en
|
@@ -23,6 +23,7 @@ module ZuoraConnect
|
|
23
23
|
@skip_connect = false
|
24
24
|
@encryption_type = :direct
|
25
25
|
@local_task_data = false
|
26
|
+
@disable_provisioning = false
|
26
27
|
|
27
28
|
# Setting the app name for telegraf write
|
28
29
|
@enable_metrics = false
|
@@ -446,6 +446,10 @@ module ZuoraConnect
|
|
446
446
|
|
447
447
|
#We have no deployed instance for this tenant
|
448
448
|
else
|
449
|
+
if ZuoraConnect.configuration.disable_provisioning
|
450
|
+
raise ZuoraConnect::Exceptions::AccessDenied.new("Provisioning is suspended")
|
451
|
+
end
|
452
|
+
|
449
453
|
#Ensure user can access oauth creation API
|
450
454
|
if !session["ZuoraCurrentUserInfo"]['permissions'].include?("permission.userManagement")
|
451
455
|
Thread.current[:appinstance] = nil
|
@@ -579,7 +583,15 @@ module ZuoraConnect
|
|
579
583
|
zuora_details.merge!({:error => ex.response.body})
|
580
584
|
end
|
581
585
|
ZuoraConnect.logger.error("UI Authorization Error", ex, zuora: zuora_details)
|
582
|
-
|
586
|
+
|
587
|
+
respond_to do |format|
|
588
|
+
format.html {
|
589
|
+
render "zuora_connect/static/error_unhandled", locals: {exception: ex, skip_exception: true}, layout: false, status: 500
|
590
|
+
}
|
591
|
+
format.js {
|
592
|
+
render "zuora_connect/static/error_unhandled", locals: {exception: ex, skip_exception: true}, layout: false, status: 500
|
593
|
+
}
|
594
|
+
end
|
583
595
|
end
|
584
596
|
return
|
585
597
|
end
|
@@ -601,6 +613,10 @@ module ZuoraConnect
|
|
601
613
|
@appinstance = ZuoraConnect::AppInstance.find_by(:id => values["appInstance"].to_i)
|
602
614
|
|
603
615
|
if @appinstance.blank?
|
616
|
+
if ZuoraConnect.configuration.disable_provisioning
|
617
|
+
raise ZuoraConnect::Exceptions::AccessDenied.new("Provisioning is suspended")
|
618
|
+
end
|
619
|
+
|
604
620
|
Apartment::Tenant.switch!("public")
|
605
621
|
begin
|
606
622
|
Apartment::Tenant.create(values["appInstance"].to_s)
|
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.1.
|
4
|
+
version: 3.1.5.pre.c
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Connect Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apartment
|
@@ -452,9 +452,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
452
452
|
version: '0'
|
453
453
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
454
454
|
requirements:
|
455
|
-
- - "
|
455
|
+
- - ">"
|
456
456
|
- !ruby/object:Gem::Version
|
457
|
-
version:
|
457
|
+
version: 1.3.1
|
458
458
|
requirements: []
|
459
459
|
rubygems_version: 3.3.7
|
460
460
|
signing_key:
|