marty 1.0.27 → 1.0.28
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/components/marty/api_config_view.rb +72 -0
- data/app/components/marty/api_log_view.rb +73 -0
- data/app/components/marty/main_auth_app.rb +35 -3
- data/app/controllers/marty/rpc_controller.rb +84 -35
- data/app/models/marty/api_auth.rb +2 -1
- data/app/models/marty/api_config.rb +16 -0
- data/app/models/marty/api_log.rb +5 -0
- data/app/models/marty/data_grid.rb +1 -1
- data/db/migrate/300_create_marty_api_configs.rb +13 -0
- data/db/migrate/301_create_marty_api_log.rb +16 -0
- data/lib/marty.rb +1 -0
- data/lib/marty/json_schema.rb +52 -0
- data/lib/marty/monkey.rb +15 -0
- data/lib/marty/version.rb +1 -1
- data/marty.gemspec +1 -0
- data/spec/controllers/rpc_controller_spec.rb +342 -1
- data/spec/lib/json_schema_spec.rb +619 -0
- data/spec/models/api_auth_spec.rb +14 -14
- metadata +24 -2
@@ -19,9 +19,9 @@ module Marty
|
|
19
19
|
it "should require app name, api key and script name" do
|
20
20
|
api = ApiAuth.new
|
21
21
|
expect(api).to_not be_valid
|
22
|
-
expect(api.errors[:app_name].any?).to
|
22
|
+
expect(api.errors[:app_name].any?).to be_truthy
|
23
23
|
expect(api.errors[:api_key].any?).to be false # auto-set if nil
|
24
|
-
expect(api.errors[:script_name].any?).to
|
24
|
+
expect(api.errors[:script_name].any?).to be_truthy
|
25
25
|
end
|
26
26
|
|
27
27
|
it "should require unique app name/script name" do
|
@@ -126,12 +126,12 @@ module Marty
|
|
126
126
|
describe "authorization" do
|
127
127
|
it "should pass when script is not secured" do
|
128
128
|
# Script is not secured by any entries
|
129
|
-
expect(ApiAuth.authorized?('SomeScript','SomeKey')).to
|
129
|
+
expect(ApiAuth.authorized?('SomeScript','SomeKey')).to be_truthy
|
130
130
|
end
|
131
131
|
|
132
132
|
it "should pass when script is secured and key is valid" do
|
133
133
|
expect(@api.script_name).to include('Script1')
|
134
|
-
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to
|
134
|
+
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to be_truthy
|
135
135
|
end
|
136
136
|
|
137
137
|
it "should pass when script is secured and key is valid 2" do
|
@@ -139,7 +139,7 @@ module Marty
|
|
139
139
|
a.app_name = @api.app_name + 'x'
|
140
140
|
a.script_name = 'NewScript1'
|
141
141
|
a.save!
|
142
|
-
expect(ApiAuth.authorized?('NewScript1',a.api_key)).to
|
142
|
+
expect(ApiAuth.authorized?('NewScript1',a.api_key)).to be_truthy
|
143
143
|
end
|
144
144
|
|
145
145
|
it "should match on exact script name" do
|
@@ -147,11 +147,11 @@ module Marty
|
|
147
147
|
a.app_name = @api.app_name + 'x'
|
148
148
|
a.script_name = 'NewScript1'
|
149
149
|
a.save!
|
150
|
-
expect(ApiAuth.authorized?('Script1',a.api_key)).to
|
150
|
+
expect(ApiAuth.authorized?('Script1',a.api_key)).to be_falsey
|
151
151
|
end
|
152
152
|
|
153
153
|
it "should fail when script is secured and key is invalid" do
|
154
|
-
expect(ApiAuth.authorized?('Script1','SomeKey')).to
|
154
|
+
expect(ApiAuth.authorized?('Script1','SomeKey')).to be_falsey
|
155
155
|
end
|
156
156
|
|
157
157
|
it "should fail when script is secured and key is invalid (2)" do
|
@@ -159,18 +159,18 @@ module Marty
|
|
159
159
|
a.app_name = @api.app_name + 'x'
|
160
160
|
a.script_name = 'NewScript1'
|
161
161
|
a.save!
|
162
|
-
expect(ApiAuth.authorized?('NewScript1',@api.api_key)).to
|
162
|
+
expect(ApiAuth.authorized?('NewScript1',@api.api_key)).to be_falsey
|
163
163
|
end
|
164
164
|
|
165
165
|
it "should fail when script is secured and key is not specified" do
|
166
|
-
expect(ApiAuth.authorized?('Script1',nil)).to
|
167
|
-
expect(ApiAuth.authorized?('Script1','')).to
|
166
|
+
expect(ApiAuth.authorized?('Script1',nil)).to be_falsey
|
167
|
+
expect(ApiAuth.authorized?('Script1','')).to be_falsey
|
168
168
|
end
|
169
169
|
|
170
170
|
it "should pass when api_auth is deleted and no other auths exist" do
|
171
|
-
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to
|
171
|
+
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to be_truthy
|
172
172
|
@api.delete
|
173
|
-
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to
|
173
|
+
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to be_truthy
|
174
174
|
end
|
175
175
|
|
176
176
|
it "should fail when api_auth is deleted and another auth exists" do
|
@@ -178,9 +178,9 @@ module Marty
|
|
178
178
|
api.app_name += 'x'
|
179
179
|
api.api_key = nil
|
180
180
|
api.save!
|
181
|
-
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to
|
181
|
+
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to be_truthy
|
182
182
|
@api.delete
|
183
|
-
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to
|
183
|
+
expect(ApiAuth.authorized?(@api.script_name,@api.api_key)).to be_falsey
|
184
184
|
end
|
185
185
|
end
|
186
186
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: marty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.28
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arman Bostani
|
@@ -14,7 +14,7 @@ authors:
|
|
14
14
|
autorequire:
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
|
-
date: 2017-05
|
17
|
+
date: 2017-06-05 00:00:00.000000000 Z
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: pg
|
@@ -170,6 +170,20 @@ dependencies:
|
|
170
170
|
- - ">="
|
171
171
|
- !ruby/object:Gem::Version
|
172
172
|
version: '0'
|
173
|
+
- !ruby/object:Gem::Dependency
|
174
|
+
name: json-schema
|
175
|
+
requirement: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
type: :runtime
|
181
|
+
prerelease: false
|
182
|
+
version_requirements: !ruby/object:Gem::Requirement
|
183
|
+
requirements:
|
184
|
+
- - ">="
|
185
|
+
- !ruby/object:Gem::Version
|
186
|
+
version: '0'
|
173
187
|
description: Marty is a framework for viewing and reporting on versioned data.
|
174
188
|
email:
|
175
189
|
- arman.bostani@pnmac.com
|
@@ -189,6 +203,8 @@ files:
|
|
189
203
|
- app/assets/stylesheets/marty/application.css
|
190
204
|
- app/assets/stylesheets/marty/diagnostic.css
|
191
205
|
- app/components/marty/api_auth_view.rb
|
206
|
+
- app/components/marty/api_config_view.rb
|
207
|
+
- app/components/marty/api_log_view.rb
|
192
208
|
- app/components/marty/auth_app.rb
|
193
209
|
- app/components/marty/auth_app/client/auth_app.js
|
194
210
|
- app/components/marty/config_view.rb
|
@@ -395,6 +411,8 @@ files:
|
|
395
411
|
- app/helpers/marty/application_helper.rb
|
396
412
|
- app/helpers/marty/script_set.rb
|
397
413
|
- app/models/marty/api_auth.rb
|
414
|
+
- app/models/marty/api_config.rb
|
415
|
+
- app/models/marty/api_log.rb
|
398
416
|
- app/models/marty/base.rb
|
399
417
|
- app/models/marty/config.rb
|
400
418
|
- app/models/marty/data_grid.rb
|
@@ -455,6 +473,8 @@ files:
|
|
455
473
|
- db/migrate/200_create_marty_event_operation_enum.rb
|
456
474
|
- db/migrate/201_create_marty_events.rb
|
457
475
|
- db/migrate/202_add_completion_status_to_event.rb
|
476
|
+
- db/migrate/300_create_marty_api_configs.rb
|
477
|
+
- db/migrate/301_create_marty_api_log.rb
|
458
478
|
- db/seeds.rb
|
459
479
|
- delorean/script_report.dl
|
460
480
|
- gemini_deprecations.md
|
@@ -465,6 +485,7 @@ files:
|
|
465
485
|
- lib/marty/data_exporter.rb
|
466
486
|
- lib/marty/data_importer.rb
|
467
487
|
- lib/marty/engine.rb
|
488
|
+
- lib/marty/json_schema.rb
|
468
489
|
- lib/marty/lazy_column_loader.rb
|
469
490
|
- lib/marty/logger.rb
|
470
491
|
- lib/marty/mcfly_query.rb
|
@@ -1583,6 +1604,7 @@ files:
|
|
1583
1604
|
- spec/job_helper.rb
|
1584
1605
|
- spec/lib/data_exporter_spec.rb
|
1585
1606
|
- spec/lib/data_importer_spec.rb
|
1607
|
+
- spec/lib/json_schema_spec.rb
|
1586
1608
|
- spec/lib/logger_spec.rb
|
1587
1609
|
- spec/lib/migrations/vw_marty_postings.sql.expected
|
1588
1610
|
- spec/lib/migrations_spec.rb
|