puppet 7.26.0-x64-mingw32 → 7.28.0-x64-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/Gemfile.lock +34 -33
- data/Rakefile +0 -27
- data/examples/enc/regexp_nodes/regexp_nodes.rb +1 -1
- data/ext/project_data.yaml +2 -2
- data/lib/puppet/application/ssl.rb +42 -7
- data/lib/puppet/application.rb +5 -1
- data/lib/puppet/configurer.rb +1 -1
- data/lib/puppet/file_system/file_impl.rb +1 -1
- data/lib/puppet/file_system/posix.rb +1 -1
- data/lib/puppet/functions/split.rb +28 -1
- data/lib/puppet/functions/versioncmp.rb +1 -1
- data/lib/puppet/http/service/compiler.rb +4 -0
- data/lib/puppet/indirector/catalog/compiler.rb +12 -4
- data/lib/puppet/indirector/catalog/rest.rb +8 -0
- data/lib/puppet/interface/action.rb +4 -2
- data/lib/puppet/interface/action_builder.rb +4 -9
- data/lib/puppet/node/environment.rb +6 -4
- data/lib/puppet/pops/loader/ruby_data_type_instantiator.rb +1 -1
- data/lib/puppet/pops/loader/ruby_function_instantiator.rb +1 -1
- data/lib/puppet/pops/loader/ruby_legacy_function_instantiator.rb +1 -1
- data/lib/puppet/pops/time/timespan.rb +1 -1
- data/lib/puppet/provider/package/appdmg.rb +1 -1
- data/lib/puppet/provider/package/apt.rb +1 -1
- data/lib/puppet/provider/package/dnf.rb +2 -1
- data/lib/puppet/provider/package/dnfmodule.rb +1 -1
- data/lib/puppet/provider/package/windows/package.rb +2 -2
- data/lib/puppet/provider/package/yum.rb +2 -2
- data/lib/puppet/provider/service/init.rb +2 -5
- data/lib/puppet/provider/service/systemd.rb +4 -3
- data/lib/puppet/settings.rb +16 -2
- data/lib/puppet/ssl/ssl_context.rb +10 -15
- data/lib/puppet/type/component.rb +1 -1
- data/lib/puppet/type/exec.rb +15 -7
- data/lib/puppet/type/resources.rb +1 -0
- data/lib/puppet/util/command_line/trollop.rb +1 -1
- data/lib/puppet/util/execution.rb +9 -3
- data/lib/puppet/util/package/version/pip.rb +2 -2
- data/lib/puppet/util/windows/adsi.rb +7 -0
- data/lib/puppet/util/windows/sid.rb +4 -2
- data/lib/puppet/version.rb +1 -1
- data/lib/puppet/x509/cert_provider.rb +6 -2
- data/man/man5/puppet.conf.5 +2 -2
- data/man/man8/puppet-agent.8 +1 -1
- data/man/man8/puppet-apply.8 +1 -1
- data/man/man8/puppet-catalog.8 +1 -1
- data/man/man8/puppet-config.8 +1 -1
- data/man/man8/puppet-describe.8 +1 -1
- data/man/man8/puppet-device.8 +1 -1
- data/man/man8/puppet-doc.8 +1 -1
- data/man/man8/puppet-epp.8 +1 -1
- data/man/man8/puppet-facts.8 +1 -1
- data/man/man8/puppet-filebucket.8 +1 -1
- data/man/man8/puppet-generate.8 +1 -1
- data/man/man8/puppet-help.8 +1 -1
- data/man/man8/puppet-lookup.8 +1 -1
- data/man/man8/puppet-module.8 +1 -1
- data/man/man8/puppet-node.8 +1 -1
- data/man/man8/puppet-parser.8 +1 -1
- data/man/man8/puppet-plugin.8 +1 -1
- data/man/man8/puppet-report.8 +1 -1
- data/man/man8/puppet-resource.8 +1 -1
- data/man/man8/puppet-script.8 +1 -1
- data/man/man8/puppet-ssl.8 +5 -1
- data/man/man8/puppet.8 +2 -2
- data/spec/integration/application/agent_spec.rb +13 -0
- data/spec/integration/type/exec_spec.rb +13 -0
- data/spec/lib/puppet_spec/puppetserver.rb +1 -0
- data/spec/unit/application/ssl_spec.rb +49 -0
- data/spec/unit/file_system/path_pattern_spec.rb +15 -0
- data/spec/unit/functions/split_spec.rb +6 -0
- data/spec/unit/indirector/catalog/compiler_spec.rb +17 -0
- data/spec/unit/indirector/catalog/rest_spec.rb +17 -0
- data/spec/unit/provider/package/appdmg_spec.rb +1 -1
- data/spec/unit/provider/package/dnf_spec.rb +7 -0
- data/spec/unit/provider/package/dnfmodule_spec.rb +22 -2
- data/spec/unit/provider/service/systemd_spec.rb +8 -6
- data/spec/unit/ssl/certificate_signer_spec.rb +17 -0
- data/spec/unit/ssl/ssl_provider_spec.rb +2 -2
- data/spec/unit/type/exec_spec.rb +13 -0
- data/spec/unit/util/execution_spec.rb +1 -0
- data/spec/unit/util/windows/adsi_spec.rb +25 -0
- metadata +9 -13
@@ -171,6 +171,50 @@ describe Puppet::Application::Ssl, unless: Puppet::Util::Platform.jruby? do
|
|
171
171
|
end
|
172
172
|
end
|
173
173
|
|
174
|
+
context 'when generating a CSR' do
|
175
|
+
let(:csr_path) { Puppet[:hostcsr] }
|
176
|
+
let(:requestdir) { Puppet[:requestdir] }
|
177
|
+
|
178
|
+
before do
|
179
|
+
ssl.command_line.args << 'generate_request'
|
180
|
+
end
|
181
|
+
|
182
|
+
it 'generates an RSA private key' do
|
183
|
+
File.unlink(Puppet[:hostprivkey])
|
184
|
+
|
185
|
+
expects_command_to_pass(%r{Generated certificate request in '#{csr_path}'})
|
186
|
+
end
|
187
|
+
|
188
|
+
it 'generates an EC private key' do
|
189
|
+
Puppet[:key_type] = 'ec'
|
190
|
+
File.unlink(Puppet[:hostprivkey])
|
191
|
+
|
192
|
+
expects_command_to_pass(%r{Generated certificate request in '#{csr_path}'})
|
193
|
+
end
|
194
|
+
|
195
|
+
it 'registers OIDs' do
|
196
|
+
expect(Puppet::SSL::Oids).to receive(:register_puppet_oids)
|
197
|
+
|
198
|
+
expects_command_to_pass(%r{Generated certificate request in '#{csr_path}'})
|
199
|
+
end
|
200
|
+
|
201
|
+
it 'saves the CSR locally' do
|
202
|
+
expects_command_to_pass(%r{Generated certificate request in '#{csr_path}'})
|
203
|
+
|
204
|
+
expect(Puppet::FileSystem).to be_exist(csr_path)
|
205
|
+
end
|
206
|
+
|
207
|
+
it 'accepts dns alt names' do
|
208
|
+
Puppet[:dns_alt_names] = 'majortom'
|
209
|
+
|
210
|
+
expects_command_to_pass
|
211
|
+
|
212
|
+
csr = Puppet::SSL::CertificateRequest.new(name)
|
213
|
+
csr.read(csr_path)
|
214
|
+
expect(csr.subject_alt_names).to include('DNS:majortom')
|
215
|
+
end
|
216
|
+
end
|
217
|
+
|
174
218
|
context 'when downloading a certificate' do
|
175
219
|
before do
|
176
220
|
ssl.command_line.args << 'download_cert'
|
@@ -347,6 +391,11 @@ describe Puppet::Application::Ssl, unless: Puppet::Util::Platform.jruby? do
|
|
347
391
|
expects_command_to_fail(%r{Failed to connect to the CA to determine if certificate #{name} has been cleaned})
|
348
392
|
end
|
349
393
|
|
394
|
+
it 'raises if we have extra args' do
|
395
|
+
ssl.command_line.args << 'hostname.example.biz'
|
396
|
+
expects_command_to_fail(/Extra arguments detected: hostname.example.biz/)
|
397
|
+
end
|
398
|
+
|
350
399
|
context 'when deleting local CA' do
|
351
400
|
before do
|
352
401
|
ssl.command_line.args << '--localca'
|
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
require 'puppet_spec/files'
|
3
3
|
require 'puppet/file_system'
|
4
|
+
require 'puppet/util'
|
4
5
|
|
5
6
|
describe Puppet::FileSystem::PathPattern do
|
6
7
|
include PuppetSpec::Files
|
@@ -132,6 +133,20 @@ describe Puppet::FileSystem::PathPattern do
|
|
132
133
|
File.join(dir, "found_two")])
|
133
134
|
end
|
134
135
|
|
136
|
+
it 'globs wildcard patterns properly' do
|
137
|
+
# See PUP-11788 and https://github.com/jruby/jruby/issues/7836.
|
138
|
+
pending 'JRuby does not properly handle Dir.glob' if Puppet::Util::Platform.jruby?
|
139
|
+
|
140
|
+
dir = tmpdir('globtest')
|
141
|
+
create_file_in(dir, 'foo.pp')
|
142
|
+
create_file_in(dir, 'foo.pp.pp')
|
143
|
+
|
144
|
+
pattern = Puppet::FileSystem::PathPattern.absolute(File.join(dir, '**/*.pp'))
|
145
|
+
|
146
|
+
expect(pattern.glob).to match_array([File.join(dir, 'foo.pp'),
|
147
|
+
File.join(dir, 'foo.pp.pp')])
|
148
|
+
end
|
149
|
+
|
135
150
|
def create_file_in(dir, name)
|
136
151
|
File.open(File.join(dir, name), "w") { |f| f.puts "data" }
|
137
152
|
end
|
@@ -50,4 +50,10 @@ describe 'the split function' do
|
|
50
50
|
it 'should handle pattern in Regexp Type form with missing regular expression' do
|
51
51
|
expect(split('ab',type_parser.parse('Regexp'))).to eql(['a', 'b'])
|
52
52
|
end
|
53
|
+
|
54
|
+
it 'should handle sensitive String' do
|
55
|
+
expect(split(Puppet::Pops::Types::PSensitiveType::Sensitive.new('a,b'), ',')).to be_a(Puppet::Pops::Types::PSensitiveType::Sensitive)
|
56
|
+
expect(split(Puppet::Pops::Types::PSensitiveType::Sensitive.new('a,b'), /,/)).to be_a(Puppet::Pops::Types::PSensitiveType::Sensitive)
|
57
|
+
expect(split(Puppet::Pops::Types::PSensitiveType::Sensitive.new('a,b'), type_parser.parse('Regexp[/,/]'))).to be_a(Puppet::Pops::Types::PSensitiveType::Sensitive)
|
58
|
+
end
|
53
59
|
end
|
@@ -271,6 +271,23 @@ describe Puppet::Resource::Catalog::Compiler do
|
|
271
271
|
expect(catalog).to have_resource('Stage[main]')
|
272
272
|
end
|
273
273
|
|
274
|
+
# versioned environment directories can cause this
|
275
|
+
it 'allows environments with the same name but mismatched modulepaths' do
|
276
|
+
envs = Puppet.lookup(:environments)
|
277
|
+
env_server = envs.get!(:env_server)
|
278
|
+
v1_env = env_server.override_with({ modulepath: ['/code-v1/env-v1/'] })
|
279
|
+
v2_env = env_server.override_with({ modulepath: ['/code-v2/env-v2/'] })
|
280
|
+
|
281
|
+
@request.options[:check_environment] = "true"
|
282
|
+
@request.environment = v1_env
|
283
|
+
node.environment = v2_env
|
284
|
+
|
285
|
+
catalog = compiler.find(@request)
|
286
|
+
|
287
|
+
expect(catalog.environment).to eq('env_server')
|
288
|
+
expect(catalog).to have_resource('Stage[main]')
|
289
|
+
end
|
290
|
+
|
274
291
|
it 'returns an empty catalog if asked to check the environment and they are mismatched' do
|
275
292
|
@request.options[:check_environment] = "true"
|
276
293
|
catalog = compiler.find(@request)
|
@@ -25,6 +25,23 @@ describe Puppet::Resource::Catalog::Rest do
|
|
25
25
|
expect(described_class.indirection.find(certname)).to be_a(Puppet::Resource::Catalog)
|
26
26
|
end
|
27
27
|
|
28
|
+
it 'logs a notice when requesting a catalog' do
|
29
|
+
expect(Puppet).to receive(:notice).with("Requesting catalog from compiler.example.com:8140")
|
30
|
+
|
31
|
+
stub_request(:post, uri).to_return(**catalog_response(catalog))
|
32
|
+
|
33
|
+
described_class.indirection.find(certname)
|
34
|
+
end
|
35
|
+
|
36
|
+
it 'logs a notice when the IP address is resolvable when requesting a catalog' do
|
37
|
+
allow(Resolv).to receive_message_chain(:getaddress).and_return('192.0.2.0')
|
38
|
+
expect(Puppet).to receive(:notice).with("Requesting catalog from compiler.example.com:8140 (192.0.2.0)")
|
39
|
+
|
40
|
+
stub_request(:post, uri).to_return(**catalog_response(catalog))
|
41
|
+
|
42
|
+
described_class.indirection.find(certname)
|
43
|
+
end
|
44
|
+
|
28
45
|
it "serializes the environment" do
|
29
46
|
stub_request(:post, uri)
|
30
47
|
.with(query: hash_including('environment' => 'outerspace'))
|
@@ -11,7 +11,7 @@ describe Puppet::Type.type(:package).provider(:appdmg) do
|
|
11
11
|
before do
|
12
12
|
fh = double('filehandle', path: '/tmp/foo')
|
13
13
|
resource[:source] = "foo.dmg"
|
14
|
-
allow(
|
14
|
+
allow(File).to receive(:open).and_yield(fh)
|
15
15
|
allow(Dir).to receive(:mktmpdir).and_return("/tmp/testtmp123")
|
16
16
|
allow(FileUtils).to receive(:remove_entry_secure)
|
17
17
|
end
|
@@ -42,6 +42,13 @@ describe Puppet::Type.type(:package).provider(:dnf) do
|
|
42
42
|
allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("8")
|
43
43
|
expect(described_class).to be_default
|
44
44
|
end
|
45
|
+
|
46
|
+
it "should be the default provider on Amazon Linux 2023" do
|
47
|
+
allow(Facter).to receive(:value).with(:osfamily).and_return(:redhat)
|
48
|
+
allow(Facter).to receive(:value).with(:operatingsystem).and_return(:amazon)
|
49
|
+
allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("2023")
|
50
|
+
expect(described_class).to be_default
|
51
|
+
end
|
45
52
|
end
|
46
53
|
|
47
54
|
describe 'provider features' do
|
@@ -123,7 +123,7 @@ describe Puppet::Type.type(:package).provider(:dnfmodule) do
|
|
123
123
|
provider.install
|
124
124
|
end
|
125
125
|
|
126
|
-
it "should just enable the module if it has no default profile(missing groups or modules)" do
|
126
|
+
it "should just enable the module if it has no default profile (missing groups or modules)" do
|
127
127
|
dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nmissing groups or modules: #{resource[:name]}")
|
128
128
|
allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
|
129
129
|
resource[:ensure] = :present
|
@@ -132,7 +132,17 @@ describe Puppet::Type.type(:package).provider(:dnfmodule) do
|
|
132
132
|
provider.install
|
133
133
|
end
|
134
134
|
|
135
|
-
it "should just enable the module if it has no default profile(
|
135
|
+
it "should just enable the module with the right stream if it has no default profile (missing groups or modules)" do
|
136
|
+
stream = '12.3'
|
137
|
+
dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nmissing groups or modules: #{resource[:name]}:#{stream}")
|
138
|
+
allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
|
139
|
+
resource[:ensure] = stream
|
140
|
+
expect(provider).to receive(:execute).with(array_including('install')).ordered
|
141
|
+
expect(provider).to receive(:execute).with(array_including('enable')).ordered
|
142
|
+
provider.install
|
143
|
+
end
|
144
|
+
|
145
|
+
it "should just enable the module if it has no default profile (broken groups or modules)" do
|
136
146
|
dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nbroken groups or modules: #{resource[:name]}")
|
137
147
|
allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
|
138
148
|
resource[:ensure] = :present
|
@@ -141,6 +151,16 @@ describe Puppet::Type.type(:package).provider(:dnfmodule) do
|
|
141
151
|
provider.install
|
142
152
|
end
|
143
153
|
|
154
|
+
it "should just enable the module with the right stream if it has no default profile (broken groups or modules)" do
|
155
|
+
stream = '12.3'
|
156
|
+
dnf_exception = Puppet::ExecutionFailure.new("Error: Problems in request:\nbroken groups or modules: #{resource[:name]}:#{stream}")
|
157
|
+
allow(provider).to receive(:execute).with(array_including('install')).and_raise(dnf_exception)
|
158
|
+
resource[:ensure] = stream
|
159
|
+
expect(provider).to receive(:execute).with(array_including('install')).ordered
|
160
|
+
expect(provider).to receive(:execute).with(array_including('enable')).ordered
|
161
|
+
provider.install
|
162
|
+
end
|
163
|
+
|
144
164
|
it "should just enable the module if enable_only = true" do
|
145
165
|
resource[:ensure] = :present
|
146
166
|
resource[:enable_only] = true
|
@@ -18,7 +18,7 @@ describe 'Puppet::Type::Service::Provider::Systemd',
|
|
18
18
|
Puppet::Util::Execution::ProcessOutput.new('', 0)
|
19
19
|
end
|
20
20
|
|
21
|
-
osfamilies = [ 'archlinux', 'coreos' ]
|
21
|
+
osfamilies = [ 'archlinux', 'coreos', 'gentoo' ]
|
22
22
|
|
23
23
|
osfamilies.each do |osfamily|
|
24
24
|
it "should be the default provider on #{osfamily}" do
|
@@ -56,11 +56,13 @@ describe 'Puppet::Type::Service::Provider::Systemd',
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
59
|
+
[ 2, 2023 ].each do |ver|
|
60
|
+
it "should be the default provider on Amazon Linux #{ver}" do
|
61
|
+
allow(Facter).to receive(:value).with(:osfamily).and_return(:redhat)
|
62
|
+
allow(Facter).to receive(:value).with(:operatingsystem).and_return(:amazon)
|
63
|
+
allow(Facter).to receive(:value).with(:operatingsystemmajrelease).and_return("#{ver}")
|
64
|
+
expect(provider_class).to be_default
|
65
|
+
end
|
64
66
|
end
|
65
67
|
|
66
68
|
it "should not be the default provider on Amazon Linux 2017.09" do
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Puppet::SSL::CertificateSigner do
|
4
|
+
include PuppetSpec::Files
|
5
|
+
|
6
|
+
let(:wrong_key) { OpenSSL::PKey::RSA.new(512) }
|
7
|
+
let(:client_cert) { cert_fixture('signed.pem') }
|
8
|
+
|
9
|
+
# jruby-openssl >= 0.13.0 (JRuby >= 9.3.5.0) raises an error when signing a
|
10
|
+
# certificate when there is a discrepancy between the certificate and key.
|
11
|
+
it 'raises if client cert signature is invalid', if: Puppet::Util::Platform.jruby? && RUBY_VERSION.to_f >= 2.6 do
|
12
|
+
expect {
|
13
|
+
client_cert.sign(wrong_key, OpenSSL::Digest::SHA256.new)
|
14
|
+
}.to raise_error(OpenSSL::X509::CertificateError,
|
15
|
+
'invalid public key data')
|
16
|
+
end
|
17
|
+
end
|
@@ -298,7 +298,7 @@ describe Puppet::SSL::SSLProvider do
|
|
298
298
|
).to eq(['CN=signed', 'CN=Test CA Subauthority', 'CN=Test CA'])
|
299
299
|
end
|
300
300
|
|
301
|
-
it 'raises if client cert signature is invalid' do
|
301
|
+
it 'raises if client cert signature is invalid', unless: Puppet::Util::Platform.jruby? && RUBY_VERSION.to_f >= 2.6 do
|
302
302
|
client_cert.sign(wrong_key, OpenSSL::Digest::SHA256.new)
|
303
303
|
expect {
|
304
304
|
subject.create_context(**config.merge(client_cert: client_cert))
|
@@ -337,7 +337,7 @@ describe Puppet::SSL::SSLProvider do
|
|
337
337
|
end
|
338
338
|
end
|
339
339
|
|
340
|
-
it 'raises if intermediate CA signature is invalid' do
|
340
|
+
it 'raises if intermediate CA signature is invalid', unless: Puppet::Util::Platform.jruby? && RUBY_VERSION.to_f >= 2.6 do
|
341
341
|
int = global_cacerts.last
|
342
342
|
int.sign(wrong_key, OpenSSL::Digest::SHA256.new)
|
343
343
|
|
data/spec/unit/type/exec_spec.rb
CHANGED
@@ -252,6 +252,19 @@ RSpec.describe Puppet::Type.type(:exec) do
|
|
252
252
|
expect(dependencies.collect(&:to_s)).to eq([Puppet::Relationship.new(tmp, execer).to_s])
|
253
253
|
end
|
254
254
|
|
255
|
+
it "skips autorequire for deferred commands" do
|
256
|
+
foo = make_absolute('/bin/foo')
|
257
|
+
catalog = Puppet::Resource::Catalog.new
|
258
|
+
tmp = Puppet::Type.type(:file).new(:name => foo)
|
259
|
+
execer = Puppet::Type.type(:exec).new(:name => 'test array', :command => Puppet::Pops::Evaluator::DeferredValue.new(nil))
|
260
|
+
|
261
|
+
catalog.add_resource tmp
|
262
|
+
catalog.add_resource execer
|
263
|
+
dependencies = execer.autorequire(catalog)
|
264
|
+
|
265
|
+
expect(dependencies.collect(&:to_s)).to eq([])
|
266
|
+
end
|
267
|
+
|
255
268
|
describe "when handling the path parameter" do
|
256
269
|
expect = %w{one two three four}
|
257
270
|
{ "an array" => expect,
|
@@ -29,6 +29,7 @@ describe Puppet::Util::Execution, if: !Puppet::Util::Platform.jruby? do
|
|
29
29
|
allow(FFI::WIN32).to receive(:CloseHandle).with(thread_handle)
|
30
30
|
else
|
31
31
|
allow(Process).to receive(:waitpid2).with(pid, Process::WNOHANG).and_return(nil, [pid, double('child_status', :exitstatus => exitstatus)])
|
32
|
+
allow(Process).to receive(:waitpid2).with(pid, 0).and_return(nil, [pid, double('child_status', :exitstatus => exitstatus)])
|
32
33
|
allow(Process).to receive(:waitpid2).with(pid).and_return([pid, double('child_status', :exitstatus => exitstatus)])
|
33
34
|
end
|
34
35
|
end
|
@@ -95,6 +95,31 @@ describe Puppet::Util::Windows::ADSI, :if => Puppet::Util::Platform.windows? do
|
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
98
|
+
describe '.get_sids' do
|
99
|
+
it 'returns an array of SIDs given two an array of ADSI children' do
|
100
|
+
child1 = double('child1', name: 'Administrator', sid: 'S-1-5-21-3882680660-671291151-3888264257-500')
|
101
|
+
child2 = double('child2', name: 'Guest', sid: 'S-1-5-21-3882680660-671291151-3888264257-501')
|
102
|
+
allow(Puppet::Util::Windows::SID).to receive(:ads_to_principal).with(child1).and_return('Administrator')
|
103
|
+
allow(Puppet::Util::Windows::SID).to receive(:ads_to_principal).with(child2).and_return('Guest')
|
104
|
+
sids = Puppet::Util::Windows::ADSI::ADSIObject.get_sids([child1, child2])
|
105
|
+
expect(sids).to eq(['Administrator', 'Guest'])
|
106
|
+
end
|
107
|
+
|
108
|
+
it 'returns an array of SIDs given an ADSI child and ads_to_principal returning domain failure' do
|
109
|
+
child = double('child1', name: 'Administrator', sid: 'S-1-5-21-3882680660-671291151-3888264257-500')
|
110
|
+
allow(Puppet::Util::Windows::SID).to receive(:ads_to_principal).with(child).and_raise(Puppet::Util::Windows::Error.new('', Puppet::Util::Windows::SID::ERROR_TRUSTED_DOMAIN_FAILURE))
|
111
|
+
sids = Puppet::Util::Windows::ADSI::ADSIObject.get_sids([child])
|
112
|
+
expect(sids[0]).to eq(Puppet::Util::Windows::SID::Principal.new(child.name, child.sid, child.name, nil, :SidTypeUnknown))
|
113
|
+
end
|
114
|
+
|
115
|
+
it 'returns an array of SIDs given an ADSI child and ads_to_principal returning relationship failure' do
|
116
|
+
child = double('child1', name: 'Administrator', sid: 'S-1-5-21-3882680660-671291151-3888264257-500')
|
117
|
+
allow(Puppet::Util::Windows::SID).to receive(:ads_to_principal).with(child).and_raise(Puppet::Util::Windows::Error.new('', Puppet::Util::Windows::SID::ERROR_TRUSTED_RELATIONSHIP_FAILURE))
|
118
|
+
sids = Puppet::Util::Windows::ADSI::ADSIObject.get_sids([child])
|
119
|
+
expect(sids[0]).to eq(Puppet::Util::Windows::SID::Principal.new(child.name, child.sid, child.name, nil, :SidTypeUnknown))
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
98
123
|
describe Puppet::Util::Windows::ADSI::User do
|
99
124
|
let(:username) { 'testuser' }
|
100
125
|
let(:domain) { 'DOMAIN' }
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 7.
|
4
|
+
version: 7.28.0
|
5
5
|
platform: x64-mingw32
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-01-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facter
|
@@ -172,22 +172,16 @@ dependencies:
|
|
172
172
|
name: ffi
|
173
173
|
requirement: !ruby/object:Gem::Requirement
|
174
174
|
requirements:
|
175
|
-
- -
|
176
|
-
- !ruby/object:Gem::Version
|
177
|
-
version: 1.9.24
|
178
|
-
- - "<"
|
175
|
+
- - '='
|
179
176
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
177
|
+
version: 1.15.5
|
181
178
|
type: :runtime
|
182
179
|
prerelease: false
|
183
180
|
version_requirements: !ruby/object:Gem::Requirement
|
184
181
|
requirements:
|
185
|
-
- -
|
186
|
-
- !ruby/object:Gem::Version
|
187
|
-
version: 1.9.24
|
188
|
-
- - "<"
|
182
|
+
- - '='
|
189
183
|
- !ruby/object:Gem::Version
|
190
|
-
version:
|
184
|
+
version: 1.15.5
|
191
185
|
- !ruby/object:Gem::Dependency
|
192
186
|
name: minitar
|
193
187
|
requirement: !ruby/object:Gem::Requirement
|
@@ -2413,6 +2407,7 @@ files:
|
|
2413
2407
|
- spec/unit/ssl/base_spec.rb
|
2414
2408
|
- spec/unit/ssl/certificate_request_attributes_spec.rb
|
2415
2409
|
- spec/unit/ssl/certificate_request_spec.rb
|
2410
|
+
- spec/unit/ssl/certificate_signer_spec.rb
|
2416
2411
|
- spec/unit/ssl/certificate_spec.rb
|
2417
2412
|
- spec/unit/ssl/digest_spec.rb
|
2418
2413
|
- spec/unit/ssl/oids_spec.rb
|
@@ -2575,7 +2570,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
2575
2570
|
- !ruby/object:Gem::Version
|
2576
2571
|
version: 1.3.1
|
2577
2572
|
requirements: []
|
2578
|
-
rubygems_version: 3.4.
|
2573
|
+
rubygems_version: 3.4.20
|
2579
2574
|
signing_key:
|
2580
2575
|
specification_version: 4
|
2581
2576
|
summary: Puppet, an automated configuration management tool
|
@@ -3676,6 +3671,7 @@ test_files:
|
|
3676
3671
|
- spec/unit/ssl/base_spec.rb
|
3677
3672
|
- spec/unit/ssl/certificate_request_attributes_spec.rb
|
3678
3673
|
- spec/unit/ssl/certificate_request_spec.rb
|
3674
|
+
- spec/unit/ssl/certificate_signer_spec.rb
|
3679
3675
|
- spec/unit/ssl/certificate_spec.rb
|
3680
3676
|
- spec/unit/ssl/digest_spec.rb
|
3681
3677
|
- spec/unit/ssl/oids_spec.rb
|