inspec 1.25.0 → 1.25.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
  SHA1:
3
- metadata.gz: 5261cd0fb515b9d1f811b7f5f64240bb621a3a45
4
- data.tar.gz: a5db8a92f9fa823f77f3e5606228e24401143d1e
3
+ metadata.gz: 2369b96cee8091a5a6217e02655d0093ecca8a33
4
+ data.tar.gz: 59d26c6a3fb7df21eaa354716c1c1e5e97340038
5
5
  SHA512:
6
- metadata.gz: 6e3be0aa353c6a58aa1be91c5c327c2eba93ce2d634919ebc60ff4252775a308b07c7190a897d82f1c3027baff643e6d558f0f8eb6d880264b8679d67fcc775f
7
- data.tar.gz: e13a9c5266af39ba0ab44b4d64337d798b94f08a1b3b0aafd39625322bf1eeebc3e6ee917e56c1c48e0003750cb019c82b7b76b78d45bbd67cedb5333bf91c34
6
+ metadata.gz: d1ee1b6272be4d4e246318f20aa67a78afc9ed7a0e740ed1dae503110700a0e091aebb32b9c75c6fe3802ae539a99491b415fb1b1179517047223c814d6085cd
7
+ data.tar.gz: 9998bcdc5ec747c15fc2b43cea4ec91b59bf1d158c7a2bf4025865ec90b844c8048a0fa3d8ad01bf6501a3965384e39b906d5200f979a2c5cb6269abdc159523
data/CHANGELOG.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Change Log
2
2
 
3
+ ## [v1.25.1](https://github.com/chef/inspec/tree/v1.25.1) (2017-05-19)
4
+ [Full Changelog](https://github.com/chef/inspec/compare/v1.25.0...v1.25.1)
5
+
6
+ **Implemented enhancements:**
7
+
8
+ - throw an error during inspec check if the version is not correct [\#1832](https://github.com/chef/inspec/pull/1832) ([chris-rock](https://github.com/chris-rock))
9
+
10
+ **Fixed bugs:**
11
+
12
+ - Fixing typo on method name [\#1841](https://github.com/chef/inspec/pull/1841) ([cheeseplus](https://github.com/cheeseplus))
13
+
3
14
  ## [v1.25.0](https://github.com/chef/inspec/tree/v1.25.0) (2017-05-17)
4
15
  [Full Changelog](https://github.com/chef/inspec/compare/v1.24.0...v1.25.0)
5
16
 
@@ -74,14 +85,12 @@
74
85
 
75
86
  - fetch user groups while building user object [\#1681](https://github.com/chef/inspec/pull/1681) ([Happycoil](https://github.com/Happycoil))
76
87
  - update sslshake to v1.2 [\#1680](https://github.com/chef/inspec/pull/1680) ([arlimus](https://github.com/arlimus))
77
- - ER-508 Extended http resource to support no ssl verification [\#1663](https://github.com/chef/inspec/pull/1663) ([ElizabethU](https://github.com/ElizabethU))
78
88
 
79
89
  **Fixed bugs:**
80
90
 
81
91
  - Web references in inspec shell help are wrong [\#1667](https://github.com/chef/inspec/issues/1667)
82
92
  - bugfix: solve warn on uninitialized [\#1694](https://github.com/chef/inspec/pull/1694) ([arlimus](https://github.com/arlimus))
83
93
  - fix web reference url [\#1669](https://github.com/chef/inspec/pull/1669) ([chris-rock](https://github.com/chris-rock))
84
- - Move Habitat sleep time to config file [\#1662](https://github.com/chef/inspec/pull/1662) ([adamleff](https://github.com/adamleff))
85
94
 
86
95
 
87
96
 
data/inspec.gemspec CHANGED
@@ -43,4 +43,5 @@ Gem::Specification.new do |spec|
43
43
  spec.add_dependency 'toml', '~> 0.1'
44
44
  spec.add_dependency 'addressable', '~> 2.4'
45
45
  spec.add_dependency 'parslet', '~> 1.5'
46
+ spec.add_dependency 'semverse'
46
47
  end
@@ -80,9 +80,9 @@ EOF
80
80
 
81
81
  # determine the owner_id and the profile name from the url
82
82
  def compliance_profile_name
83
- m = if Compliance::API.is_automate_server_pre_080(@config)
83
+ m = if Compliance::API.is_automate_server_pre_080?(@config)
84
84
  %r{^#{@config['server']}/(?<owner>[^/]+)/(?<id>[^/]+)/tar$}
85
- elsif Compliance::API.is_automate_server_080_and_later
85
+ elsif Compliance::API.is_automate_server_080_and_later?(@config)
86
86
  %r{^#{@config['server']}/profiles/(?<owner>[^/]+)/(?<id>[^/]+)/tar$}
87
87
  else
88
88
  %r{^#{@config['server']}/owners/(?<owner>[^/]+)/compliance/(?<id>[^/]+)/tar$}
@@ -6,6 +6,7 @@
6
6
  require 'logger'
7
7
  require 'rubygems/version'
8
8
  require 'rubygems/requirement'
9
+ require 'semverse'
9
10
 
10
11
  module Inspec
11
12
  # Extract metadata.rb information
@@ -109,6 +110,12 @@ module Inspec
109
110
  next unless params[field.to_sym].nil?
110
111
  errors.push("Missing profile #{field} in #{ref}")
111
112
  end
113
+
114
+ # if version is set, ensure it is correct
115
+ if !params[:version].nil? && !valid_version?(params[:version])
116
+ errors.push('Version needs to be in SemVer format')
117
+ end
118
+
112
119
  %w{ title summary maintainer copyright }.each do |field|
113
120
  next unless params[field.to_sym].nil?
114
121
  warnings.push("Missing profile #{field} in #{ref}")
@@ -123,6 +130,13 @@ module Inspec
123
130
  errors.empty? && unsupported.empty?
124
131
  end
125
132
 
133
+ def valid_version?(value)
134
+ Semverse::Version.new(value)
135
+ true
136
+ rescue Semverse::InvalidVersionFormat
137
+ false
138
+ end
139
+
126
140
  def method_missing(sth, *args)
127
141
  @logger.warn "#{ref} doesn't support: #{sth} #{args}"
128
142
  @missing_methods.push(sth)
@@ -4,5 +4,5 @@
4
4
  # author: Christoph Hartmann
5
5
 
6
6
  module Inspec
7
- VERSION = '1.25.0'.freeze
7
+ VERSION = '1.25.1'.freeze
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.25.0
4
+ version: 1.25.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dominik Richter
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-17 00:00:00.000000000 Z
11
+ date: 2017-05-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: train
@@ -260,6 +260,20 @@ dependencies:
260
260
  - - "~>"
261
261
  - !ruby/object:Gem::Version
262
262
  version: '1.5'
263
+ - !ruby/object:Gem::Dependency
264
+ name: semverse
265
+ requirement: !ruby/object:Gem::Requirement
266
+ requirements:
267
+ - - ">="
268
+ - !ruby/object:Gem::Version
269
+ version: '0'
270
+ type: :runtime
271
+ prerelease: false
272
+ version_requirements: !ruby/object:Gem::Requirement
273
+ requirements:
274
+ - - ">="
275
+ - !ruby/object:Gem::Version
276
+ version: '0'
263
277
  description: InSpec provides a framework for creating end-to-end infrastructure tests.
264
278
  You can use it for integration or even compliance testing. Create fully portable
265
279
  test profiles and use them in your workflow to ensure stability and security. Integrate