maestrano-connector-rails 2.2.0 → 2.2.1
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/.rubocop_todo.yml +76 -16
- data/app/models/maestrano/connector/rails/concerns/organization.rb +1 -1
- data/app/models/maestrano/connector/rails/services/data_consolidator.rb +2 -2
- data/lib/generators/connector/install_generator.rb +3 -1
- data/lib/maestrano/connector/rails/version.rb +1 -1
- data/maestrano-connector-rails.gemspec +2 -2
- metadata +9 -9
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f491d86e8ed4f633f60495e2ef8e6ee1ace82e33
|
|
4
|
+
data.tar.gz: e03029e37868143e5ab4fd702d186634c19124fb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 39326123a05567be519a51ed368a99c4f68c31b8a335d66292237cbccc18962a5bdd5c8d3c0db6fa6977cb8f7abe838e985e8ce5ecb64aa63aacd5b5c8d4f8bf
|
|
7
|
+
data.tar.gz: 62bd51a19f67246467d223080f40f016a46f43e14c3db8036b630ef4ad2ca69dece8238ba260fd0f604d99ce7b3b5aa3b3ef89205165521fc9da891d004d4048
|
data/.rubocop_todo.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# This configuration was generated by
|
|
2
2
|
# `rubocop --auto-gen-config`
|
|
3
|
-
# on
|
|
3
|
+
# on 2018-01-12 09:49:01 +1100 using RuboCop version 0.52.1.
|
|
4
4
|
# The point is for the user to remove these configuration records
|
|
5
5
|
# one by one as the offenses are removed from the code base.
|
|
6
6
|
# Note that changes in the inspected code, or installation of new
|
|
@@ -12,7 +12,12 @@ Lint/AssignmentInCondition:
|
|
|
12
12
|
Exclude:
|
|
13
13
|
- 'app/jobs/maestrano/connector/rails/push_to_connec_job.rb'
|
|
14
14
|
|
|
15
|
-
# Offense count:
|
|
15
|
+
# Offense count: 1
|
|
16
|
+
Lint/UriEscapeUnescape:
|
|
17
|
+
Exclude:
|
|
18
|
+
- 'app/models/maestrano/connector/rails/concerns/organization.rb'
|
|
19
|
+
|
|
20
|
+
# Offense count: 29
|
|
16
21
|
Metrics/AbcSize:
|
|
17
22
|
Max: 69
|
|
18
23
|
|
|
@@ -39,6 +44,17 @@ Metrics/ParameterLists:
|
|
|
39
44
|
Metrics/PerceivedComplexity:
|
|
40
45
|
Max: 15
|
|
41
46
|
|
|
47
|
+
# Offense count: 2
|
|
48
|
+
# Configuration parameters: NamePrefix, NamePrefixBlacklist, NameWhitelist, MethodDefinitionMacros.
|
|
49
|
+
# NamePrefix: is_, has_, have_
|
|
50
|
+
# NamePrefixBlacklist: is_, has_, have_
|
|
51
|
+
# NameWhitelist: is_a?
|
|
52
|
+
# MethodDefinitionMacros: define_method, define_singleton_method
|
|
53
|
+
Naming/PredicateName:
|
|
54
|
+
Exclude:
|
|
55
|
+
- 'spec/**/*'
|
|
56
|
+
- 'app/helpers/maestrano/connector/rails/session_helper.rb'
|
|
57
|
+
|
|
42
58
|
# Offense count: 2
|
|
43
59
|
# Cop supports --auto-correct.
|
|
44
60
|
# Configuration parameters: EnabledForFlattenWithoutParams.
|
|
@@ -46,6 +62,13 @@ Performance/FlatMap:
|
|
|
46
62
|
Exclude:
|
|
47
63
|
- 'app/models/maestrano/connector/rails/concerns/complex_entity.rb'
|
|
48
64
|
|
|
65
|
+
# Offense count: 2
|
|
66
|
+
# Cop supports --auto-correct.
|
|
67
|
+
# Configuration parameters: AutoCorrect.
|
|
68
|
+
Performance/HashEachMethods:
|
|
69
|
+
Exclude:
|
|
70
|
+
- 'app/resources/maestrano/api/base_resource.rb'
|
|
71
|
+
|
|
49
72
|
# Offense count: 1
|
|
50
73
|
# Cop supports --auto-correct.
|
|
51
74
|
# Configuration parameters: Whitelist.
|
|
@@ -54,8 +77,29 @@ Rails/DynamicFindBy:
|
|
|
54
77
|
Exclude:
|
|
55
78
|
- 'app/controllers/maestrano/api/api_controller.rb'
|
|
56
79
|
|
|
80
|
+
# Offense count: 2
|
|
81
|
+
# Configuration parameters: Include.
|
|
82
|
+
# Include: app/models/**/*.rb
|
|
83
|
+
Rails/HasManyOrHasOneDependent:
|
|
84
|
+
Exclude:
|
|
85
|
+
- 'app/models/maestrano/connector/rails/concerns/organization.rb'
|
|
86
|
+
- 'app/models/maestrano/connector/rails/concerns/user.rb'
|
|
87
|
+
|
|
88
|
+
# Offense count: 1
|
|
89
|
+
# Configuration parameters: Include.
|
|
90
|
+
# Include: app/models/**/*.rb
|
|
91
|
+
Rails/InverseOf:
|
|
92
|
+
Exclude:
|
|
93
|
+
- 'app/models/maestrano/connector/rails/concerns/user.rb'
|
|
94
|
+
|
|
95
|
+
# Offense count: 1
|
|
96
|
+
# Cop supports --auto-correct.
|
|
97
|
+
Rails/Presence:
|
|
98
|
+
Exclude:
|
|
99
|
+
- 'app/models/maestrano/connector/rails/concerns/organization.rb'
|
|
100
|
+
|
|
57
101
|
# Offense count: 6
|
|
58
|
-
# Configuration parameters: EnforcedStyle
|
|
102
|
+
# Configuration parameters: EnforcedStyle.
|
|
59
103
|
# SupportedStyles: strict, flexible
|
|
60
104
|
Rails/TimeZone:
|
|
61
105
|
Exclude:
|
|
@@ -63,7 +107,7 @@ Rails/TimeZone:
|
|
|
63
107
|
|
|
64
108
|
# Offense count: 1
|
|
65
109
|
# Cop supports --auto-correct.
|
|
66
|
-
# Configuration parameters: EnforcedStyle,
|
|
110
|
+
# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods.
|
|
67
111
|
# SupportedStyles: line_count_based, semantic, braces_for_chaining
|
|
68
112
|
# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
|
|
69
113
|
# FunctionalMethods: let, let!, subject, watch
|
|
@@ -89,27 +133,43 @@ Style/DoubleNegation:
|
|
|
89
133
|
Exclude:
|
|
90
134
|
- 'app/controllers/maestrano/auth/saml_controller.rb'
|
|
91
135
|
|
|
92
|
-
# Offense count:
|
|
136
|
+
# Offense count: 64
|
|
93
137
|
# Cop supports --auto-correct.
|
|
94
|
-
# Configuration parameters: EnforcedStyle
|
|
95
|
-
# SupportedStyles: when_needed, always
|
|
138
|
+
# Configuration parameters: EnforcedStyle.
|
|
139
|
+
# SupportedStyles: when_needed, always, never
|
|
96
140
|
Style/FrozenStringLiteralComment:
|
|
97
141
|
Enabled: false
|
|
98
142
|
|
|
99
|
-
# Offense count:
|
|
100
|
-
#
|
|
101
|
-
|
|
102
|
-
# NamePrefixBlacklist: is_, has_, have_
|
|
103
|
-
# NameWhitelist: is_a?
|
|
104
|
-
Style/PredicateName:
|
|
143
|
+
# Offense count: 1
|
|
144
|
+
# Cop supports --auto-correct.
|
|
145
|
+
Style/IfUnlessModifier:
|
|
105
146
|
Exclude:
|
|
106
|
-
- '
|
|
107
|
-
- 'app/helpers/maestrano/connector/rails/session_helper.rb'
|
|
147
|
+
- 'app/models/maestrano/connector/rails/concerns/entity.rb'
|
|
108
148
|
|
|
109
149
|
# Offense count: 1
|
|
110
150
|
# Cop supports --auto-correct.
|
|
111
|
-
# Configuration parameters: EnforcedStyle,
|
|
151
|
+
# Configuration parameters: EnforcedStyle, AllowInnerSlashes.
|
|
112
152
|
# SupportedStyles: slashes, percent_r, mixed
|
|
113
153
|
Style/RegexpLiteral:
|
|
114
154
|
Exclude:
|
|
115
155
|
- 'app/models/maestrano/connector/rails/concerns/entity.rb'
|
|
156
|
+
|
|
157
|
+
# Offense count: 8
|
|
158
|
+
# Cop supports --auto-correct.
|
|
159
|
+
# Configuration parameters: EnforcedStyle.
|
|
160
|
+
# SupportedStyles: implicit, explicit
|
|
161
|
+
Style/RescueStandardError:
|
|
162
|
+
Exclude:
|
|
163
|
+
- 'app/controllers/maestrano/connec_controller.rb'
|
|
164
|
+
- 'app/jobs/maestrano/connector/rails/concerns/synchronization_job.rb'
|
|
165
|
+
- 'app/models/maestrano/connector/rails/concerns/connec_helper.rb'
|
|
166
|
+
- 'app/models/maestrano/connector/rails/concerns/entity.rb'
|
|
167
|
+
- 'app/models/maestrano/connector/rails/concerns/organization.rb'
|
|
168
|
+
- 'app/resources/maestrano/api/base_resource.rb'
|
|
169
|
+
|
|
170
|
+
# Offense count: 2
|
|
171
|
+
# Cop supports --auto-correct.
|
|
172
|
+
# Configuration parameters: ConvertCodeThatCanStartToReturnNil.
|
|
173
|
+
Style/SafeNavigation:
|
|
174
|
+
Exclude:
|
|
175
|
+
- 'app/models/maestrano/connector/rails/concerns/entity.rb'
|
|
@@ -153,7 +153,7 @@ module Maestrano::Connector::Rails::Concerns::Organization
|
|
|
153
153
|
|
|
154
154
|
def set_instance_metadata
|
|
155
155
|
auth = {username: Maestrano[tenant].param('api.id'), password: Maestrano[tenant].param('api.key')}
|
|
156
|
-
res = HTTParty.get("#{Maestrano[tenant].param('api.host')}/api/v1/account/groups/#{uid}", basic_auth: auth)
|
|
156
|
+
res = HTTParty.get(URI.encode("#{Maestrano[tenant].param('api.host')}/api/v1/account/groups/#{uid}"), basic_auth: auth)
|
|
157
157
|
response = JSON.parse(res.body)
|
|
158
158
|
self.push_disabled = response.dig('data', 'metadata', 'push_disabled')
|
|
159
159
|
self.pull_disabled = response.dig('data', 'metadata', 'pull_disabled')
|
|
@@ -116,7 +116,7 @@ module Maestrano::Connector::Rails::Services
|
|
|
116
116
|
entity = if @is_a_subentity
|
|
117
117
|
@current_entity.map_to(connec_entity_name, external_entity, idmap)
|
|
118
118
|
else
|
|
119
|
-
@current_entity.map_to_connec(external_entity, idmap.last_push_to_connec.nil?)
|
|
119
|
+
@current_entity.map_to_connec(external_entity, (idmap.last_push_to_connec.nil? && idmap.connec_id.nil?))
|
|
120
120
|
end
|
|
121
121
|
{entity: entity, idmap: idmap}
|
|
122
122
|
end
|
|
@@ -125,7 +125,7 @@ module Maestrano::Connector::Rails::Services
|
|
|
125
125
|
entity = if @is_a_subentity
|
|
126
126
|
@current_entity.map_to(external_entity_name, connec_entity, idmap)
|
|
127
127
|
else
|
|
128
|
-
@current_entity.map_to_external(connec_entity.merge(idmap: idmap), idmap.last_push_to_external.nil?)
|
|
128
|
+
@current_entity.map_to_external(connec_entity.merge(idmap: idmap), (idmap.last_push_to_external.nil? && idmap.external_id.nil?))
|
|
129
129
|
end
|
|
130
130
|
{entity: entity, idmap: idmap, id_refs_only_connec_entity: id_refs_only_connec_entity}
|
|
131
131
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'fileutils'
|
|
2
|
+
|
|
1
3
|
module Connector
|
|
2
4
|
class InstallGenerator < ::Rails::Generators::Base
|
|
3
5
|
source_root File.expand_path('../templates', __FILE__)
|
|
@@ -54,7 +56,7 @@ module Connector
|
|
|
54
56
|
|
|
55
57
|
copy_file 'layouts.haml', 'app/views/layouts/application.html.haml'
|
|
56
58
|
|
|
57
|
-
mkdir_p 'app/controllers/maestrano/api'
|
|
59
|
+
FileUtils.mkdir_p 'app/controllers/maestrano/api'
|
|
58
60
|
copy_file 'account_controller.rb', 'app/controllers/maestrano/api/account_controller.rb'
|
|
59
61
|
end
|
|
60
62
|
|
|
@@ -48,9 +48,9 @@ Gem::Specification.new do |s|
|
|
|
48
48
|
s.add_development_dependency('github_changelog_generator')
|
|
49
49
|
s.add_development_dependency('rdoc')
|
|
50
50
|
s.add_development_dependency('rspec-rails')
|
|
51
|
-
s.add_development_dependency('rubocop', '~> 0.
|
|
51
|
+
s.add_development_dependency('rubocop', '~> 0.52')
|
|
52
52
|
s.add_development_dependency('shoulda')
|
|
53
|
-
s.add_development_dependency('shoulda-matchers')
|
|
53
|
+
s.add_development_dependency('shoulda-matchers', '~> 3.1')
|
|
54
54
|
s.add_development_dependency('simplecov', '>= 0')
|
|
55
55
|
s.add_development_dependency('timecop')
|
|
56
56
|
s.add_development_dependency('webmock')
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: maestrano-connector-rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Maestrano
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2018-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rails
|
|
@@ -338,14 +338,14 @@ dependencies:
|
|
|
338
338
|
requirements:
|
|
339
339
|
- - "~>"
|
|
340
340
|
- !ruby/object:Gem::Version
|
|
341
|
-
version: 0.
|
|
341
|
+
version: '0.52'
|
|
342
342
|
type: :development
|
|
343
343
|
prerelease: false
|
|
344
344
|
version_requirements: !ruby/object:Gem::Requirement
|
|
345
345
|
requirements:
|
|
346
346
|
- - "~>"
|
|
347
347
|
- !ruby/object:Gem::Version
|
|
348
|
-
version: 0.
|
|
348
|
+
version: '0.52'
|
|
349
349
|
- !ruby/object:Gem::Dependency
|
|
350
350
|
name: shoulda
|
|
351
351
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -364,16 +364,16 @@ dependencies:
|
|
|
364
364
|
name: shoulda-matchers
|
|
365
365
|
requirement: !ruby/object:Gem::Requirement
|
|
366
366
|
requirements:
|
|
367
|
-
- - "
|
|
367
|
+
- - "~>"
|
|
368
368
|
- !ruby/object:Gem::Version
|
|
369
|
-
version: '
|
|
369
|
+
version: '3.1'
|
|
370
370
|
type: :development
|
|
371
371
|
prerelease: false
|
|
372
372
|
version_requirements: !ruby/object:Gem::Requirement
|
|
373
373
|
requirements:
|
|
374
|
-
- - "
|
|
374
|
+
- - "~>"
|
|
375
375
|
- !ruby/object:Gem::Version
|
|
376
|
-
version: '
|
|
376
|
+
version: '3.1'
|
|
377
377
|
- !ruby/object:Gem::Dependency
|
|
378
378
|
name: simplecov
|
|
379
379
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -575,7 +575,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
575
575
|
version: '0'
|
|
576
576
|
requirements: []
|
|
577
577
|
rubyforge_project:
|
|
578
|
-
rubygems_version: 2.
|
|
578
|
+
rubygems_version: 2.5.1
|
|
579
579
|
signing_key:
|
|
580
580
|
specification_version: 4
|
|
581
581
|
summary: Rails framework to build connector with Maestrano
|