cfn-model 0.6.6 → 0.6.9

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: 58d4ab0957a1e2ce81106501a32097f6a9dd3a4dba312aa1778437175432ad4c
4
+ data.tar.gz: 0f0150cfeffa848f54692db4f52e4d00375247988ea1d3b0c528846fb93c8db3
5
5
  SHA512:
6
- metadata.gz: 0fdc30f8d26a35eb6a91e2146cf37f5dc2ddd7ef3d7d0abba24010efcde2206d82cdede85fe3e0b3c53eccdfb8562126dc84d17b542b9304eb56919e0e6301e1
7
- data.tar.gz: 4046b076c06c39f0a61b207921b8ce96ecfa519ff5955895bf0f29b5789b07347adebf2c2eb4c12b069672fd2a71ceef98ce87f3e0afb4214836038768bd388a
6
+ metadata.gz: 79e5af6430d20ed12a72280ffa5eaacde89756aaf0c43109731025e6864d76e48fb50f476b0fb6e9b95f180086fd86f1ba36e79e07a6f93fc656eb4274f05e15
7
+ data.tar.gz: 226e8296ea5706ac110a7def4bf7ff1e6db6ba1bba916ba0308736830b107244e457b66d76baf79ed56e9f7ebe2a905448fec7df849f61a1d06c224293efc339
@@ -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, Symbol]
69
69
  end
70
70
 
71
71
  # Transform raw resources in template as performed by
@@ -110,7 +110,7 @@ class CfnParser
110
110
  if condition_values_json.nil?
111
111
  condition_values = {}
112
112
  else
113
- condition_values = JSON.load condition_values_json
113
+ condition_values = JSON.parse condition_values_json
114
114
  end
115
115
 
116
116
  cfn_hash['Conditions'].each do |condition_key, _|
@@ -9,7 +9,7 @@ class ParameterSubstitution
9
9
 
10
10
  def apply_parameter_values(cfn_model, parameter_values_json)
11
11
  unless parameter_values_json.nil?
12
- parameter_values = JSON.load parameter_values_json
12
+ parameter_values = JSON.parse parameter_values_json
13
13
  if is_aws_format?(parameter_values)
14
14
  parameter_values = convert_aws_to_legacy_format(parameter_values)
15
15
  elsif !is_legacy_format?(parameter_values)
@@ -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, Symbol]))
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, Symbol]
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.9
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-06-23 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.9
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.9
199
205
  post_install_message:
200
206
  rdoc_options: []
201
207
  require_paths: