zuora_connect 1.3.2 → 1.3.3
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/models/zuora_connect/app_instance_base.rb +10 -11
- data/config/initializers/apartment.rb +1 -1
- data/db/migrate/{20100718151733_create_connect_app_instances.rb → 20160718151733_create_connect_app_instances.rb} +0 -0
- data/db/migrate/{20101024162319_add_tokens_to_app_instance.rb → 20161024162319_add_tokens_to_app_instance.rb} +0 -0
- data/db/migrate/{20101024220705_add_token_to_app_instance.rb → 20161024220705_add_token_to_app_instance.rb} +0 -0
- data/db/migrate/{20110131211919_add_sessions_table.rb → 20170131211919_add_sessions_table.rb} +0 -0
- data/db/migrate/{20110411200303_add_expiration_to_app_instance.rb → 20170411200303_add_expiration_to_app_instance.rb} +0 -0
- data/db/migrate/{20110413191512_add_new_api_token.rb → 20170413191512_add_new_api_token.rb} +0 -0
- data/lib/zuora_connect/controllers/helpers.rb +13 -10
- data/lib/zuora_connect/version.rb +1 -1
- metadata +9 -65
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be69eb7cb40f40b7b394b3ebd60758eec3ed55c8
|
4
|
+
data.tar.gz: c1713b5e4f7b6f28f5a8db0cfe9e3d206782790a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c0f3b856c22f385f212a7e2e402945fc2ed83b018e2236f0f8d66897ef55563f27324e8a3fcd06a55e0d0f8523be9232b71f9bab55003f898c245e08ce644bd
|
7
|
+
data.tar.gz: 0663805cede5a63f7c445c24d5b1f3a665c40edc844c56939b95bb1a8d8988348ed93b47cfd8eba49b4006bfc61192deda55b60af832e4e29d1ae670e437a9fd
|
@@ -7,6 +7,13 @@ module ZuoraConnect
|
|
7
7
|
def init
|
8
8
|
@options = Hash.new
|
9
9
|
@logins = Hash.new
|
10
|
+
if ZuoraConnect.configuration.use_s3
|
11
|
+
if ZuoraConnect.configuration.mode == "Development"
|
12
|
+
@s3_client = Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region,access_key_id: ZuoraConnect.configuration.dev_mode_access_key_id,secret_access_key: ZuoraConnect.configuration.dev_mode_secret_access_key)
|
13
|
+
else
|
14
|
+
@s3_client = Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region)
|
15
|
+
end
|
16
|
+
end
|
10
17
|
@valid = false
|
11
18
|
self.attr_builder("timezone", ZuoraConnect.configuration.default_time_zone)
|
12
19
|
self.attr_builder("locale", ZuoraConnect.configuration.default_locale)
|
@@ -138,21 +145,13 @@ module ZuoraConnect
|
|
138
145
|
|
139
146
|
def upload_to_s3(local_file,s3_path = nil)
|
140
147
|
s3_path = local_file.split("/").last if s3_path.nil?
|
141
|
-
obj =
|
148
|
+
obj = @s3_client.bucket(ZuoraConnect.configuration.s3_bucket_name).object("#{ZuoraConnect.configuration.s3_folder_name}/#{self.id.to_s}/#{s3_path}}")
|
142
149
|
obj.upload_file(local_file)
|
143
150
|
end
|
144
151
|
|
145
152
|
def get_s3_file_url(key)
|
146
|
-
signer = Aws::S3::Presigner.new(client:
|
147
|
-
url = signer.presigned_url(:get_object, bucket: ZuoraConnect.configuration.s3_bucket_name, key: "#{ZuoraConnect.configuration.s3_folder_name}/#{
|
148
|
-
end
|
149
|
-
|
150
|
-
def s3_client
|
151
|
-
if ZuoraConnect.configuration.mode == "Development"
|
152
|
-
@s3_client ||= Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region,access_key_id: ZuoraConnect.configuration.dev_mode_access_key_id,secret_access_key: ZuoraConnect.configuration.dev_mode_secret_access_key)
|
153
|
-
else
|
154
|
-
@s3_client ||= Aws::S3::Resource.new(region: ZuoraConnect.configuration.aws_region)
|
155
|
-
end
|
153
|
+
signer = Aws::S3::Presigner.new(client: @s3_client)
|
154
|
+
url = signer.presigned_url(:get_object, bucket: ZuoraConnect.configuration.s3_bucket_name, key: "#{ZuoraConnect.configuration.s3_folder_name}/#{key}")
|
156
155
|
end
|
157
156
|
|
158
157
|
def self.decrypt_response(resp)
|
@@ -68,7 +68,7 @@ Apartment.configure do |config|
|
|
68
68
|
# e.g when using a PostgreSQL extension like hstore.
|
69
69
|
# Any schemas added here will be available along with your selected Tenant.
|
70
70
|
#
|
71
|
-
config.persistent_schemas = %w{
|
71
|
+
# config.persistent_schemas = %w{ hstore }
|
72
72
|
|
73
73
|
# <== PostgreSQL only options
|
74
74
|
#
|
File without changes
|
File without changes
|
File without changes
|
data/db/migrate/{20110131211919_add_sessions_table.rb → 20170131211919_add_sessions_table.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
@@ -4,7 +4,7 @@ module ZuoraConnect
|
|
4
4
|
module Helpers
|
5
5
|
extend ActiveSupport::Concern
|
6
6
|
|
7
|
-
def instance_data_lookup(
|
7
|
+
def instance_data_lookup(appinstance = nil)
|
8
8
|
return session.blank? ? {} : session
|
9
9
|
end
|
10
10
|
|
@@ -34,7 +34,7 @@ module ZuoraConnect
|
|
34
34
|
else
|
35
35
|
setup_instance_via_dev_mode
|
36
36
|
end
|
37
|
-
@appinstance.new_session(:session =>instance_data_lookup(@appinstance
|
37
|
+
@appinstance.new_session(:session =>instance_data_lookup(@appinstance))
|
38
38
|
I18n.locale = session["#{@appinstance.id}::user::locale"] ? session["#{@appinstance.id}::user::locale"] : @appinstance.locale
|
39
39
|
Time.zone = session["#{@appinstance.id}::user::timezone"] ? session["#{@appinstance.id}::user::timezone"] : @appinstance.timezone
|
40
40
|
Rails.logger.debug("[#{@appinstance.blank? ? "N/A" : @appinstance.id}] Authenticate App Request Completed In - #{(Time.now - start_time).round(2)}s")
|
@@ -112,14 +112,17 @@ module ZuoraConnect
|
|
112
112
|
session["#{@appinstance.id}::admin"] = ZuoraConnect.configuration.dev_mode_admin
|
113
113
|
end
|
114
114
|
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
115
|
+
end
|
116
|
+
|
117
|
+
private
|
118
|
+
|
119
|
+
def check_instance
|
120
|
+
if !@appinstance.blank?
|
121
|
+
@appinstance.new_session(:session => instance_data_lookup(@appinstance))
|
122
|
+
Thread.current[:appinstance] = @appinstance
|
123
|
+
return @appinstance.valid
|
124
|
+
else
|
125
|
+
render text: "Access Denied", status: :unauthorized
|
123
126
|
end
|
124
127
|
end
|
125
128
|
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: 1.3.
|
4
|
+
version: 1.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Connect Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord-session_store
|
@@ -87,69 +87,13 @@ dependencies:
|
|
87
87
|
- - "~>"
|
88
88
|
- !ruby/object:Gem::Version
|
89
89
|
version: '3.0'
|
90
|
-
type: :
|
90
|
+
type: :runtime
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - "~>"
|
95
95
|
- !ruby/object:Gem::Version
|
96
96
|
version: '3.0'
|
97
|
-
- !ruby/object:Gem::Dependency
|
98
|
-
name: rspec-rails
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: rspec-expectations
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
114
|
-
requirements:
|
115
|
-
- - ">="
|
116
|
-
- !ruby/object:Gem::Version
|
117
|
-
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
|
-
requirements:
|
122
|
-
- - ">="
|
123
|
-
- !ruby/object:Gem::Version
|
124
|
-
version: '0'
|
125
|
-
- !ruby/object:Gem::Dependency
|
126
|
-
name: factory_girl
|
127
|
-
requirement: !ruby/object:Gem::Requirement
|
128
|
-
requirements:
|
129
|
-
- - ">="
|
130
|
-
- !ruby/object:Gem::Version
|
131
|
-
version: '0'
|
132
|
-
type: :development
|
133
|
-
prerelease: false
|
134
|
-
version_requirements: !ruby/object:Gem::Requirement
|
135
|
-
requirements:
|
136
|
-
- - ">="
|
137
|
-
- !ruby/object:Gem::Version
|
138
|
-
version: '0'
|
139
|
-
- !ruby/object:Gem::Dependency
|
140
|
-
name: pg
|
141
|
-
requirement: !ruby/object:Gem::Requirement
|
142
|
-
requirements:
|
143
|
-
- - ">="
|
144
|
-
- !ruby/object:Gem::Version
|
145
|
-
version: '0'
|
146
|
-
type: :development
|
147
|
-
prerelease: false
|
148
|
-
version_requirements: !ruby/object:Gem::Requirement
|
149
|
-
requirements:
|
150
|
-
- - ">="
|
151
|
-
- !ruby/object:Gem::Version
|
152
|
-
version: '0'
|
153
97
|
- !ruby/object:Gem::Dependency
|
154
98
|
name: aws-sdk-rails
|
155
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -211,12 +155,12 @@ files:
|
|
211
155
|
- app/views/zuora_connect/static/session_error.html.erb
|
212
156
|
- config/initializers/apartment.rb
|
213
157
|
- config/routes.rb
|
214
|
-
- db/migrate/
|
215
|
-
- db/migrate/
|
216
|
-
- db/migrate/
|
217
|
-
- db/migrate/
|
218
|
-
- db/migrate/
|
219
|
-
- db/migrate/
|
158
|
+
- db/migrate/20160718151733_create_connect_app_instances.rb
|
159
|
+
- db/migrate/20161024162319_add_tokens_to_app_instance.rb
|
160
|
+
- db/migrate/20161024220705_add_token_to_app_instance.rb
|
161
|
+
- db/migrate/20170131211919_add_sessions_table.rb
|
162
|
+
- db/migrate/20170411200303_add_expiration_to_app_instance.rb
|
163
|
+
- db/migrate/20170413191512_add_new_api_token.rb
|
220
164
|
- lib/tasks/zuora_connect_tasks.rake
|
221
165
|
- lib/zuora_connect.rb
|
222
166
|
- lib/zuora_connect/configuration.rb
|