zuora_connect 3.1.3 → 3.1.5.pre.b
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: 299831b3de0ae8c2e95bd85ff682bb0f3cbd52e764b7b00befc0f67bcddf6235
|
4
|
+
data.tar.gz: 6bdb7c237e270176cfe457fcab0f0ce717a92444afd846d1aeb699fdf7369b35
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 35c5b8515a84e82f797d67eebd74a0964980a044b11692b9055dde639661268d85a6bd20ba1600ad257e1b7fd43c4730bd1cd836334f8b8da51049a5afb60a22
|
7
|
+
data.tar.gz: 33ec657b9790811636763d6706dc41fc8fc29fac14d47c623eff14f7db9438b162533fc3cfcca21154bb2b4c88b79a9541f7d0cb170876572d03220c89291fcc
|
@@ -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 until 2022-08-17' }, 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'
|
@@ -18,10 +18,29 @@ class Redis
|
|
18
18
|
def self.current=(redis)
|
19
19
|
@current = redis
|
20
20
|
end
|
21
|
+
|
22
|
+
def self.subscriber
|
23
|
+
@subscriber ||= Redis.new
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.subscriber=(redis)
|
27
|
+
@subscriber = redis
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.publisher
|
31
|
+
@publisher ||= Redis.new
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.publisher=(redis)
|
35
|
+
@publisher = redis
|
36
|
+
end
|
21
37
|
end
|
22
38
|
|
23
39
|
if defined?(Redis.current)
|
24
40
|
Redis.current = Redis.new(:id => "#{ZuoraObservability::Env.full_process_name(process_name: 'Redis')}", :url => redis_url, :timeout => 6, :reconnect_attempts => 2)
|
41
|
+
Redis.subscriber = Redis.new(:id => "#{ZuoraObservability::Env.full_process_name(process_name: 'RedisSubscriber')}", :url => redis_url, :timeout => 6, :reconnect_attempts => 2)
|
42
|
+
Redis.publisher = Redis.new(:id => "#{ZuoraObservability::Env.full_process_name(process_name: 'RedisPublisher')}", :url => redis_url, :timeout => 6, :reconnect_attempts => 2)
|
43
|
+
|
25
44
|
browser_urls['Redis'] = { "url" => redis_url }
|
26
45
|
if defined?(Resque.redis)
|
27
46
|
if resque_url != redis_url
|
@@ -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.b
|
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-08-
|
11
|
+
date: 2022-08-15 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:
|