chelsea 0.0.23 → 0.0.28

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1e449eef0aced5604c791b2b96bd8c0fffcc935271106ce300f5214828085f11
4
- data.tar.gz: 703d4e5370a721099a08ff1605ec94b922d9d0bcc24b58a72ee5d1ddfd6e5cfc
3
+ metadata.gz: 1d6bcb375015c64ae7e452f93e38b10cfabb4ecbc9425fad0121e926a0148efa
4
+ data.tar.gz: f1a171d3a72a0bf910ac4e22258cee6a0d6c3e8181307856a34a5b22ca0435c7
5
5
  SHA512:
6
- metadata.gz: 0af11040da9872e3b66440a52c9c33a74a2b15479bc2bf35363f87e2efdd26e149d271e0bfeef840f49cd2ee8d55430de8b1ab95cff6b61a5b9fdead77ace994
7
- data.tar.gz: 1ca241b79dea4decab7d6d667c1cc61d2b4ee16d8d92b731bafbd890dadfb712db33dda125d49350d0bc706f87485dffdf545a8873d202e1b05a64b895e903e1
6
+ metadata.gz: decb1e4e8a54798161b2e888e1694d9558ba0bbacd6708c6cf32d4b71b32cb05520f017733a18e90dab99c0e2e2be500d3c8b8701b1ff464041ad63ab89ffa74
7
+ data.tar.gz: 94f91e9b3f248d7a3c494fdba567f832edf38b2e91e75f791ac1d9dace17b285e89d09c43bae25d6faacd0b2a76e5a4bb211acb3153dfc57ea4b581243f5d8d1
@@ -18,7 +18,7 @@ version: 2.1
18
18
  jobs:
19
19
  build:
20
20
  docker:
21
- - image: circleci/ruby:2.6.5-stretch
21
+ - image: circleci/ruby:2.6.6-stretch
22
22
  environment:
23
23
  BUNDLE_PATH: vendor/bundle
24
24
  steps:
@@ -35,7 +35,9 @@ jobs:
35
35
  - chelsea-bundle-v2-
36
36
  - run:
37
37
  name: Bundle Install
38
- command: bundle check --path vendor/bundle || bundle install
38
+ command: |
39
+ bundle config set --local path 'vendor/bundle'
40
+ bundle check || bundle install
39
41
  - save_cache:
40
42
  key: chelsea-bundle-v2-{{ checksum "Gemfile.lock" }}
41
43
  paths:
@@ -46,6 +48,9 @@ jobs:
46
48
  bundle exec rspec --format progress \
47
49
  --format RspecJunitFormatter \
48
50
  --out test_results/rspec.xml
51
+ - run:
52
+ name: Run linter
53
+ command: bundle exec rubocop
49
54
  - run:
50
55
  name: Build gem
51
56
  command: gem build chelsea.gemspec
@@ -62,7 +67,7 @@ jobs:
62
67
  path: test_results
63
68
  release:
64
69
  docker:
65
- - image: circleci/ruby:2.6.5-stretch
70
+ - image: circleci/ruby:2.6.6-stretch
66
71
  steps:
67
72
  - add_ssh_keys:
68
73
  fingerprints:
@@ -23,7 +23,7 @@ If applicable, add screenshots to help explain your problem.
23
23
 
24
24
  **Desktop (please complete the following information):**
25
25
  - OS: [e.g. OS X 1.13.6]
26
- - Ruby Version: [e.g. 2.6.5]
26
+ - Ruby Version: [e.g. 2.6.6]
27
27
  - Bundler Version: [e.g. 2.1.4]
28
28
  - chelsea Version [e.g. 0.0.11]
29
29
 
@@ -0,0 +1,6 @@
1
+ AllCops:
2
+ NewCops: enable
3
+ TargetRubyVersion: 2.6.6
4
+
5
+ Metrics/BlockLength:
6
+ IgnoredMethods: ['Slop.parse']
data/Gemfile CHANGED
@@ -1,6 +1,11 @@
1
- source "https://rubygems.org"
1
+ # frozen_string_literal: true
2
2
 
3
- git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
3
+ source 'https://rubygems.org'
4
+
5
+ git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
4
6
 
5
7
  # Specify your gem's dependencies in chelsea.gemspec
6
8
  gemspec
9
+
10
+ # linter
11
+ gem 'rubocop', require: false
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- chelsea (0.0.17)
4
+ chelsea (0.0.27)
5
5
  bundler (>= 1.2.0, < 3)
6
6
  ox (~> 2.13.2)
7
7
  pastel (~> 0.7.2)
@@ -16,6 +16,7 @@ GEM
16
16
  specs:
17
17
  addressable (2.7.0)
18
18
  public_suffix (>= 2.0.2, < 5.0)
19
+ ast (2.4.2)
19
20
  byebug (11.1.2)
20
21
  crack (0.4.3)
21
22
  safe_yaml (~> 1.0.0)
@@ -31,16 +32,22 @@ GEM
31
32
  mime-types-data (3.2020.0512)
32
33
  necromancer (0.6.0)
33
34
  netrc (0.11.0)
34
- ox (2.13.2)
35
+ ox (2.13.4)
36
+ parallel (1.20.1)
37
+ parser (3.0.0.0)
38
+ ast (~> 2.4.1)
35
39
  pastel (0.7.4)
36
40
  equatable (~> 0.6)
37
41
  tty-color (~> 0.5)
38
42
  public_suffix (4.0.3)
43
+ rainbow (3.0.0)
39
44
  rake (12.3.3)
45
+ regexp_parser (2.0.3)
40
46
  rest-client (2.0.2)
41
47
  http-cookie (>= 1.0.2, < 2.0)
42
48
  mime-types (>= 1.16, < 4.0)
43
49
  netrc (~> 0.8)
50
+ rexml (3.2.4)
44
51
  rspec (3.9.0)
45
52
  rspec-core (~> 3.9.0)
46
53
  rspec-expectations (~> 3.9.0)
@@ -56,17 +63,29 @@ GEM
56
63
  rspec-support (3.9.2)
57
64
  rspec_junit_formatter (0.4.1)
58
65
  rspec-core (>= 2, < 4, != 2.12.0)
66
+ rubocop (1.9.0)
67
+ parallel (~> 1.10)
68
+ parser (>= 3.0.0.0)
69
+ rainbow (>= 2.2.2, < 4.0)
70
+ regexp_parser (>= 1.8, < 3.0)
71
+ rexml
72
+ rubocop-ast (>= 1.2.0, < 2.0)
73
+ ruby-progressbar (~> 1.7)
74
+ unicode-display_width (>= 1.4.0, < 3.0)
75
+ rubocop-ast (1.4.1)
76
+ parser (>= 2.7.1.5)
77
+ ruby-progressbar (1.11.0)
59
78
  safe_yaml (1.0.5)
60
- slop (4.8.1)
79
+ slop (4.8.2)
61
80
  strings (0.1.8)
62
81
  strings-ansi (~> 0.1)
63
82
  unicode-display_width (~> 1.5)
64
83
  unicode_utils (~> 1.4)
65
84
  strings-ansi (0.2.0)
66
- tty-color (0.5.1)
85
+ tty-color (0.5.2)
67
86
  tty-cursor (0.7.1)
68
87
  tty-font (0.5.0)
69
- tty-screen (0.8.0)
88
+ tty-screen (0.8.1)
70
89
  tty-spinner (0.9.3)
71
90
  tty-cursor (~> 0.7)
72
91
  tty-table (0.11.0)
@@ -94,6 +113,7 @@ DEPENDENCIES
94
113
  rake (~> 12.3)
95
114
  rspec (~> 3.0)
96
115
  rspec_junit_formatter (~> 0.4.1)
116
+ rubocop
97
117
  webmock (~> 3.8.3)
98
118
 
99
119
  BUNDLED WITH
data/README.md CHANGED
@@ -135,9 +135,45 @@ Report URL: http://localhost:8070/ui/links/application/testapp/report/0e0f469269
135
135
 
136
136
  ## Development
137
137
 
138
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
138
+ We suggest using [rbenv](https://github.com/rbenv/rbenv) to setup a reliable ruby development environment.
139
139
 
140
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
140
+ Follow the [installation steps](https://github.com/rbenv/rbenv#installation).
141
+ For macos (10.15.7), there was a problem with step 2, with: `$ rbenv init`. The command
142
+ printed suggested editing `~/.bashrc`; however, this did not work in our case (even after an OS reboot),
143
+ and we had to instead edit `~/bash_profile`. To sanity check your installation, you should see the
144
+ `.rbenv` directory early in your PATH, e.g.:
145
+ ```
146
+ $ echo $PATH
147
+ /Users/<username>/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:...
148
+ ```
149
+
150
+ We are using ruby version 2.6.6, but newer versions should also work.
151
+ ```
152
+ rbenv install 2.6.6
153
+ ```
154
+
155
+ Install `bundler`:
156
+ ```
157
+ gem install bundler
158
+ ```
159
+
160
+ Install dependencies:
161
+ ```
162
+ bundle install
163
+ ```
164
+
165
+ Run tests:
166
+ ```
167
+ bundle exec rspec
168
+ ```
169
+
170
+ To install this gem onto your local machine, run `bundle exec rake install`. To manually release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
171
+
172
+ ### Release Process
173
+
174
+ Chelsea is automatically released after a commit to the `master` branch.
175
+
176
+ To avoid performing a release after a commit to the `master` branch, be sure your commit message includes `[skip ci] `.
141
177
 
142
178
  ## Why Chelsea?
143
179
 
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  #
2
4
  # Copyright 2019-Present Sonatype Inc.
3
5
  #
@@ -14,9 +16,9 @@
14
16
  # limitations under the License.
15
17
  #
16
18
 
17
- require "bundler/gem_tasks"
18
- require "rspec/core/rake_task"
19
+ require 'bundler/gem_tasks'
20
+ require 'rspec/core/rake_task'
19
21
 
20
22
  RSpec::Core::RakeTask.new(:spec)
21
23
 
22
- task :default => :spec
24
+ task default: :spec
@@ -0,0 +1,79 @@
1
+ <!--
2
+
3
+ Copyright (c) 2011-present Sonatype, Inc. All rights reserved.
4
+ Includes the third-party code listed at http://links.sonatype.com/products/clm/attributions.
5
+ "Sonatype" is a trademark of Sonatype, Inc.
6
+
7
+ -->
8
+
9
+ # Reporting Security Vulnerabilities
10
+
11
+ ## When to report
12
+
13
+ First check
14
+ [Important advisories of known security vulnerabilities in Sonatype products](https://support.sonatype.com/hc/en-us/sections/203012668-Security-Advisories)
15
+ to see if this has been previously reported.
16
+
17
+ ## How to report
18
+
19
+ Please email reports regarding security related issues you find to [mailto:security@sonatype.com](security@sonatype.com).
20
+
21
+ Use our public key below to keep your message safe.
22
+
23
+ ## What to include
24
+
25
+ Please use a descriptive subject line in your email report.
26
+
27
+ Your name and/or affiliation.
28
+
29
+ A detailed technical description of the vulnerability, attack scenario and where
30
+ possible, how we can reproduce your findings.
31
+
32
+ Provide us with a secure way to respond.
33
+
34
+ ## What to expect
35
+
36
+ Your email will be acknowledged within 1 - 2 business days, and you'll receive a
37
+ more detailed response to your email within 7 business days.
38
+
39
+ We ask that everyone please follow responsible disclosure practices and allow
40
+ time for us to release a fix prior to public release.
41
+
42
+ Once an issue is reported, Sonatype uses the following disclosure process:
43
+
44
+ When a report is received, we confirm the issue and determine its severity.
45
+
46
+ If third-party services or software require mitigation before publication, those
47
+ projects will be notified.
48
+
49
+ ## Our public key
50
+
51
+ ```console
52
+ -----BEGIN PUBLIC KEY BLOCK-----
53
+ mQENBFF+a9ABCADQWSAAU7w9i71Zn3TQ6k7lT9x57cRdtX7V709oeN/c/1it+gCw
54
+ onmmCyf4ypor6XcPSOasp/x0s3hVuf6YfMbI0tSwJUWWihrmoPGIXtmiSOotQE0Q
55
+ Sav41xs3YyI9LzQB4ngZR/nhp4YhioD1dVorD6LGXk08rvl2ikoqHwTagbEXZJY7
56
+ 3VYhW6JHbZTLwCsfyg6uaSYF1qXfUxHPOiHYKNbhK/tM3giX+9ld/7xi+9f4zEFQ
57
+ eX9wcRTdgdDOAqDOK7MV30KXagSqvW0MgEYtKX6q4KjjRzBYjkiTdFW/yMXub/Bs
58
+ 5UckxHTCuAmvpr5J0HIUeLtXi1QCkijyn8HJABEBAAG0KVNvbmF0eXBlIFNlY3Vy
59
+ aXR5IDxzZWN1cml0eUBzb25hdHlwZS5jb20+iQE4BBMBAgAiBQJRfmvQAhsDBgsJ
60
+ CAcDAgYVCAIJCgsEFgIDAQIeAQIXgAAKCRAgkmxsNtgwfUzbCACLtCgieq1kJOqo
61
+ 2i136ND5ZOj31zIzNENLn8dhSg5zQwTHOcntWAtS8uCNq4fSlslwvlbPYWTLD7fE
62
+ iJn1z7BCU8gBk+pkAJJFWEPweMVt+9bYQ4HfKceGbJeuwBBhS34SK9ZIp9gfxxfA
63
+ oTm0aGYwKR5wH3sqL/mrhwKhPt9wXR4qwlE635STEX8wzJ5SBqf3ArJUtCp1rzgR
64
+ Dx+DiZed5HE1pOI2Kyb6O80bm485WThPXxpvp3bfzTNYoGzeLi/F7WkmgggkXxsT
65
+ Pyd0sSx0B/MO4lJtQvEBlIHDFno9mXa30fKl+rzp2geG5UxNHJUjaC5JhfWLEXEX
66
+ wV0ErBsmuQENBFF+a9ABCADXj04+GLIz8VCaZH554nUHEhaKoiIXH3Tj7UiMZDqy
67
+ o4WIw2RFaCQNA8T0R5Q0yxINU146JQMbA2SN59AGcGYZcajyEvTR7tLG0meMO6S0
68
+ JWpkX7s3xaC0s+5SJ/ba00oHGzW0aotgzG9BWA5OniNHK7zZKMVu7M80M/wB1RvK
69
+ x775hAeJ+8F9MDJ+ijydBtaOfDdkbg+0kU1xR6Io+vVLPk38ghlWU8QFP4/B0oWi
70
+ jK4xiDqK6cG7kyH9kC9nau+ckH8MrJ/RzEpsc4GRwqS4IEnvHWe7XbgydWS1bCp6
71
+ 8uP5ma3d02elQmSEa+PABIPKnZcAf1YKLr9O/+IzEdOhABEBAAGJAR8EGAECAAkF
72
+ AlF+a9ACGwwACgkQIJJsbDbYMH3WzAf/XOm4YQZFOgG2h9d03m8me8d1vrYico+0
73
+ pBYU9iCozLgamM4er9Efb+XzfLvNVKuqyR0cgvGszukIPQYeX58DMrZ07C+E0wDZ
74
+ bG+ZAYXT5GqsHkSVnMCVIfyJNLjR4sbVzykyVtnccBL6bP3jxbCP1jJdT7bwiKre
75
+ 1jQjvyoL0yIegdiN/oEdmx52Fqjt4NkQsp4sk625UBFTVISr22bnf60ZIGgrRbAP
76
+ DU1XMdIrmqmhEEQcXMp4CeflDMksOmaIeAUkZY7eddnXMwQDJTnz5ziCal+1r0R3
77
+ dh0XISRG0NkiLEXeGkrs7Sn7BAAsTsaH/1zU6YbvoWlMlHYT6EarFQ== =sFGt
78
+ -----END PUBLIC KEY BLOCK-----
79
+ ```
@@ -16,7 +16,8 @@
16
16
  #
17
17
 
18
18
  # frozen_string_literal: true
19
- require_relative "../lib/chelsea"
19
+
20
+ require_relative '../lib/chelsea'
20
21
  require 'slop'
21
22
  opts =
22
23
  begin
@@ -31,13 +32,19 @@ opts =
31
32
  o.string '-iu', '--iquser', 'Specify the IQ username', default: 'admin'
32
33
  o.string '-it', '--iqpass', 'Specify the IQ auth token', default: 'admin123'
33
34
  o.string '-w', '--whitelist', 'Set path to vulnerability whitelist file'
34
- o.bool '-v', '--verbose', 'For text format, list dependencies, their reverse dependencies (what brought them in to your project), and if they are vulnerable. (default: false)', default: false
35
- o.string '-t', '--format', 'Choose what type of format you want your report in (default: text) (options: text, json, xml)', default: 'text'
35
+ o.bool '-v', '--verbose',
36
+ 'For text format, list dependencies, their reverse dependencies (what brought them in to your project), and
37
+ if they are vulnerable. (default: false)', default: false
38
+ o.string '-t', '--format',
39
+ 'Choose what type of format you want your report in (default: text) (options: text, json, xml)',
40
+ default: 'text'
36
41
  o.bool '-b', '--iq', 'Use Nexus IQ Server to audit your project'
37
- o.string '-s', '--stage', 'Specify Nexus IQ Stage (default: build) (options: develop, build, stage-release, release, operate)', default: 'build'
42
+ o.string '-s', '--stage',
43
+ 'Specify Nexus IQ Stage (default: build) (options: develop, build, stage-release, release, operate)',
44
+ default: 'build'
38
45
  o.on '--version', 'Print the version' do
39
- puts Chelsea::VERSION
40
- exit
46
+ puts Chelsea::VERSION
47
+ exit
41
48
  end
42
49
  o.on '-h', '--help', 'Show usage' do
43
50
  puts(o)
@@ -45,7 +52,7 @@ opts =
45
52
  end
46
53
  end
47
54
  rescue Slop::Error => e
48
- puts(e.message + ' (try --help)')
55
+ puts("#{e.message} (try --help)")
49
56
  exit 1
50
57
  end
51
58
  if opts.arguments.count.positive?
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
2
4
  #
3
5
  # Copyright 2019-Present Sonatype Inc.
4
6
  #
@@ -15,9 +17,8 @@
15
17
  # limitations under the License.
16
18
  #
17
19
 
20
+ require 'bundler/setup'
21
+ require 'chelsea'
18
22
 
19
- require "bundler/setup"
20
- require "chelsea"
21
-
22
- require "irb"
23
+ require 'irb'
23
24
  IRB.start(__FILE__)
@@ -1,42 +1,43 @@
1
+ # frozen_string_literal: true
1
2
 
2
- lib = File.expand_path("../lib", __FILE__)
3
+ lib = File.expand_path('lib', __dir__)
3
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require "chelsea/version"
5
+ require 'chelsea/version'
5
6
 
6
7
  Gem::Specification.new do |spec|
7
- spec.name = "chelsea"
8
- spec.license = "Apache-2.0"
8
+ spec.name = 'chelsea'
9
+ spec.license = 'Apache-2.0'
9
10
  spec.version = Chelsea::VERSION
10
- spec.authors = ["Allister Beharry"]
11
- spec.email = ["allister.beharry@gmail.com"]
11
+ spec.authors = ['Allister Beharry']
12
+ spec.email = ['allister.beharry@gmail.com']
13
+ spec.required_ruby_version = '>= 2.6.6'
12
14
 
13
- spec.summary = "Audit Ruby package dependencies for security vulnerabilities."
14
- spec.homepage = "https://github.com/sonatype-nexus-community/chelsea"
15
-
16
- spec.metadata["homepage_uri"] = spec.homepage
17
- spec.metadata["source_code_uri"] = "https://github.com/sonatype-nexus-community/chelsea"
18
- spec.metadata["changelog_uri"] = "https://github.com/sonatype-nexus-community/chelsea/CHANGELOG"
15
+ spec.summary = 'Audit Ruby package dependencies for security vulnerabilities.'
16
+ spec.homepage = 'https://github.com/sonatype-nexus-community/chelsea'
19
17
 
20
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
18
+ spec.metadata['homepage_uri'] = spec.homepage
19
+ spec.metadata['source_code_uri'] = 'https://github.com/sonatype-nexus-community/chelsea'
20
+ spec.metadata['changelog_uri'] = 'https://github.com/sonatype-nexus-community/chelsea/CHANGELOG'
21
+
22
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
21
23
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
22
24
  end
23
- spec.bindir = "bin"
25
+ spec.bindir = 'bin'
24
26
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
25
- spec.require_paths = ["lib"]
27
+ spec.require_paths = ['lib']
26
28
 
27
- spec.add_dependency "tty-font", "~> 0.5.0"
28
- spec.add_dependency "tty-spinner", "~> 0.9.3"
29
- spec.add_dependency "slop", "~> 4.8.1"
30
- spec.add_dependency "pastel", "~> 0.7.2"
31
- spec.add_dependency "rest-client", "~> 2.0.2"
32
- spec.add_dependency "bundler", ">= 1.2.0", "< 3"
33
- spec.add_dependency "ox", "~> 2.13.2"
34
- spec.add_dependency "tty-table", "~> 0.11.0"
29
+ spec.add_dependency 'bundler', '>= 1.2.0', '< 3'
30
+ spec.add_dependency 'ox', '~> 2.13.2'
31
+ spec.add_dependency 'pastel', '~> 0.7.2'
32
+ spec.add_dependency 'rest-client', '~> 2.0.2'
33
+ spec.add_dependency 'slop', '~> 4.8.1'
34
+ spec.add_dependency 'tty-font', '~> 0.5.0'
35
+ spec.add_dependency 'tty-spinner', '~> 0.9.3'
36
+ spec.add_dependency 'tty-table', '~> 0.11.0'
35
37
 
36
- spec.add_development_dependency "rake", "~> 12.3"
37
- spec.add_development_dependency "rspec", "~> 3.0"
38
- spec.add_development_dependency "rspec_junit_formatter", "~> 0.4.1"
39
- spec.add_development_dependency "webmock", "~> 3.8.3"
40
- spec.add_development_dependency "byebug", "~> 11.1.2"
41
- spec.add_development_dependency 'pry'
38
+ spec.add_development_dependency 'byebug', '~> 11.1.2'
39
+ spec.add_development_dependency 'rake', '~> 12.3'
40
+ spec.add_development_dependency 'rspec', '~> 3.0'
41
+ spec.add_development_dependency 'rspec_junit_formatter', '~> 0.4.1'
42
+ spec.add_development_dependency 'webmock', '~> 3.8.3'
42
43
  end