puppet-resource_api 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Puppet
4
4
  module ResourceApi
5
- VERSION = '2.0.0'
5
+ VERSION = '2.0.1'
6
6
  end
7
7
  end
@@ -104,9 +104,31 @@ module Puppet::ResourceApi
104
104
  attributes[:title] = @title if attributes[:title].nil? && !type_definition.namevars.empty?
105
105
  end
106
106
 
107
+ attributes[:sensitive_parameters] = sensitives unless sensitives.empty?
107
108
  super
108
109
  end
109
110
 
111
+ # Override finish method to ensure scope tags (like class names) are properly inherited
112
+ # This is called after the resource is added to the catalog and containment is established
113
+ def finish
114
+ super if defined?(super)
115
+ return unless @catalog
116
+
117
+ # Use pathbuilder to tag all containing classes
118
+ # Pathbuilder returns the containment hierarchy; class names appear as plain strings
119
+ # while other resources have the format "Type[title]"
120
+ return unless respond_to?(:pathbuilder)
121
+
122
+ pathbuilder.each do |container|
123
+ next unless container.is_a?(String)
124
+
125
+ # Classes don't contain '[' or ']' characters, resources do
126
+ # Classes: "Test::Modules_11462", "Settings"
127
+ # Resources: "Stage[main]", "Firewall[001 test rule]"
128
+ tag(container) unless container.include?('[')
129
+ end
130
+ end
131
+
110
132
  def name
111
133
  title
112
134
  end
@@ -261,7 +283,6 @@ module Puppet::ResourceApi
261
283
  end
262
284
 
263
285
  fetched.each do |resource_hash|
264
- type_definition.check_schema(resource_hash)
265
286
  rsapi_provider_get_cache.add(build_title(type_definition, resource_hash), resource_hash)
266
287
  end
267
288
 
@@ -279,6 +300,7 @@ module Puppet::ResourceApi
279
300
  provider(type_definition.name)
280
301
 
281
302
  rsapi_provider_get.map do |resource_hash|
303
+ type_definition.check_schema(resource_hash)
282
304
  # allow a :title from the provider to override the default
283
305
  result = if resource_hash.key? :title
284
306
  new(title: resource_hash[:title])
@@ -296,6 +318,7 @@ module Puppet::ResourceApi
296
318
  current_state = self.class.rsapi_provider_get([rsapi_title]).find { |h| namevar_match?(h) }
297
319
 
298
320
  if current_state
321
+ type_definition.check_schema(current_state)
299
322
  strict_check(current_state)
300
323
  else
301
324
  current_state = if rsapi_title.is_a? Hash
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: puppet-resource_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Schmitt
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-03-14 00:00:00.000000000 Z
11
+ date: 2026-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: hocon
@@ -84,7 +84,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
84
84
  - !ruby/object:Gem::Version
85
85
  version: '0'
86
86
  requirements: []
87
- rubygems_version: 3.1.6
87
+ rubygems_version: 3.4.19
88
88
  signing_key:
89
89
  specification_version: 4
90
90
  summary: This library provides a simple way to write new native resources for puppet.