stormbreaker 0.0.0 → 0.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: bd273780abddd41efbfc602152055da5cb92ed5211ac5bfdf0f9b9cbec84b3f7
4
- data.tar.gz: a0d8c935d716fe359089341b91b6d0f8e2542128585248ff286790585ed64a06
3
+ metadata.gz: b7bd034d510483332e5bdb2dcd2e370e83832fe2efd0a898f94ea304e867fae7
4
+ data.tar.gz: c20fc367cab6c4ebc5668821d703fbe7008e58a407104efb260292c5f346c65d
5
5
  SHA512:
6
- metadata.gz: 29d34e7136a40cd9b81c8b0681fd2eeb0eb535da2bd2a986eb56da651afc1f2e3398c49cadd59560f5d02a14587f25d3b6c33a3ffc85e5cfb2988aff30548be4
7
- data.tar.gz: 4dde21786a8e158c6b2851839977126bfd20e78a3213a8862a025bb759761de8c5752b5326658e9ca771e131ac6268468937121f432bf50f2e60c32ee8c1086f
6
+ metadata.gz: 8052bb39b91ea6b40306d0dd8fc8fe95a170bd3c9f76f7820336e4f12c1dbfcd7538e9b59853c562db7b91f31b4d6fbc6a66558608ddb20ee9ec5c3fb90275b9
7
+ data.tar.gz: 583c03ad767c4540116b5f1a3f398655cba597157a421f4355fe069c28e69f98b745b3d3b925ba3fb78581a88b385ca046cba136ab68d9c43841be1fc9b166f3
@@ -1,9 +1,11 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'yaml'
3
+ require 'safe_yaml'
4
4
 
5
5
  module Stormbreaker
6
6
  class AxeResultsSerializer
7
+ ALLOWED_TAGS = ['!ruby/object:Stormbreaker::AxeViolation', '!ruby/object:Set'].freeze
8
+
7
9
  def self.serialize_results(total_violations)
8
10
  dump = YAML.dump(total_violations)
9
11
  prefix = Stormbreaker.configuration.serialize_prefix
@@ -21,11 +23,17 @@ module Stormbreaker
21
23
 
22
24
  combined_manager = Stormbreaker::AxeViolationManager.new
23
25
  results_files.each do |file|
24
- total_violations = YAML.safe_load(File.read(File.join(path, file)), [Stormbreaker::AxeViolation, Set, Symbol])
26
+ # rubocop:disable Security/YAMLLoad
27
+ # Using YAML.load here so that we can specify safe and whitelisted_tags as args in order to not
28
+ # have to patch settings to use safe_load and potentially endanger consuming apps.
29
+ total_violations = YAML.load(File.read(File.join(path, file)),
30
+ safe: true, whitelisted_tags: ALLOWED_TAGS, deserialize_symbols: true)
31
+ # rubocop:enable Security/YAMLLoad
25
32
  total_violations.each do |violation|
26
33
  combined_manager.add_failure_to_total(violation)
27
34
  end
28
35
  end
36
+
29
37
  combined_manager
30
38
  end
31
39
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Stormbreaker
4
- VERSION = '0.0.0'
4
+ VERSION = '0.0.1'
5
5
  end
data/stormbreaker.gemspec CHANGED
@@ -29,6 +29,7 @@ Gem::Specification.new do |gem|
29
29
  gem.add_dependency 'axe-core-rspec', '~> 4.1'
30
30
  gem.add_dependency 'axe-core-selenium', '~> 4.1'
31
31
  gem.add_dependency 'rspec', '~> 3.8'
32
+ gem.add_dependency 'safe_yaml', '~> 1.0.5'
32
33
  gem.add_development_dependency 'bundler', '~> 1.17'
33
34
  gem.add_development_dependency 'nokogiri', '~> 1.11.7'
34
35
  gem.add_development_dependency 'pry', '~> 0.14.1'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stormbreaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0
4
+ version: 0.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Watson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-21 00:00:00.000000000 Z
11
+ date: 2021-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: axe-core-api
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '3.8'
69
+ - !ruby/object:Gem::Dependency
70
+ name: safe_yaml
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: 1.0.5
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: 1.0.5
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: bundler
71
85
  requirement: !ruby/object:Gem::Requirement