cocoapods-whitelist 0.5.4 → 0.6.0
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/.circleci/config.yml +1 -1
- data/.pre-commit-config.yaml +1 -7
- data/.ruby-version +1 -1
- data/CHANGELOG.md +10 -2
- data/Gemfile +1 -1
- data/Gemfile.lock +63 -29
- data/README.md +8 -8
- data/cocoapods-whitelist.gemspec +4 -4
- data/lib/cocoapods-allowlist/client/allowlist_resolver.rb +84 -0
- data/lib/{cocoapods-whitelist/command/whitelist.rb → cocoapods-allowlist/command/allowlist.rb} +32 -19
- data/lib/cocoapods-allowlist/command.rb +1 -0
- data/lib/cocoapods-allowlist/gem_version.rb +3 -0
- data/lib/cocoapods-allowlist/helpers/config_url.rb +4 -0
- data/lib/cocoapods-allowlist/helpers/git.rb +16 -0
- data/lib/cocoapods-allowlist/hook.rb +1 -0
- data/lib/{cocoapods-whitelist → cocoapods-allowlist}/model/allowed_dependency.rb +11 -7
- data/lib/cocoapods-allowlist/model/sources.rb +3 -0
- data/lib/cocoapods-allowlist/utils/command.rb +10 -0
- data/lib/cocoapods-allowlist.rb +1 -0
- data/lib/cocoapods_plugin.rb +4 -4
- data/spec/allowlist_resolver_spec.rb +24 -0
- data/spec/{whitelist_spec.rb → allowlist_spec.rb} +59 -59
- data/spec/mocks/{whitelist.json → allowlist.json} +3 -3
- data/spec/mocks/{whitelist_with_expired_dependencies.json → allowlist_with_expired_dependencies.json} +4 -4
- data/spec/source_validator_spec.rb +6 -0
- metadata +37 -34
- data/lib/cocoapods-whitelist/client/whitelist_resolver.rb +0 -54
- data/lib/cocoapods-whitelist/command.rb +0 -1
- data/lib/cocoapods-whitelist/gem_version.rb +0 -3
- data/lib/cocoapods-whitelist/hook.rb +0 -1
- data/lib/cocoapods-whitelist/model/sources.rb +0 -3
- data/lib/cocoapods-whitelist.rb +0 -1
- data/spec/whitelist_resolver_spec.rb +0 -24
- /data/lib/{cocoapods-whitelist → cocoapods-allowlist}/exclude/excluded.json +0 -0
- /data/lib/{cocoapods-whitelist → cocoapods-allowlist}/helpers/source_helper.rb +0 -0
- /data/lib/{cocoapods-whitelist → cocoapods-allowlist}/hook/resolver.rb +0 -0
- /data/lib/{cocoapods-whitelist → cocoapods-allowlist}/model/validation_excluded.rb +0 -0
- /data/lib/{cocoapods-whitelist → cocoapods-allowlist}/validator/source_validator.rb +0 -0
- /data/spec/mocks/{whitelisted_podname.podspec → allowlisted_podname.podspec} +0 -0
- /data/spec/mocks/{with_whitelisted_dependency_fixed_versions_v1.podspec → with_allowlisted_dependency_fixed_versions_v1.podspec} +0 -0
- /data/spec/mocks/{with_whitelisted_dependency_fixed_versions_v2.podspec → with_allowlisted_dependency_fixed_versions_v2.podspec} +0 -0
- /data/spec/mocks/{with_whitelisted_dependency_fixed_versions_variable.podspec → with_allowlisted_dependency_fixed_versions_variable.podspec} +0 -0
@@ -1,209 +1,209 @@
|
|
1
1
|
require File.expand_path('../spec_helper', __FILE__)
|
2
2
|
|
3
|
-
|
3
|
+
ALLOWLIST_FILE = './spec/mocks/allowlist.json'
|
4
4
|
|
5
5
|
module Pod
|
6
|
-
describe Command::
|
6
|
+
describe Command::Allowlist do
|
7
7
|
describe 'general' do
|
8
8
|
it 'registers itself' do
|
9
|
-
Command.parse(%w{
|
9
|
+
Command.parse(%w{ allowlist }).should.be.instance_of Command::Allowlist
|
10
10
|
end
|
11
11
|
end
|
12
12
|
|
13
13
|
describe 'validations' do
|
14
14
|
it 'dependency without version should not be valid' do
|
15
|
-
#
|
16
|
-
command = Command.parse(['
|
15
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('MeliSDK')
|
16
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
17
17
|
specification = Pod::Specification.from_file('./spec/mocks/without_version.podspec')
|
18
18
|
command.expects(:get_podspec_specifications).returns([specification])
|
19
19
|
lambda { command.run }.should.raise Informative
|
20
20
|
end
|
21
21
|
|
22
22
|
it 'dependency with major version fixed should be valid' do
|
23
|
-
#
|
24
|
-
command = Command.parse(['
|
23
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('MeliSDK', '~>5.0')
|
24
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
25
25
|
specification = Pod::Specification.from_file('./spec/mocks/major_version_fixed.podspec')
|
26
26
|
command.expects(:get_podspec_specifications).returns([specification])
|
27
27
|
lambda { command.run }.should.not.raise
|
28
28
|
end
|
29
29
|
|
30
30
|
it 'dependency with incorrect name should not be valid' do
|
31
|
-
#
|
32
|
-
command = Command.parse(['
|
31
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('Meli', '~>5.0')
|
32
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
33
33
|
specification = Pod::Specification.from_file('./spec/mocks/bad_name.podspec')
|
34
34
|
command.expects(:get_podspec_specifications).returns([specification])
|
35
35
|
lambda { command.run }.should.raise Informative
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'not allowed dependency should not be valid' do
|
39
|
-
command = Command.parse(['
|
39
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
40
40
|
specification = Pod::Specification.from_file('./spec/mocks/not_allowed.podspec')
|
41
41
|
command.expects(:get_podspec_specifications).returns([specification])
|
42
42
|
lambda { command.run }.should.raise Informative
|
43
43
|
end
|
44
44
|
|
45
45
|
it 'not allowed similar dependency should not be valid' do
|
46
|
-
#
|
47
|
-
command = Command.parse(['
|
46
|
+
# Allowlist: ('MercadoPagoSDKV4', '~>5.*') | Podspec: ('MercadoPagoSDK')
|
47
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
48
48
|
specification = Pod::Specification.from_file('./spec/mocks/with_similar_name_not_allowed.podspec')
|
49
49
|
command.expects(:get_podspec_specifications).returns([specification])
|
50
50
|
lambda { command.run }.should.raise Informative
|
51
51
|
end
|
52
52
|
|
53
53
|
it 'dependency with not allowed version should be valid' do
|
54
|
-
command = Command.parse(['
|
54
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
55
55
|
specification = Pod::Specification.from_file('./spec/mocks/with_fixed_version.podspec')
|
56
56
|
command.expects(:get_podspec_specifications).returns([specification])
|
57
57
|
lambda { command.run }.should.raise Informative
|
58
58
|
end
|
59
59
|
|
60
60
|
it 'expired dependency should not be valid' do
|
61
|
-
#
|
62
|
-
command = Command.parse(['
|
61
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
|
62
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
63
63
|
specification = Pod::Specification.from_file('./spec/mocks/with_expired_dependencies.podspec')
|
64
64
|
command.expects(:get_podspec_specifications).returns([specification])
|
65
65
|
lambda { command.run }.should.raise Informative
|
66
66
|
end
|
67
67
|
|
68
68
|
it 'not yet expired dependency should be valid' do
|
69
|
-
#
|
70
|
-
command = Command.parse(['
|
69
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
|
70
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
71
71
|
specification = Pod::Specification.from_file('./spec/mocks/with_not_yet_expired_dependencies.podspec')
|
72
72
|
command.expects(:get_podspec_specifications).returns([specification])
|
73
73
|
lambda { command.run }.should.not.raise Informative
|
74
74
|
end
|
75
75
|
|
76
76
|
it 'dependency with two versions requierement should not be valid' do
|
77
|
-
#
|
78
|
-
command = Command.parse(['
|
77
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
|
78
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
79
79
|
specification = Pod::Specification.from_file('./spec/mocks/with_two_requirement.podspec')
|
80
80
|
command.expects(:get_podspec_specifications).returns([specification])
|
81
81
|
lambda { command.run }.should.raise Informative
|
82
82
|
end
|
83
83
|
|
84
84
|
it 'dependency with two versions requierement should not be valid' do
|
85
|
-
#
|
86
|
-
command = Command.parse(['
|
85
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
|
86
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
87
87
|
specification = Pod::Specification.from_file('./spec/mocks/with_more_than_one_version_in_subspec.podspec')
|
88
88
|
command.expects(:get_podspec_specifications).returns([specification])
|
89
89
|
lambda { command.run }.should.raise Informative
|
90
90
|
end
|
91
91
|
|
92
92
|
it 'dependency not allowed in subspec should not be valid' do
|
93
|
-
#
|
94
|
-
command = Command.parse(['
|
93
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
|
94
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
95
95
|
specification = Pod::Specification.from_file('./spec/mocks/with_not_allowed_in_subspec.podspec')
|
96
96
|
command.expects(:get_podspec_specifications).returns([specification])
|
97
97
|
lambda { command.run }.should.raise Informative
|
98
98
|
end
|
99
99
|
|
100
|
-
it 'subspec dependency allowed in the
|
101
|
-
#
|
102
|
-
command = Command.parse(['
|
100
|
+
it 'subspec dependency allowed in the allowlist should be valid' do
|
101
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('MeliSDK/Error')
|
102
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
103
103
|
specification = Pod::Specification.from_file('./spec/mocks/with_allowed_subspec_v1.podspec')
|
104
104
|
command.expects(:get_podspec_specifications).returns([specification])
|
105
105
|
lambda { command.run }.should.not.raise
|
106
106
|
end
|
107
107
|
|
108
|
-
it 'dependency not allowed in the
|
109
|
-
#
|
110
|
-
command = Command.parse(['
|
108
|
+
it 'dependency not allowed in the allowlist should not be valid' do
|
109
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('MyMeliSDK/Error')
|
110
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
111
111
|
specification = Pod::Specification.from_file('./spec/mocks/with_not_allowed_subspec_v1.podspec')
|
112
112
|
command.expects(:get_podspec_specifications).returns([specification])
|
113
113
|
lambda { command.run }.should.raise Informative
|
114
114
|
end
|
115
115
|
|
116
116
|
it 'podspec without dependencies should be valid' do
|
117
|
-
#
|
118
|
-
command = Command.parse(['
|
117
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
|
118
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
119
119
|
specification = Pod::Specification.from_file('./spec/mocks/without_dependencies.podspec')
|
120
120
|
command.expects(:get_podspec_specifications).returns([specification])
|
121
121
|
lambda { command.run }.should.not.raise
|
122
122
|
end
|
123
123
|
|
124
124
|
it 'podspec with allowed dependencies in subspec should be valid' do
|
125
|
-
#
|
126
|
-
command = Command.parse(['
|
125
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Subspec: ('MeliSDK')
|
126
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
127
127
|
specification = Pod::Specification.from_file('./spec/mocks/with_allowed_in_subspec.podspec')
|
128
128
|
command.expects(:get_podspec_specifications).returns([specification])
|
129
129
|
lambda { command.run }.should.not.raise
|
130
130
|
end
|
131
131
|
|
132
132
|
it 'podspec with dependency not restricted by version should be valid' do
|
133
|
-
#
|
134
|
-
command = Command.parse(['
|
133
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('MLRecommendations', '~>1.0.0')
|
134
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
135
135
|
specification = Pod::Specification.from_file('./spec/mocks/free_version.podspec')
|
136
136
|
command.expects(:get_podspec_specifications).returns([specification])
|
137
137
|
lambda { command.run }.should.not.raise
|
138
138
|
end
|
139
139
|
|
140
|
-
it 'fixed mayor dependency in
|
141
|
-
#
|
142
|
-
command = Command.parse(['
|
143
|
-
specification = Pod::Specification.from_file('./spec/mocks/
|
140
|
+
it 'fixed mayor dependency in allowlist and podspec should not fail on first option' do
|
141
|
+
# Allowlist: ('MLMyDependency', '1.0.0|2.0.0') | Podspec: ('MLMyDependency', '1.0.0')
|
142
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
143
|
+
specification = Pod::Specification.from_file('./spec/mocks/with_allowlisted_dependency_fixed_versions_v1.podspec')
|
144
144
|
command.expects(:get_podspec_specifications).returns([specification])
|
145
145
|
lambda { command.run }.should.not.raise
|
146
146
|
end
|
147
147
|
|
148
|
-
it 'fixed mayor dependency in
|
149
|
-
#
|
150
|
-
command = Command.parse(['
|
151
|
-
specification = Pod::Specification.from_file('./spec/mocks/
|
148
|
+
it 'fixed mayor dependency in allowlist and podspec should not fail on second option' do
|
149
|
+
# Allowlist: ('MLMyDependency', '1.0.0|2.0.0') | Podspec: ('MLMyDependency', '2.0.0')
|
150
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
151
|
+
specification = Pod::Specification.from_file('./spec/mocks/with_allowlisted_dependency_fixed_versions_v2.podspec')
|
152
152
|
command.expects(:get_podspec_specifications).returns([specification])
|
153
153
|
lambda { command.run }.should.not.raise
|
154
154
|
end
|
155
155
|
|
156
|
-
it 'fixed mayor dependency in
|
157
|
-
#
|
158
|
-
command = Command.parse(['
|
159
|
-
specification = Pod::Specification.from_file('./spec/mocks/
|
156
|
+
it 'fixed mayor dependency in allowlist but not in podspec should fail' do
|
157
|
+
# Allowlist: ('MLMyDependency', '1.0.0|2.0.0') | Podspec: ('MLMyDependency', '~> 1.0')
|
158
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
159
|
+
specification = Pod::Specification.from_file('./spec/mocks/with_allowlisted_dependency_fixed_versions_variable.podspec')
|
160
160
|
command.expects(:get_podspec_specifications).returns([specification])
|
161
161
|
lambda { command.run }.should.raise Informative
|
162
162
|
end
|
163
163
|
|
164
164
|
it 'not allowed dependency should not raise exception if --fail-on-error is not present' do
|
165
|
-
#
|
166
|
-
command = Command.parse(['
|
165
|
+
# Allowlist: ('MeliSDK', '~>5.*') | Podspec: ('AFNetworking')
|
166
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--podspec=./spec/mocks/not_allowed.podspec"])
|
167
167
|
lambda { command.run }.should.not.raise
|
168
168
|
end
|
169
169
|
|
170
170
|
it 'should not fail when no podspecs are found' do
|
171
|
-
command = Command.parse(['
|
171
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}"])
|
172
172
|
lambda { command.run }.should.not.raise
|
173
173
|
end
|
174
174
|
|
175
175
|
it 'allowed granular dependency should be valid' do
|
176
|
-
command = Command.parse(['
|
176
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
177
177
|
specification = Pod::Specification.from_file('./spec/mocks/allowed_with_granular.podspec')
|
178
178
|
command.expects(:get_podspec_specifications).returns([specification])
|
179
179
|
lambda { command.run }.should.not.raise Informative
|
180
180
|
end
|
181
181
|
|
182
182
|
it 'not allowed granular dependency should not be valid' do
|
183
|
-
command = Command.parse(['
|
183
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
184
184
|
specification = Pod::Specification.from_file('./spec/mocks/not_allowed_with_granular_v1.podspec')
|
185
185
|
command.expects(:get_podspec_specifications).returns([specification])
|
186
186
|
lambda { command.run }.should.raise Informative
|
187
187
|
end
|
188
188
|
|
189
189
|
it 'not allowed granular subspec dependency should not be valid' do
|
190
|
-
command = Command.parse(['
|
190
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
191
191
|
specification = Pod::Specification.from_file('./spec/mocks/not_allowed_with_granular_v2.podspec')
|
192
192
|
command.expects(:get_podspec_specifications).returns([specification])
|
193
193
|
lambda { command.run }.should.raise Informative
|
194
194
|
end
|
195
195
|
|
196
|
-
it 'subspec dependency allowed in the
|
197
|
-
#
|
198
|
-
command = Command.parse(['
|
196
|
+
it 'subspec dependency allowed in the allowlist should be valid' do
|
197
|
+
# Allowlist: ('AndesUI/Core') | Podspec: ('AndesUI/Core')
|
198
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
199
199
|
specification = Pod::Specification.from_file('./spec/mocks/with_allowed_subspec_v2.podspec')
|
200
200
|
command.expects(:get_podspec_specifications).returns([specification])
|
201
201
|
lambda { command.run }.should.not.raise
|
202
202
|
end
|
203
203
|
|
204
|
-
it 'subspec dependency not allowed in the
|
205
|
-
#
|
206
|
-
command = Command.parse(['
|
204
|
+
it 'subspec dependency not allowed in the allowlist should not be valid' do
|
205
|
+
# Allowlist: ('AndesUI/Core') | Podspec: ('AndesUI/Icons')
|
206
|
+
command = Command.parse(['allowlist', "--config=#{ALLOWLIST_FILE}", "--fail-on-error"])
|
207
207
|
specification = Pod::Specification.from_file('./spec/mocks/with_not_allowed_subspec_v2.podspec')
|
208
208
|
command.expects(:get_podspec_specifications).returns([specification])
|
209
209
|
lambda { command.run }.should.raise Informative
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"allowlist": [
|
3
3
|
{
|
4
4
|
"name": "MeliSDK",
|
5
5
|
"version": "^~>5.[0-9]+$",
|
@@ -11,13 +11,13 @@
|
|
11
11
|
"target": "production"
|
12
12
|
},
|
13
13
|
{
|
14
|
-
"
|
14
|
+
"expires": "2100-11-15",
|
15
15
|
"name": "MLBilling",
|
16
16
|
"version": null,
|
17
17
|
"target": "production"
|
18
18
|
},
|
19
19
|
{
|
20
|
-
"
|
20
|
+
"expires": "2016-11-15",
|
21
21
|
"name": "MLOnDemandResources",
|
22
22
|
"version": "^~>5.[0-9]+$",
|
23
23
|
"source": "public",
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"allowlist": [{
|
3
3
|
"name": "MeliSDK",
|
4
4
|
"version": "^~>5.[0-9]+$"
|
5
5
|
}, {
|
@@ -8,17 +8,17 @@
|
|
8
8
|
}, {
|
9
9
|
"name": "CHTCollectionViewWaterfallLayout2",
|
10
10
|
"version": "^~>\\s?0.[0-9]+$",
|
11
|
-
"
|
11
|
+
"expires": "2017-11-01"
|
12
12
|
},
|
13
13
|
{
|
14
14
|
"name": "CHTCollectionViewWaterfallLayout3",
|
15
15
|
"version": "^~>\\s?0.[0-9]+$",
|
16
|
-
"
|
16
|
+
"expires" : "2017-12-01"
|
17
17
|
},
|
18
18
|
{
|
19
19
|
"name": "CHTCollectionViewWaterfallLayout4",
|
20
20
|
"version": "^~>\\s?0.[0-9]+$",
|
21
|
-
"
|
21
|
+
"expires" : "2017-11-01"
|
22
22
|
}
|
23
23
|
]
|
24
24
|
}
|
@@ -68,5 +68,11 @@ describe SourceValidator do
|
|
68
68
|
|
69
69
|
filtered.size.should.equal 1
|
70
70
|
end
|
71
|
+
|
72
|
+
|
73
|
+
it 'private source repo should be valid' do
|
74
|
+
expected_sources = ["git@github.com:melisource/mobile-ios_specs.git"]
|
75
|
+
get_private_sources().should.equal expected_sources
|
76
|
+
end
|
71
77
|
end
|
72
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-whitelist
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mobile Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -38,7 +38,7 @@ dependencies:
|
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '12.0'
|
41
|
-
description: A short description of cocoapods-
|
41
|
+
description: A short description of cocoapods-allowlist.
|
42
42
|
email:
|
43
43
|
- mobile@mercadolibre.com
|
44
44
|
executables: []
|
@@ -56,33 +56,41 @@ files:
|
|
56
56
|
- README.md
|
57
57
|
- Rakefile
|
58
58
|
- cocoapods-whitelist.gemspec
|
59
|
-
- lib/cocoapods-
|
60
|
-
- lib/cocoapods-
|
61
|
-
- lib/cocoapods-
|
62
|
-
- lib/cocoapods-
|
63
|
-
- lib/cocoapods-
|
64
|
-
- lib/cocoapods-
|
65
|
-
- lib/cocoapods-
|
66
|
-
- lib/cocoapods-
|
67
|
-
- lib/cocoapods-
|
68
|
-
- lib/cocoapods-
|
69
|
-
- lib/cocoapods-
|
70
|
-
- lib/cocoapods-
|
71
|
-
- lib/cocoapods-
|
59
|
+
- lib/cocoapods-allowlist.rb
|
60
|
+
- lib/cocoapods-allowlist/client/allowlist_resolver.rb
|
61
|
+
- lib/cocoapods-allowlist/command.rb
|
62
|
+
- lib/cocoapods-allowlist/command/allowlist.rb
|
63
|
+
- lib/cocoapods-allowlist/exclude/excluded.json
|
64
|
+
- lib/cocoapods-allowlist/gem_version.rb
|
65
|
+
- lib/cocoapods-allowlist/helpers/config_url.rb
|
66
|
+
- lib/cocoapods-allowlist/helpers/git.rb
|
67
|
+
- lib/cocoapods-allowlist/helpers/source_helper.rb
|
68
|
+
- lib/cocoapods-allowlist/hook.rb
|
69
|
+
- lib/cocoapods-allowlist/hook/resolver.rb
|
70
|
+
- lib/cocoapods-allowlist/model/allowed_dependency.rb
|
71
|
+
- lib/cocoapods-allowlist/model/sources.rb
|
72
|
+
- lib/cocoapods-allowlist/model/validation_excluded.rb
|
73
|
+
- lib/cocoapods-allowlist/utils/command.rb
|
74
|
+
- lib/cocoapods-allowlist/validator/source_validator.rb
|
72
75
|
- lib/cocoapods_plugin.rb
|
76
|
+
- spec/allowlist_resolver_spec.rb
|
77
|
+
- spec/allowlist_spec.rb
|
73
78
|
- spec/mocks/allowed_with_granular.podspec
|
79
|
+
- spec/mocks/allowlist.json
|
80
|
+
- spec/mocks/allowlist_with_expired_dependencies.json
|
81
|
+
- spec/mocks/allowlisted_podname.podspec
|
74
82
|
- spec/mocks/bad_name.podspec
|
75
83
|
- spec/mocks/free_version.podspec
|
76
84
|
- spec/mocks/major_version_fixed.podspec
|
77
85
|
- spec/mocks/not_allowed.podspec
|
78
86
|
- spec/mocks/not_allowed_with_granular_v1.podspec
|
79
87
|
- spec/mocks/not_allowed_with_granular_v2.podspec
|
80
|
-
- spec/mocks/whitelist.json
|
81
|
-
- spec/mocks/whitelist_with_expired_dependencies.json
|
82
|
-
- spec/mocks/whitelisted_podname.podspec
|
83
88
|
- spec/mocks/with_allowed_in_subspec.podspec
|
84
89
|
- spec/mocks/with_allowed_subspec_v1.podspec
|
85
90
|
- spec/mocks/with_allowed_subspec_v2.podspec
|
91
|
+
- spec/mocks/with_allowlisted_dependency_fixed_versions_v1.podspec
|
92
|
+
- spec/mocks/with_allowlisted_dependency_fixed_versions_v2.podspec
|
93
|
+
- spec/mocks/with_allowlisted_dependency_fixed_versions_variable.podspec
|
86
94
|
- spec/mocks/with_expired_dependencies.podspec
|
87
95
|
- spec/mocks/with_fixed_version.podspec
|
88
96
|
- spec/mocks/with_more_than_one_version_in_subspec.podspec
|
@@ -92,16 +100,11 @@ files:
|
|
92
100
|
- spec/mocks/with_not_yet_expired_dependencies.podspec
|
93
101
|
- spec/mocks/with_similar_name_not_allowed.podspec
|
94
102
|
- spec/mocks/with_two_requirement.podspec
|
95
|
-
- spec/mocks/with_whitelisted_dependency_fixed_versions_v1.podspec
|
96
|
-
- spec/mocks/with_whitelisted_dependency_fixed_versions_v2.podspec
|
97
|
-
- spec/mocks/with_whitelisted_dependency_fixed_versions_variable.podspec
|
98
103
|
- spec/mocks/without_dependencies.podspec
|
99
104
|
- spec/mocks/without_version.podspec
|
100
105
|
- spec/source_helper_spec.rb
|
101
106
|
- spec/source_validator_spec.rb
|
102
107
|
- spec/spec_helper.rb
|
103
|
-
- spec/whitelist_resolver_spec.rb
|
104
|
-
- spec/whitelist_spec.rb
|
105
108
|
homepage: https://github.com/melisource/mobile-cocoapods_whitelist
|
106
109
|
licenses:
|
107
110
|
- MIT
|
@@ -121,24 +124,29 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
121
124
|
- !ruby/object:Gem::Version
|
122
125
|
version: '0'
|
123
126
|
requirements: []
|
124
|
-
rubygems_version: 3.
|
127
|
+
rubygems_version: 3.3.26
|
125
128
|
signing_key:
|
126
129
|
specification_version: 4
|
127
|
-
summary: A longer description of cocoapods-
|
130
|
+
summary: A longer description of cocoapods-allowlist.
|
128
131
|
test_files:
|
132
|
+
- spec/allowlist_resolver_spec.rb
|
133
|
+
- spec/allowlist_spec.rb
|
129
134
|
- spec/mocks/allowed_with_granular.podspec
|
135
|
+
- spec/mocks/allowlist.json
|
136
|
+
- spec/mocks/allowlist_with_expired_dependencies.json
|
137
|
+
- spec/mocks/allowlisted_podname.podspec
|
130
138
|
- spec/mocks/bad_name.podspec
|
131
139
|
- spec/mocks/free_version.podspec
|
132
140
|
- spec/mocks/major_version_fixed.podspec
|
133
141
|
- spec/mocks/not_allowed.podspec
|
134
142
|
- spec/mocks/not_allowed_with_granular_v1.podspec
|
135
143
|
- spec/mocks/not_allowed_with_granular_v2.podspec
|
136
|
-
- spec/mocks/whitelist.json
|
137
|
-
- spec/mocks/whitelist_with_expired_dependencies.json
|
138
|
-
- spec/mocks/whitelisted_podname.podspec
|
139
144
|
- spec/mocks/with_allowed_in_subspec.podspec
|
140
145
|
- spec/mocks/with_allowed_subspec_v1.podspec
|
141
146
|
- spec/mocks/with_allowed_subspec_v2.podspec
|
147
|
+
- spec/mocks/with_allowlisted_dependency_fixed_versions_v1.podspec
|
148
|
+
- spec/mocks/with_allowlisted_dependency_fixed_versions_v2.podspec
|
149
|
+
- spec/mocks/with_allowlisted_dependency_fixed_versions_variable.podspec
|
142
150
|
- spec/mocks/with_expired_dependencies.podspec
|
143
151
|
- spec/mocks/with_fixed_version.podspec
|
144
152
|
- spec/mocks/with_more_than_one_version_in_subspec.podspec
|
@@ -148,13 +156,8 @@ test_files:
|
|
148
156
|
- spec/mocks/with_not_yet_expired_dependencies.podspec
|
149
157
|
- spec/mocks/with_similar_name_not_allowed.podspec
|
150
158
|
- spec/mocks/with_two_requirement.podspec
|
151
|
-
- spec/mocks/with_whitelisted_dependency_fixed_versions_v1.podspec
|
152
|
-
- spec/mocks/with_whitelisted_dependency_fixed_versions_v2.podspec
|
153
|
-
- spec/mocks/with_whitelisted_dependency_fixed_versions_variable.podspec
|
154
159
|
- spec/mocks/without_dependencies.podspec
|
155
160
|
- spec/mocks/without_version.podspec
|
156
161
|
- spec/source_helper_spec.rb
|
157
162
|
- spec/source_validator_spec.rb
|
158
163
|
- spec/spec_helper.rb
|
159
|
-
- spec/whitelist_resolver_spec.rb
|
160
|
-
- spec/whitelist_spec.rb
|
@@ -1,54 +0,0 @@
|
|
1
|
-
require 'singleton'
|
2
|
-
require 'open-uri'
|
3
|
-
require 'cocoapods-whitelist/model/allowed_dependency'
|
4
|
-
|
5
|
-
class WhitelistResolver
|
6
|
-
include Singleton
|
7
|
-
attr_accessor :whitelist
|
8
|
-
attr_accessor :whitelist_loaded
|
9
|
-
attr_accessor :whitelist_url
|
10
|
-
|
11
|
-
def config
|
12
|
-
@whitelist ||= []
|
13
|
-
end
|
14
|
-
|
15
|
-
def initialize()
|
16
|
-
@whitelist_url = DEFAULT_WHITELIST_URL
|
17
|
-
load_whitelist()
|
18
|
-
end
|
19
|
-
|
20
|
-
def get_whitelist(whitelist_url = DEFAULT_WHITELIST_URL)
|
21
|
-
@whitelist_loaded = @whitelist_url == whitelist_url
|
22
|
-
@whitelist_url = whitelist_url
|
23
|
-
|
24
|
-
load_whitelist() unless @whitelist_loaded
|
25
|
-
return @whitelist
|
26
|
-
end
|
27
|
-
|
28
|
-
def load_whitelist
|
29
|
-
begin
|
30
|
-
URI.open(@whitelist_url) { |io|
|
31
|
-
buffer = io.read
|
32
|
-
@whitelist = parse_whitelist(buffer)
|
33
|
-
@whitelist_loaded = true
|
34
|
-
}
|
35
|
-
rescue OpenURI::HTTPError => e
|
36
|
-
status = e.io.status.join(' ')
|
37
|
-
raise "Failed to fetch whitelist from '#{@whitelist_url}'.\n Error: #{status}"
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
def parse_whitelist(raw_whitelist)
|
42
|
-
json = JSON.parse(raw_whitelist)
|
43
|
-
return json["whitelist"].map { |dependencyJson|
|
44
|
-
AllowedDependency.new(
|
45
|
-
dependencyJson["name"],
|
46
|
-
dependencyJson["version"],
|
47
|
-
dependencyJson["expire"],
|
48
|
-
dependencyJson["source"],
|
49
|
-
dependencyJson["target"],
|
50
|
-
dependencyJson["allows_granular_projects"]
|
51
|
-
)
|
52
|
-
}
|
53
|
-
end
|
54
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'cocoapods-whitelist/command/whitelist'
|
@@ -1 +0,0 @@
|
|
1
|
-
require 'cocoapods-whitelist/hook/resolver'
|
data/lib/cocoapods-whitelist.rb
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
require 'cocoapods-whitelist/gem_version'
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require File.expand_path('../spec_helper', __FILE__)
|
2
|
-
|
3
|
-
WHITELIST_PATH = './spec/mocks/whitelist.json'
|
4
|
-
|
5
|
-
describe WhitelistResolver do
|
6
|
-
describe 'functionality' do
|
7
|
-
it 'whitelist should be loaded from an specific url' do
|
8
|
-
whitelist = WhitelistResolver.instance.get_whitelist(WHITELIST_PATH)
|
9
|
-
whitelist.size.should.equal 11
|
10
|
-
end
|
11
|
-
|
12
|
-
it 'if not URL is specified, whitelist comes from default URL' do
|
13
|
-
whitelist = WhitelistResolver.instance.get_whitelist
|
14
|
-
whitelist.should.not.empty?
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'whitelist should not be loaded twice' do
|
18
|
-
WhitelistResolver.instance.get_whitelist(WHITELIST_PATH)
|
19
|
-
loaded = WhitelistResolver.instance.whitelist_loaded
|
20
|
-
|
21
|
-
loaded.should.be.true
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|