cfn-model 0.6.6 → 0.6.7

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: 696ba992da760c8627ace103dccdce05b2eeec0404cc568ed7086fc74b734a5f
4
- data.tar.gz: 335d86d84e4f2be5249c954392f1bb889fe19fbbe20b48f81261abdc03f5c74f
3
+ metadata.gz: d79c8d1051b8e8c3748f10ac83bc366170edaa401a3f1b7749465a5a2cea116c
4
+ data.tar.gz: 31a167e318084371852f824d4797a5ecb415cabe1aaf9f30dde9bb5259bb4b75
5
5
  SHA512:
6
- metadata.gz: 0fdc30f8d26a35eb6a91e2146cf37f5dc2ddd7ef3d7d0abba24010efcde2206d82cdede85fe3e0b3c53eccdfb8562126dc84d17b542b9304eb56919e0e6301e1
7
- data.tar.gz: 4046b076c06c39f0a61b207921b8ce96ecfa519ff5955895bf0f29b5789b07347adebf2c2eb4c12b069672fd2a71ceef98ce87f3e0afb4214836038768bd388a
6
+ metadata.gz: b03d3df6c11bf67d0e29c0cd12679cbe66c93f7b6fea38e0084a42d62dc628dcf65c91840d889095e08e5a5d724dd3cefc0e47b21c836030971561871c736d5e
7
+ data.tar.gz: 781f07c95fb3ef8c795d1a1a784ead19f6a80835e8422260cb5dc4c6d6f6baded4731e2a0f324ae86864103c54069593b8a65b68f681aa7646b7774733749aa3
@@ -6,7 +6,7 @@ class CfnModel
6
6
  attr_reader :resources, :parameters, :line_numbers, :conditions, :globals, :mappings, :element_types
7
7
 
8
8
  ##
9
- # if you really want it, here it is - the raw Hash from YAML.load. you'll have to mess with structural nits of
9
+ # if you really want it, here it is - the raw Hash from YAML.safe_load. you'll have to mess with structural nits of
10
10
  # CloudFormation and deal with variations between yaml/json refs and all that
11
11
  #
12
12
  attr_accessor :raw_model
@@ -65,7 +65,7 @@ class CfnParser
65
65
  if with_line_numbers
66
66
  parse_with_line_numbers(cloudformation_yml)
67
67
  else
68
- YAML.load cloudformation_yml
68
+ YAML.safe_load cloudformation_yml, permitted_classes: [Date]
69
69
  end
70
70
 
71
71
  # Transform raw resources in template as performed by
@@ -12,7 +12,7 @@ class CloudFormationValidator
12
12
 
13
13
  schema = SchemaGenerator.new.generate cloudformation_string
14
14
  validator = Kwalify::Validator.new(schema)
15
- validator.validate(YAML.load(cloudformation_string))
15
+ validator.validate(YAML.safe_load(cloudformation_string, permitted_classes: [Date]))
16
16
  rescue ArgumentError, IOError, NameError => e
17
17
  raise ParserError, e.inspect
18
18
  end
@@ -5,7 +5,7 @@ require 'cfn-model/parser/parser_error'
5
5
  class ResourceTypeValidator
6
6
 
7
7
  def self.validate(cloudformation_yml)
8
- hash = YAML.load cloudformation_yml
8
+ hash = YAML.safe_load cloudformation_yml, permitted_classes: [Date]
9
9
  if hash == false || hash.nil?
10
10
  raise ParserError.new 'yml empty'
11
11
  end
@@ -19,7 +19,7 @@ class SchemaGenerator
19
19
  parameters_schema = generate_schema_for_parameter_keys cloudformation_hash
20
20
  resources_schema = generate_schema_for_resource_keys cloudformation_hash
21
21
 
22
- main_schema = YAML.load IO.read(schema_file('schema.yml.erb'))
22
+ main_schema = YAML.safe_load IO.read(schema_file('schema.yml.erb'))
23
23
  if parameters_schema.empty?
24
24
  main_schema['mapping'].delete 'Parameters'
25
25
  else
@@ -82,7 +82,7 @@ class SchemaGenerator
82
82
  if !File.exist? schema_file_path
83
83
  nil
84
84
  else
85
- YAML.load IO.read(schema_file_path)
85
+ YAML.safe_load IO.read(schema_file_path)
86
86
  end
87
87
  end
88
88
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cfn-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Kascic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-26 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -84,16 +84,22 @@ dependencies:
84
84
  name: psych
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - "~>"
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '3.1'
90
+ - - "<"
88
91
  - !ruby/object:Gem::Version
89
- version: '3'
92
+ version: '5'
90
93
  type: :runtime
91
94
  prerelease: false
92
95
  version_requirements: !ruby/object:Gem::Requirement
93
96
  requirements:
94
- - - "~>"
97
+ - - ">="
98
+ - !ruby/object:Gem::Version
99
+ version: '3.1'
100
+ - - "<"
95
101
  - !ruby/object:Gem::Version
96
- version: '3'
102
+ version: '5'
97
103
  description: An object model for CloudFormation templates
98
104
  email:
99
105
  executables:
@@ -193,9 +199,9 @@ licenses:
193
199
  metadata:
194
200
  bug_tracker_uri: https://github.com/stelligent/cfn-model/issues
195
201
  changelog_uri: https://github.com/stelligent/cfn-model/releases
196
- documentation_uri: https://www.rubydoc.info/gems/cfn-model/0.6.6
202
+ documentation_uri: https://www.rubydoc.info/gems/cfn-model/0.6.7
197
203
  homepage_uri: https://github.com/stelligent/cfn-model
198
- source_code_uri: https://github.com/stelligent/cfn-model/tree/v0.6.6
204
+ source_code_uri: https://github.com/stelligent/cfn-model/tree/v0.6.7
199
205
  post_install_message:
200
206
  rdoc_options: []
201
207
  require_paths: