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 +4 -4
- data/lib/cfn-model/model/cfn_model.rb +1 -1
- data/lib/cfn-model/parser/cfn_parser.rb +1 -1
- data/lib/cfn-model/validator/cloudformation_validator.rb +1 -1
- data/lib/cfn-model/validator/resource_type_validator.rb +1 -1
- data/lib/cfn-model/validator/schema_generator.rb +2 -2
- metadata +14 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d79c8d1051b8e8c3748f10ac83bc366170edaa401a3f1b7749465a5a2cea116c
|
4
|
+
data.tar.gz: 31a167e318084371852f824d4797a5ecb415cabe1aaf9f30dde9bb5259bb4b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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
|
@@ -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.
|
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.
|
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.
|
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.
|
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.
|
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:
|
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: '
|
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: '
|
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.
|
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.
|
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:
|