certificate-checker 1.1.0 → 2.0.1

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: eaba1b03f400c3255649451e82bdd578e4ae46c1865c4561d7b33430a2243482
4
- data.tar.gz: 1a6e3b5d31e601d1ae34688a394cf2143e29a3a392927b2221f0f8606a71deb0
3
+ metadata.gz: '07800d1fd5d5d8647f983e7cc26569a06bcdab0fb183bfca4f24fab13a57f235'
4
+ data.tar.gz: 1825883d8a7360acc7af907f9db6bae703db19c403e0a208e0ea6c4607a0df68
5
5
  SHA512:
6
- metadata.gz: f9bb25a04d0dd331b4842dcb261f46e443d491021b05914ca96447e360c10a4f5662876d3d3fa55fe0384f176ffe36b36eb2e4c42e190b8a7e201bffb3f0d8f2
7
- data.tar.gz: ac4c2990000aa01608be8752b69b057a5cbeaa0944fc1c98ff8d02223cb8f7920d8c5ff2c9bab861ce1e022deaeec2d2f3217b8a0d0c9afd34bce3097c5e91cd
6
+ metadata.gz: edea8b4b029b0a76e02a62e66caed0443cd106798268801795d79847142caca70e47d9a96d69e0deac828ad252fdb8c427138eb4e462056a95baf42cd031f63b
7
+ data.tar.gz: 8268100ce7bd3d79d9142282e8a44adbb5ee380850238ff1bb606f8f48bead12b2ff8ff35006ff60fc518e018327a24ec1d42f077b81c89d2a3b1eaf8b503ef5
@@ -0,0 +1,52 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+ branches:
9
+ - main
10
+ schedule:
11
+ - cron: "0 17 * * *"
12
+
13
+ jobs:
14
+ rubocop:
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v2
18
+ - name: Setup ruby
19
+ uses: ruby/setup-ruby@v1
20
+ with:
21
+ ruby-version: 3.0
22
+ bundler-cache: true
23
+ - name: Run static code analysis
24
+ run: bundle exec rubocop
25
+ unit:
26
+ runs-on: ubuntu-latest
27
+ needs: rubocop
28
+ strategy:
29
+ matrix:
30
+ ruby:
31
+ - "2.6"
32
+ - "2.7"
33
+ - "3.0"
34
+ - "3.1"
35
+ name: Ruby ${{ matrix.ruby }}
36
+ steps:
37
+ - uses: actions/checkout@v2
38
+ - name: Setup ruby
39
+ uses: ruby/setup-ruby@v1
40
+ with:
41
+ ruby-version: ${{ matrix.ruby }}
42
+ bundler-cache: true
43
+ - name: Run tests without uploading code coverage
44
+ if: ${{ matrix.ruby != '3.0' }}
45
+ run: bundle exec rake
46
+ - name: Run tests and upload coverage to Code Climate
47
+ if: ${{ matrix.ruby == '3.0' }}
48
+ uses: paambaati/codeclimate-action@v3.0.0
49
+ env:
50
+ CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TOKEN }}
51
+ with:
52
+ coverageCommand: bundle exec rake
data/.rubocop.yml ADDED
@@ -0,0 +1,25 @@
1
+ AllCops:
2
+ AllowSymlinksInCacheRootDirectory: true
3
+
4
+ require:
5
+ - rubocop-rake
6
+ - rubocop-rspec
7
+
8
+ Layout/HashAlignment:
9
+ EnforcedColonStyle: table
10
+ EnforcedHashRocketStyle: table
11
+
12
+ Metrics/LineLength:
13
+ Max: 160
14
+
15
+ Style/Documentation:
16
+ Enabled: false
17
+
18
+ Style/TrailingCommaInArrayLiteral:
19
+ EnforcedStyleForMultiline: comma
20
+
21
+ Style/TrailingCommaInHashLiteral:
22
+ EnforcedStyleForMultiline: comma
23
+
24
+ Style/TrailingCommaInArguments:
25
+ EnforcedStyleForMultiline: comma
data/CHANGELOG.md CHANGED
@@ -2,18 +2,49 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
- ## [1.1.0]
8
+ ## [v2.0.1](https://github.com/smortex/certificate-checker/tree/v2.0.1) (2022-07-16)
9
+
10
+ [Full Changelog](https://github.com/smortex/certificate-checker/compare/v2.0.0...v2.0.1)
11
+
12
+ **Fixed bugs:**
13
+
14
+ - Fix command invocation from outside bundler [\#4](https://github.com/smortex/certificate-checker/pull/4) ([smortex](https://github.com/smortex))
15
+
16
+ ## [v2.0.0](https://github.com/smortex/certificate-checker/tree/v2.0.0) (2022-07-16)
17
+
18
+ [Full Changelog](https://github.com/smortex/certificate-checker/compare/v1.2.0...v2.0.0)
19
+
20
+ **Breaking changes:**
21
+
22
+ - Bump internet\_security\_event dependency [\#1](https://github.com/smortex/certificate-checker/pull/1) ([smortex](https://github.com/smortex))
23
+
24
+ **Merged pull requests:**
25
+
26
+ - Integrate github\_changelog\_generator [\#2](https://github.com/smortex/certificate-checker/pull/2) ([smortex](https://github.com/smortex))
27
+
28
+ ## [v1.2.0]
29
+ ### Added
30
+
31
+ - Add `--ignore-nonexistent` argument to not emit diagnostic message when the
32
+ passed filename does not exist.
33
+
34
+ ## [v1.1.0]
35
+ ### Changed
9
36
 
10
37
  - Use certificate issuer and subject rather than file line to identify a
11
38
  certificate in a certificate file.
12
39
 
13
- ## [1.0.1]
40
+ ## [v1.0.1]
41
+ ### Fixed
14
42
 
15
43
  - Fix on Debian Stretch.
16
44
 
17
- [Unreleased]: https://github.com/smortex/tls-checker/compare/v1.1.0...HEAD
18
- [1.1.0]: https://github.com/smortex/tls-checker/compare/v1.0.1...v1.1.0
19
- [1.0.1]: https://github.com/smortex/tls-checker/compare/v1.0.0...v1.0.1
45
+ [v1.2.0]: https://github.com/smortex/tls-checker/compare/v1.1.0...v1.2.0
46
+ [v1.1.0]: https://github.com/smortex/tls-checker/compare/v1.0.1...v1.1.0
47
+ [v1.0.1]: https://github.com/smortex/tls-checker/compare/v1.0.0...v1.0.1
48
+
49
+
50
+ \* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
data/Gemfile CHANGED
@@ -2,19 +2,5 @@
2
2
 
3
3
  source 'https://rubygems.org'
4
4
 
5
- git_source(:github) { |repo_name| "https://github.com/#{repo_name}" }
6
-
7
5
  # Specify your gem's dependencies in certificate-checker.gemspec
8
6
  gemspec
9
-
10
- # rubocop:disable Security/Eval
11
- #
12
- # Gemfile.local is ignored in .gitignore. When hacking this gem, it might be
13
- # useful to use a pre-release version of some dependency, in this case add them
14
- # to Gemfile.local:
15
- #
16
- # ------------------------------------- 8< -------------------------------------
17
- # gem 'internet_security_event', path: '../internet_security_event'
18
- # ------------------------------------- 8< -------------------------------------
19
- eval(File.read('Gemfile.local'), binding) if File.exist? 'Gemfile.local'
20
- # rubocop:enable Security/Eval
data/HISTORY.md ADDED
@@ -0,0 +1,20 @@
1
+ ## [v1.2.0]
2
+ ### Added
3
+
4
+ - Add `--ignore-nonexistent` argument to not emit diagnostic message when the
5
+ passed filename does not exist.
6
+
7
+ ## [v1.1.0]
8
+ ### Changed
9
+
10
+ - Use certificate issuer and subject rather than file line to identify a
11
+ certificate in a certificate file.
12
+
13
+ ## [v1.0.1]
14
+ ### Fixed
15
+
16
+ - Fix on Debian Stretch.
17
+
18
+ [v1.2.0]: https://github.com/smortex/tls-checker/compare/v1.1.0...v1.2.0
19
+ [v1.1.0]: https://github.com/smortex/tls-checker/compare/v1.0.1...v1.1.0
20
+ [v1.0.1]: https://github.com/smortex/tls-checker/compare/v1.0.0...v1.0.1
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # certificate-checker
2
2
 
3
- [![Build Status](https://travis-ci.com/smortex/certificate-checker.svg?branch=master)](https://travis-ci.com/smortex/certificate-checker)
3
+ [![Build Status](https://github.com/smortex/certificate-checker/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/smortex/certificate-checker/actions/workflows/ci.yml)
4
4
  [![Maintainability](https://api.codeclimate.com/v1/badges/183f536f05771eca87f2/maintainability)](https://codeclimate.com/github/smortex/certificate-checker/maintainability)
5
5
  [![Test Coverage](https://api.codeclimate.com/v1/badges/183f536f05771eca87f2/test_coverage)](https://codeclimate.com/github/smortex/certificate-checker/test_coverage)
6
6
 
@@ -54,4 +54,4 @@ License](https://opensource.org/licenses/MIT).
54
54
 
55
55
  Everyone interacting in the certificate-checker project’s codebases, issue
56
56
  trackers, chat rooms and mailing lists is expected to follow the [code of
57
- conduct](https://github.com/smortex/certificate-checker/blob/master/CODE_OF_CONDUCT.md).
57
+ conduct](https://github.com/smortex/certificate-checker/blob/main/CODE_OF_CONDUCT.md).
data/Rakefile CHANGED
@@ -1,8 +1,27 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'bundler/gem_tasks'
4
+ require 'github_changelog_generator/task'
4
5
  require 'rspec/core/rake_task'
5
6
 
6
7
  RSpec::Core::RakeTask.new(:spec)
7
8
 
9
+ GitHubChangelogGenerator::RakeTask.new :changelog do |config|
10
+ config.header = <<~HEADER.chomp
11
+ # Changelog
12
+
13
+ All notable changes to this project will be documented in this file.
14
+
15
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
16
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
17
+ HEADER
18
+ config.exclude_labels = %w[duplicate question invalid wontfix wont-fix skip-changelog ignore]
19
+ config.user = 'smortex'
20
+ config.project = 'certificate-checker'
21
+ config.since_tag = 'v1.2.0'
22
+ config.issues = false
23
+ require 'certificate_checker/version'
24
+ config.future_release = "v#{CertificateChecker::VERSION}"
25
+ end
26
+
8
27
  task default: :spec
@@ -2,7 +2,7 @@
2
2
 
3
3
  lib = File.expand_path('lib', __dir__)
4
4
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
- require 'certificate-checker/version'
5
+ require 'certificate_checker/version'
6
6
 
7
7
  Gem::Specification.new do |spec|
8
8
  spec.name = 'certificate-checker'
@@ -13,20 +13,25 @@ Gem::Specification.new do |spec|
13
13
  spec.summary = 'Report expired/about to expires certificates in a directory tree.'
14
14
  spec.homepage = 'https://github.com/smortex/certificate-checker'
15
15
  spec.license = 'MIT'
16
+ spec.required_ruby_version = Gem::Requirement.new('>= 2.6.0')
16
17
 
17
18
  # Specify which files should be added to the gem when it is released.
18
19
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
19
- spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
20
21
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
21
22
  end
22
23
  spec.bindir = 'exe'
23
24
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
24
25
  spec.require_paths = ['lib']
25
26
 
26
- spec.add_dependency 'internet_security_event', '~> 1.0'
27
+ spec.add_dependency 'internet_security_event', '~> 2.0'
27
28
 
28
- spec.add_development_dependency 'bundler', '~> 1.6'
29
+ spec.add_development_dependency 'bundler'
30
+ spec.add_development_dependency 'github_changelog_generator'
29
31
  spec.add_development_dependency 'rake'
30
32
  spec.add_development_dependency 'rspec'
33
+ spec.add_development_dependency 'rubocop'
34
+ spec.add_development_dependency 'rubocop-rake'
35
+ spec.add_development_dependency 'rubocop-rspec'
31
36
  spec.add_development_dependency 'simplecov'
32
37
  end
@@ -3,9 +3,7 @@
3
3
 
4
4
  require 'json'
5
5
  require 'optparse'
6
- require 'certificate-checker'
7
-
8
- factory = CertificateChecker::CertificateCheckerFactory.new
6
+ require 'certificate_checker'
9
7
 
10
8
  options = {
11
9
  output: $stdout,
@@ -13,12 +11,19 @@ options = {
13
11
 
14
12
  OptionParser.new do |opts|
15
13
  opts.banner = 'Usage: tls-checker [options] specification...'
14
+ opts.version = CertificateChecker::VERSION
16
15
 
17
16
  opts.on('-o', '--output=FILE', 'Write to FILE') do |f|
18
17
  options[:output] = File.open(f, File::CREAT | File::APPEND | File::LOCK_EX)
19
18
  end
19
+
20
+ opts.on('--[no-]ignore-nonexistent', 'Ignore nonexistent files and arguments') do |v|
21
+ options[:ignore_nonexistent] = v
22
+ end
20
23
  end.parse!
21
24
 
25
+ factory = CertificateChecker::CertificateCheckerFactory.new(options)
26
+
22
27
  ARGV.each do |arg|
23
28
  factory.certificate_checkers_for(arg).each do |checker|
24
29
  options[:output].puts checker.to_e.to_json
@@ -2,8 +2,8 @@
2
2
 
3
3
  module CertificateChecker
4
4
  class CertificateCheckerFactory
5
- def initialize
6
- @finder = CertificateFinder.new
5
+ def initialize(config = {})
6
+ @finder = CertificateFinder.new(config)
7
7
  end
8
8
 
9
9
  def certificate_checkers_for(filename)
@@ -12,7 +12,7 @@ module CertificateChecker
12
12
  elsif File.exist?(path)
13
13
  search_file(path)
14
14
  else
15
- warn "No such file or directory @ #{self.class.name}##{__callee__} - #{path}"
15
+ warn "No such file or directory @ #{self.class.name}##{__callee__} - #{path}" unless @config[:ignore_nonexistent]
16
16
  []
17
17
  end
18
18
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CertificateChecker
4
- VERSION = '1.1.0'
4
+ VERSION = '2.0.1'
5
5
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'certificate_checker/certificate_checker'
4
+ require 'certificate_checker/certificate_checker_factory'
5
+ require 'certificate_checker/certificate_finder'
6
+ require 'certificate_checker/certificate_parser'
7
+ require 'certificate_checker/version'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: certificate-checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Romain Tartière
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-04 00:00:00.000000000 Z
11
+ date: 2022-07-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: internet_security_event
@@ -16,28 +16,42 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.0'
19
+ version: '2.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.0'
26
+ version: '2.0'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - "~>"
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
- version: '1.6'
33
+ version: '0'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - "~>"
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: github_changelog_generator
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
39
53
  - !ruby/object:Gem::Version
40
- version: '1.6'
54
+ version: '0'
41
55
  - !ruby/object:Gem::Dependency
42
56
  name: rake
43
57
  requirement: !ruby/object:Gem::Requirement
@@ -66,6 +80,48 @@ dependencies:
66
80
  - - ">="
67
81
  - !ruby/object:Gem::Version
68
82
  version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rubocop
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rubocop-rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
69
125
  - !ruby/object:Gem::Dependency
70
126
  name: simplecov
71
127
  requirement: !ruby/object:Gem::Requirement
@@ -80,7 +136,7 @@ dependencies:
80
136
  - - ">="
81
137
  - !ruby/object:Gem::Version
82
138
  version: '0'
83
- description:
139
+ description:
84
140
  email:
85
141
  - romain@blogreen.org
86
142
  executables:
@@ -88,12 +144,15 @@ executables:
88
144
  extensions: []
89
145
  extra_rdoc_files: []
90
146
  files:
147
+ - ".github/workflows/ci.yml"
91
148
  - ".gitignore"
92
149
  - ".rspec"
150
+ - ".rubocop.yml"
93
151
  - ".travis.yml"
94
152
  - CHANGELOG.md
95
153
  - CODE_OF_CONDUCT.md
96
154
  - Gemfile
155
+ - HISTORY.md
97
156
  - LICENSE.txt
98
157
  - README.md
99
158
  - Rakefile
@@ -101,17 +160,17 @@ files:
101
160
  - bin/setup
102
161
  - certificate-checker.gemspec
103
162
  - exe/certificate-checker
104
- - lib/certificate-checker.rb
105
- - lib/certificate-checker/certificate_checker.rb
106
- - lib/certificate-checker/certificate_checker_factory.rb
107
- - lib/certificate-checker/certificate_finder.rb
108
- - lib/certificate-checker/certificate_parser.rb
109
- - lib/certificate-checker/version.rb
163
+ - lib/certificate_checker.rb
164
+ - lib/certificate_checker/certificate_checker.rb
165
+ - lib/certificate_checker/certificate_checker_factory.rb
166
+ - lib/certificate_checker/certificate_finder.rb
167
+ - lib/certificate_checker/certificate_parser.rb
168
+ - lib/certificate_checker/version.rb
110
169
  homepage: https://github.com/smortex/certificate-checker
111
170
  licenses:
112
171
  - MIT
113
172
  metadata: {}
114
- post_install_message:
173
+ post_install_message:
115
174
  rdoc_options: []
116
175
  require_paths:
117
176
  - lib
@@ -119,15 +178,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
178
  requirements:
120
179
  - - ">="
121
180
  - !ruby/object:Gem::Version
122
- version: '0'
181
+ version: 2.6.0
123
182
  required_rubygems_version: !ruby/object:Gem::Requirement
124
183
  requirements:
125
184
  - - ">="
126
185
  - !ruby/object:Gem::Version
127
186
  version: '0'
128
187
  requirements: []
129
- rubygems_version: 3.0.2
130
- signing_key:
188
+ rubygems_version: 3.3.17
189
+ signing_key:
131
190
  specification_version: 4
132
191
  summary: Report expired/about to expires certificates in a directory tree.
133
192
  test_files: []
@@ -1,6 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'certificate-checker/certificate_checker'
4
- require 'certificate-checker/certificate_checker_factory'
5
- require 'certificate-checker/certificate_finder'
6
- require 'certificate-checker/certificate_parser'