firespring_dev_commands 2.1.15 → 2.1.16.pre.alpha.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f810b97efdfffe33d29fc32b31c63e59e988e4c7b11e82d68a4cd6e85262a7b0
|
4
|
+
data.tar.gz: 965832c284d5276501f658c5a0d7d70c6a4b4f88ef84c834011bc4b6bdb1cd6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea9ffaa8921ed4c75f1e0c3c9262167fa45faa382d0d9074c22d4aa6a4318856dc380a7f23f5ce2b09e5a20197af193e587f102ded1bc09447c81c6a87aac092
|
7
|
+
data.tar.gz: ad5e684614fb9bcadba6a6a975712bf1a6ccd4d27687cb3e1288fd8efc34bea5cb1285c4da47b12f7a72f1eb283bb71f0e6bbae604ae071bb7d3d0eadbac9b69
|
@@ -3,11 +3,12 @@ module Dev
|
|
3
3
|
class Audit
|
4
4
|
# The class containing standardized information about an audit report
|
5
5
|
class Report
|
6
|
-
attr_accessor :items, :min_severity, :ignorelist, :filtered_items
|
6
|
+
attr_accessor :items, :min_severity, :error_on_unknown, :ignorelist, :filtered_items
|
7
7
|
|
8
8
|
def initialize(
|
9
9
|
items,
|
10
10
|
min_severity: ENV.fetch('MIN_SEVERITY', nil),
|
11
|
+
error_on_unknown: ENV.fetch('ERROR_ON_UNKNOWN', nil),
|
11
12
|
ignorelist: ENV['IGNORELIST'].to_s.split(/\s*,\s*/)
|
12
13
|
)
|
13
14
|
# Items should be an array of Item objects
|
@@ -15,12 +16,18 @@ module Dev
|
|
15
16
|
raise 'items must all be report items' unless @items.all?(Dev::Audit::Report::Item)
|
16
17
|
|
17
18
|
@min_severity = min_severity || Level::HIGH
|
19
|
+
@error_on_unknown = error_on_unknown
|
18
20
|
@ignorelist = Array(ignorelist).compact
|
19
21
|
end
|
20
22
|
|
21
23
|
# Get all severities greater than or equal to the minimum severity
|
22
24
|
def desired_severities
|
23
|
-
|
25
|
+
max_severity = if error_on_unknown.to_s.strip == 'true'
|
26
|
+
-1
|
27
|
+
else
|
28
|
+
-2
|
29
|
+
end
|
30
|
+
LEVELS.slice(LEVELS.find_index(min_severity)..max_severity)
|
24
31
|
end
|
25
32
|
|
26
33
|
# Run the filters against the report items and filter out any which should be excluded
|
@@ -72,7 +72,6 @@ module Dev
|
|
72
72
|
# - If a token is found in the ENV, use it
|
73
73
|
# - Otherwise, use the username and passowrd that has been configured to request a new token from bloom
|
74
74
|
def token
|
75
|
-
# TODO: Should we look at https://github.com/DannyBen/lightly for caching the token?
|
76
75
|
@token ||= ENV.fetch(BLOOM_TOKEN, nil)
|
77
76
|
|
78
77
|
unless @token
|
@@ -88,7 +87,8 @@ module Dev
|
|
88
87
|
'accept' => 'application/json'
|
89
88
|
}
|
90
89
|
)
|
91
|
-
|
90
|
+
# TODO: Should we look at https://github.com/DannyBen/lightly for caching the token?
|
91
|
+
@token = ENV[BLOOM_TOKEN] = response['access_token']
|
92
92
|
LOG.info("Retrieved BloomGrowth token. Expires on #{Time.now + response['expires_in']}")
|
93
93
|
end
|
94
94
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: firespring_dev_commands
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.16.pre.alpha.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Firespring
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -403,9 +403,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
403
403
|
version: '3.1'
|
404
404
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
405
405
|
requirements:
|
406
|
-
- - "
|
406
|
+
- - ">"
|
407
407
|
- !ruby/object:Gem::Version
|
408
|
-
version:
|
408
|
+
version: 1.3.1
|
409
409
|
requirements: []
|
410
410
|
rubygems_version: 3.4.10
|
411
411
|
signing_key:
|