cocoapods-whitelist 0.3.0 → 0.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6da1231f35d7f1c52238b04c2768d659be74cd24d77e47dbfc01d412b78fdb96
4
- data.tar.gz: b26d0408060bc95c389c13cca463ba0ae53c40c0fe2cf406e064018cc2640ee6
3
+ metadata.gz: ffc625c9e77a33e388bb3ab6aefa68a411c867566c5ce36b5940968379158392
4
+ data.tar.gz: cc94531be7b38d3083602ed904b1db8b5ff2a10fd754a2a231ee2a2cecbbbc3a
5
5
  SHA512:
6
- metadata.gz: cdeea15ed4860699ba65725fb5088c7c9072e0cf1fb1c9719855ebc0c6bfe9451aad0069422a886788f5bf35e6d12d4837eefd2d4d86d823d42db644fc80dcac
7
- data.tar.gz: 5ea2bdfc77748180a2e0dc4fb0053d932edcaec433ce821a2abd39e269f451119ac4f94682257c2d214e814f0b4d6767adea628230987c3fec398d34f3546574
6
+ metadata.gz: e0584e160d8a3d3882df0e6160ad4e6bd2618dda858b6bbe0bf29895dd65cfc664beff4984bf02dc8e5af66c5da53a37611bc23425575e57d4ef371154a6383b
7
+ data.tar.gz: f138505fea9899de8b1e5a91391071dc5b114f2520ffb4fa1f5a59ae2b01eed614db6320228ac72a967febfff5fae6beea0c0cb620b0188ac7306bcbbabba2cf
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.1.4
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.4.0
2
+ ### Changed
3
+ - Add "allows_granular_projects" flag to whitelist for support the projects specified
4
+
1
5
  ## 0.2.1
2
6
  ### Changed
3
7
  - Improve dependency injection message to inform the local source is being used.
data/Gemfile.lock CHANGED
@@ -1,112 +1,119 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocoapods-whitelist (0.2.0)
4
+ cocoapods-whitelist (0.4.0)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
8
8
  specs:
9
- CFPropertyList (3.0.3)
10
- activesupport (5.2.4.5)
9
+ CFPropertyList (3.0.6)
10
+ rexml
11
+ activesupport (6.1.7.6)
11
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
12
- i18n (>= 0.7, < 2)
13
- minitest (~> 5.1)
14
- tzinfo (~> 1.1)
15
- addressable (2.7.0)
16
- public_suffix (>= 2.0.2, < 5.0)
13
+ i18n (>= 1.6, < 2)
14
+ minitest (>= 5.1)
15
+ tzinfo (~> 2.0)
16
+ zeitwerk (~> 2.3)
17
+ addressable (2.8.5)
18
+ public_suffix (>= 2.0.2, < 6.0)
17
19
  algoliasearch (1.27.5)
18
20
  httpclient (~> 2.8, >= 2.8.3)
19
21
  json (>= 1.5.1)
20
22
  atomos (0.1.3)
21
23
  bacon (1.2.0)
22
- claide (1.0.3)
23
- cocoapods (1.10.1)
24
- addressable (~> 2.6)
24
+ claide (1.1.0)
25
+ cocoapods (1.13.0)
26
+ addressable (~> 2.8)
25
27
  claide (>= 1.0.2, < 2.0)
26
- cocoapods-core (= 1.10.1)
28
+ cocoapods-core (= 1.13.0)
27
29
  cocoapods-deintegrate (>= 1.0.3, < 2.0)
28
- cocoapods-downloader (>= 1.4.0, < 2.0)
30
+ cocoapods-downloader (>= 1.6.0, < 2.0)
29
31
  cocoapods-plugins (>= 1.0.0, < 2.0)
30
32
  cocoapods-search (>= 1.0.0, < 2.0)
31
- cocoapods-trunk (>= 1.4.0, < 2.0)
33
+ cocoapods-trunk (>= 1.6.0, < 2.0)
32
34
  cocoapods-try (>= 1.1.0, < 2.0)
33
35
  colored2 (~> 3.1)
34
36
  escape (~> 0.0.4)
35
37
  fourflusher (>= 2.3.0, < 3.0)
36
38
  gh_inspector (~> 1.0)
37
- molinillo (~> 0.6.6)
39
+ molinillo (~> 0.8.0)
38
40
  nap (~> 1.0)
39
- ruby-macho (~> 1.4)
40
- xcodeproj (>= 1.19.0, < 2.0)
41
- cocoapods-core (1.10.1)
42
- activesupport (> 5.0, < 6)
43
- addressable (~> 2.6)
41
+ ruby-macho (>= 2.3.0, < 3.0)
42
+ xcodeproj (>= 1.23.0, < 2.0)
43
+ cocoapods-core (1.13.0)
44
+ activesupport (>= 5.0, < 8)
45
+ addressable (~> 2.8)
44
46
  algoliasearch (~> 1.0)
45
47
  concurrent-ruby (~> 1.1)
46
48
  fuzzy_match (~> 2.0.4)
47
49
  nap (~> 1.0)
48
50
  netrc (~> 0.11)
49
- public_suffix
51
+ public_suffix (~> 4.0)
50
52
  typhoeus (~> 1.0)
51
- cocoapods-deintegrate (1.0.4)
52
- cocoapods-downloader (1.4.0)
53
+ cocoapods-deintegrate (1.0.5)
54
+ cocoapods-downloader (1.6.3)
53
55
  cocoapods-plugins (1.0.0)
54
56
  nap
55
- cocoapods-search (1.0.0)
56
- cocoapods-trunk (1.5.0)
57
+ cocoapods-search (1.0.1)
58
+ cocoapods-trunk (1.6.0)
57
59
  nap (>= 0.8, < 2.0)
58
60
  netrc (~> 0.11)
59
61
  cocoapods-try (1.2.0)
60
62
  colored2 (3.1.2)
61
- concurrent-ruby (1.1.8)
63
+ concurrent-ruby (1.2.2)
62
64
  escape (0.0.4)
63
- ethon (0.12.0)
64
- ffi (>= 1.3.0)
65
- ffi (1.14.2)
65
+ ethon (0.16.0)
66
+ ffi (>= 1.15.0)
67
+ ffi (1.16.3)
66
68
  fourflusher (2.3.1)
67
69
  fuzzy_match (2.0.4)
68
70
  gh_inspector (1.1.3)
69
71
  httpclient (2.8.3)
70
- i18n (1.8.9)
72
+ i18n (1.14.1)
71
73
  concurrent-ruby (~> 1.0)
72
- json (2.5.1)
73
- minitest (5.14.4)
74
- mocha (1.12.0)
74
+ json (2.6.3)
75
+ minitest (5.20.0)
76
+ mocha (2.1.0)
77
+ ruby2_keywords (>= 0.0.5)
75
78
  mocha-on-bacon (0.2.3)
76
79
  mocha (>= 0.13.0)
77
- molinillo (0.6.6)
80
+ molinillo (0.8.0)
78
81
  nanaimo (0.3.0)
79
82
  nap (1.1.0)
80
83
  netrc (0.11.0)
81
84
  prettybacon (0.0.2)
82
85
  bacon (~> 1.2)
83
- public_suffix (4.0.6)
86
+ public_suffix (4.0.7)
84
87
  rake (12.3.3)
85
- ruby-macho (1.4.0)
86
- thread_safe (0.3.6)
88
+ rexml (3.2.6)
89
+ ruby-macho (2.5.1)
90
+ ruby2_keywords (0.0.5)
87
91
  typhoeus (1.4.0)
88
92
  ethon (>= 0.9.0)
89
- tzinfo (1.2.9)
90
- thread_safe (~> 0.1)
91
- xcodeproj (1.19.0)
93
+ tzinfo (2.0.6)
94
+ concurrent-ruby (~> 1.0)
95
+ xcodeproj (1.23.0)
92
96
  CFPropertyList (>= 2.3.3, < 4.0)
93
97
  atomos (~> 0.1.3)
94
98
  claide (>= 1.0.2, < 2.0)
95
99
  colored2 (~> 3.1)
96
100
  nanaimo (~> 0.3.0)
101
+ rexml (~> 3.2.4)
102
+ zeitwerk (2.6.12)
97
103
 
98
104
  PLATFORMS
99
- ruby
105
+ universal-darwin-22
100
106
 
101
107
  DEPENDENCIES
102
108
  bacon
103
109
  bundler (~> 2.0)
104
110
  cocoapods
105
111
  cocoapods-whitelist!
112
+ json
106
113
  mocha
107
114
  mocha-on-bacon
108
115
  prettybacon
109
116
  rake (~> 12.0)
110
117
 
111
118
  BUNDLED WITH
112
- 2.1.4
119
+ 2.4.22
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
10
10
  spec.email = ['mobile@mercadolibre.com']
11
11
  spec.description = %q{A short description of cocoapods-whitelist.}
12
12
  spec.summary = %q{A longer description of cocoapods-whitelist.}
13
- spec.homepage = 'https://github.com/mercadolibre/mobile-cocoapods_whitelist'
13
+ spec.homepage = 'https://github.com/melisource/mobile-cocoapods_whitelist'
14
14
  spec.license = 'MIT'
15
15
 
16
16
  spec.files = `git ls-files`.split($/)
@@ -1,4 +1,5 @@
1
1
  require 'singleton'
2
+ require 'open-uri'
2
3
  require 'cocoapods-whitelist/model/allowed_dependency'
3
4
 
4
5
  class WhitelistResolver
@@ -26,7 +27,7 @@ class WhitelistResolver
26
27
 
27
28
  def load_whitelist
28
29
  begin
29
- open(@whitelist_url) { |io|
30
+ URI.open(@whitelist_url) { |io|
30
31
  buffer = io.read
31
32
  @whitelist = parse_whitelist(buffer)
32
33
  @whitelist_loaded = true
@@ -40,7 +41,14 @@ class WhitelistResolver
40
41
  def parse_whitelist(raw_whitelist)
41
42
  json = JSON.parse(raw_whitelist)
42
43
  return json["whitelist"].map { |dependencyJson|
43
- AllowedDependency.new(dependencyJson["name"], dependencyJson["version"], dependencyJson["expire"], dependencyJson["source"], dependencyJson["target"])
44
+ AllowedDependency.new(
45
+ dependencyJson["name"],
46
+ dependencyJson["version"],
47
+ dependencyJson["expire"],
48
+ dependencyJson["source"],
49
+ dependencyJson["target"],
50
+ dependencyJson["allows_granular_projects"]
51
+ )
44
52
  }
45
53
  end
46
54
  end
@@ -93,13 +93,27 @@ module Pod
93
93
  name.start_with?(item.name.match(POD_NAME_REGEX).captures[POD_BASE_REGEX_POSITION]) && (!item.version || versions.grep(/#{item.version}/).any?) && (item.target == 'production')
94
94
  }
95
95
 
96
- # Checks if any of the allowed dependencies are expired, if so, fail with error
97
96
  allowedDependency.each { |dependency|
97
+
98
+ # Checks the granularity
99
+ if dependency.allows_granular_projects != nil
100
+ granular_projects = dependency.allows_granular_projects.select { |granular_project|
101
+ granular_project == pod_name
102
+ }
103
+
104
+ if granular_projects.empty?
105
+ not_allowed.push("#{name} Reason: Granular dependency not allowed for this project.")
106
+ next
107
+ end
108
+ end
109
+
110
+ # Checks if any of the allowed dependencies are expired, if so, fail with error
98
111
  if dependency.expire?
99
112
  not_allowed.push("#{name} Reason: Expired version. Please check the whitelist.")
100
113
  end
101
- }
102
114
 
115
+ }
116
+
103
117
  if allowedDependency.empty?
104
118
  not_allowed.push("#{name} (#{versions.join(", ")}) Reason: Specified version hasn't match any whitelisted version or Pod name is not valid")
105
119
  next
@@ -163,6 +177,7 @@ module Pod
163
177
  FileUtils.mkdir_p(File.dirname(@outfile))
164
178
  end
165
179
  end
180
+
166
181
  ## Load a list of pods excluded from the validations, wrapped in ValidationExcluded.
167
182
  def load_excluded
168
183
  path = File.expand_path("../../exclude/excluded.json", __FILE__)
@@ -171,6 +186,7 @@ module Pod
171
186
  @excluded_list = parse_excluded(file)
172
187
  @excluded_list_loaded = true
173
188
  end
189
+
174
190
  ## Aux function to populate the ValidationExcluded models from the JSON data.
175
191
  def parse_excluded(list)
176
192
  json = JSON.parse(list)
@@ -1,3 +1,3 @@
1
1
  module CocoapodsWhitelist
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.0"
3
3
  end
@@ -4,13 +4,15 @@ class AllowedDependency
4
4
  attr_accessor :expire
5
5
  attr_accessor :source
6
6
  attr_accessor :target
7
+ attr_accessor :allows_granular_projects
7
8
 
8
- def initialize(name, version, expire, source, target)
9
+ def initialize(name, version, expire, source, target, allows_granular_projects)
9
10
  @name = name
10
11
  @version = version
11
12
  @expire = expire
12
13
  @source = source
13
14
  @target = target
15
+ @allows_granular_projects = allows_granular_projects
14
16
  end
15
17
 
16
18
  def expire?
@@ -0,0 +1,13 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = "MLSearch"
3
+ s.version = "3.17.0"
4
+ s.summary = "Componente de search"
5
+ s.homepage = "http://www.mercadolibre.com.ar"
6
+ s.license = "none"
7
+ s.author = { "Mobile team" => "mobile@mercadolibre.com" }
8
+ s.platform = :ios, "7.0"
9
+ s.source = { :git => "git@github.com:mercadolibre/search-ios.git", :tag => s.version.to_s }
10
+ s.requires_arc = true
11
+ s.dependency 'Analytics', '~>5.1'
12
+
13
+ end
@@ -0,0 +1,13 @@
1
+ Pod::Spec.new do |s|
2
+ s.name = "MeliSDK"
3
+ s.version = "3.17.0"
4
+ s.summary = "Componente de search"
5
+ s.homepage = "http://www.mercadolibre.com.ar"
6
+ s.license = "none"
7
+ s.author = { "Mobile team" => "mobile@mercadolibre.com" }
8
+ s.platform = :ios, "7.0"
9
+ s.source = { :git => "git@github.com:mercadolibre/search-ios.git", :tag => s.version.to_s }
10
+ s.requires_arc = true
11
+ s.dependency 'Analytics', '~>5.1'
12
+
13
+ end
@@ -33,6 +33,14 @@
33
33
  "name": "MLMyDependency",
34
34
  "version": "1.0.0|2.0.0",
35
35
  "target": "production"
36
+ },
37
+ {
38
+ "name": "Analytics",
39
+ "version": "^~>5.[0-9]+$",
40
+ "target": "production",
41
+ "allows_granular_projects": [
42
+ "MLSearch"
43
+ ]
36
44
  }
37
45
  ]
38
46
  }
@@ -6,11 +6,11 @@ describe SourceHelper do
6
6
 
7
7
  SourceHelper.instance.specs = [] # Avoid a non-empty SourceHelper
8
8
 
9
- private_sources = [ "git@github.com:mercadolibre/mobile-ios_specs.git", "git@github.com:testable/testable_specs.git" ]
9
+ private_sources = [ "git@github.com:melisource/mobile-ios_specs.git", "git@github.com:testable/testable_specs.git" ]
10
10
 
11
11
  private_meli_specs = ["MyMELIPod1", "MyMELIPod2", "MyMELIPod3"]
12
12
  meli_mock = mock()
13
- meli_mock.stubs(:url).returns("git@github.com:mercadolibre/mobile-ios_specs.git")
13
+ meli_mock.stubs(:url).returns("git@github.com:melisource/mobile-ios_specs.git")
14
14
  meli_mock.stubs(:pods).returns(private_meli_specs)
15
15
 
16
16
  private_cocoapods_cdn_specs = ["MyPublicPod1", "MyPublicPod2", "MyPublicPod2"]
@@ -38,11 +38,11 @@ describe SourceHelper do
38
38
 
39
39
  SourceHelper.instance.specs = [] # Avoid a non-empty SourceHelper
40
40
 
41
- private_sources = [ "git@github.com:mercadolibre/mobile-ios_specs.git", "git@github.com:testable/testable_specs.git" ]
41
+ private_sources = [ "git@github.com:melisource/mobile-ios_specs.git", "git@github.com:testable/testable_specs.git" ]
42
42
 
43
43
  private_meli_specs = []
44
44
  meli_mock = mock()
45
- meli_mock.stubs(:url).returns("git@github.com:mercadolibre/mobile-ios_specs.git")
45
+ meli_mock.stubs(:url).returns("git@github.com:melisource/mobile-ios_specs.git")
46
46
  meli_mock.stubs(:pods).returns(private_meli_specs)
47
47
 
48
48
  private_cocoapods_cdn_specs = []
@@ -4,7 +4,7 @@ describe SourceValidator do
4
4
  describe 'functionality' do
5
5
  it 'external dependency that comes from a public source should be valid' do
6
6
 
7
- private_sources = [ "git@github.com:mercadolibre/mobile-ios_specs.git" ]
7
+ private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
8
8
  private_specs = ["MyPod1", "MyPod1", "MyPod3"]
9
9
 
10
10
  stub_url = stub(:url => 'https://cdn.cocoapods.org/')
@@ -20,7 +20,7 @@ describe SourceValidator do
20
20
  end
21
21
 
22
22
  it 'internal dependency that comes from a public source should not be valid' do
23
- private_sources = [ "git@github.com:mercadolibre/mobile-ios_specs.git" ]
23
+ private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
24
24
  private_specs = ["MyPod1", "MyPod1", "MyPod3", "MyInternalPod"]
25
25
 
26
26
  stub_url = stub(:url => 'https://cdn.cocoapods.org/')
@@ -37,10 +37,10 @@ describe SourceValidator do
37
37
 
38
38
  it 'internal dependency that comes from private source should be valid' do
39
39
 
40
- private_sources = [ "git@github.com:mercadolibre/mobile-ios_specs.git" ]
40
+ private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
41
41
  private_specs = ["MyPod1", "MyPod1", "MyPod3", "MyInternalPod"]
42
42
 
43
- stub_url = stub(:url => 'git@github.com:mercadolibre/mobile-ios_specs.git')
43
+ stub_url = stub(:url => 'git@github.com:melisource/mobile-ios_specs.git')
44
44
  spec_mock = mock()
45
45
  spec_mock.stubs(:spec_source).returns(stub_url)
46
46
  spec_mock.stubs(:defined_in_file).returns(nil?)
@@ -54,7 +54,7 @@ describe SourceValidator do
54
54
 
55
55
  it 'development pods should be valid' do
56
56
 
57
- private_sources = [ "git@github.com:mercadolibre/mobile-ios_specs.git" ]
57
+ private_sources = [ "git@github.com:melisource/mobile-ios_specs.git" ]
58
58
  private_specs = ["MyPod1", "MyPod1", "MyPod3", "MyInternalPod"]
59
59
 
60
60
  stub_url = stub(:url => '')
@@ -6,7 +6,7 @@ describe WhitelistResolver do
6
6
  describe 'functionality' do
7
7
  it 'whitelist should be loaded from an specific url' do
8
8
  whitelist = WhitelistResolver.instance.get_whitelist(WHITELIST_PATH)
9
- whitelist.size.should.equal 6
9
+ whitelist.size.should.equal 7
10
10
  end
11
11
 
12
12
  it 'if not URL is specified, whitelist comes from default URL' do
@@ -171,6 +171,21 @@ module Pod
171
171
  command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}"])
172
172
  lambda { command.run }.should.not.raise
173
173
  end
174
+
175
+ it 'allowed granular dependency should be valid' do
176
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
177
+ specification = Pod::Specification.from_file('./spec/mocks/allowed_with_granular.podspec')
178
+ command.expects(:get_podspec_specifications).returns([specification])
179
+ lambda { command.run }.should.not.raise Informative
180
+ end
181
+
182
+ it 'not allowed granular dependency should not be valid' do
183
+ command = Command.parse(['whitelist', "--config=#{WHITELIST_FILE}", "--fail-on-error"])
184
+ specification = Pod::Specification.from_file('./spec/mocks/not_allowed_with_granular.podspec')
185
+ command.expects(:get_podspec_specifications).returns([specification])
186
+ lambda { command.run }.should.raise Informative
187
+ end
188
+
174
189
  end
175
190
  end
176
191
  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.3.0
4
+ version: 0.4.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: 2023-03-22 00:00:00.000000000 Z
11
+ date: 2023-12-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -47,6 +47,7 @@ extra_rdoc_files: []
47
47
  files:
48
48
  - ".circleci/config.yml"
49
49
  - ".gitignore"
50
+ - ".ruby-version"
50
51
  - CHANGELOG.md
51
52
  - Gemfile
52
53
  - Gemfile.lock
@@ -68,10 +69,12 @@ files:
68
69
  - lib/cocoapods-whitelist/model/validation_excluded.rb
69
70
  - lib/cocoapods-whitelist/validator/source_validator.rb
70
71
  - lib/cocoapods_plugin.rb
72
+ - spec/mocks/allowed_with_granular.podspec
71
73
  - spec/mocks/bad_name.podspec
72
74
  - spec/mocks/free_version.podspec
73
75
  - spec/mocks/major_version_fixed.podspec
74
76
  - spec/mocks/not_allowed.podspec
77
+ - spec/mocks/not_allowed_with_granular.podspec
75
78
  - spec/mocks/whitelist.json
76
79
  - spec/mocks/whitelist_with_expired_dependencies.json
77
80
  - spec/mocks/whitelisted_podname.podspec
@@ -95,7 +98,7 @@ files:
95
98
  - spec/spec_helper.rb
96
99
  - spec/whitelist_resolver_spec.rb
97
100
  - spec/whitelist_spec.rb
98
- homepage: https://github.com/mercadolibre/mobile-cocoapods_whitelist
101
+ homepage: https://github.com/melisource/mobile-cocoapods_whitelist
99
102
  licenses:
100
103
  - MIT
101
104
  metadata: {}
@@ -114,15 +117,17 @@ required_rubygems_version: !ruby/object:Gem::Requirement
114
117
  - !ruby/object:Gem::Version
115
118
  version: '0'
116
119
  requirements: []
117
- rubygems_version: 3.2.3
120
+ rubygems_version: 3.3.26
118
121
  signing_key:
119
122
  specification_version: 4
120
123
  summary: A longer description of cocoapods-whitelist.
121
124
  test_files:
125
+ - spec/mocks/allowed_with_granular.podspec
122
126
  - spec/mocks/bad_name.podspec
123
127
  - spec/mocks/free_version.podspec
124
128
  - spec/mocks/major_version_fixed.podspec
125
129
  - spec/mocks/not_allowed.podspec
130
+ - spec/mocks/not_allowed_with_granular.podspec
126
131
  - spec/mocks/whitelist.json
127
132
  - spec/mocks/whitelist_with_expired_dependencies.json
128
133
  - spec/mocks/whitelisted_podname.podspec