puppet 7.4.1 → 7.5.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of puppet might be problematic. Click here for more details.

Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +19 -13
  3. data/lib/puppet/application/ssl.rb +11 -0
  4. data/lib/puppet/defaults.rb +8 -0
  5. data/lib/puppet/environments.rb +16 -1
  6. data/lib/puppet/ffi/windows/api_types.rb +1 -1
  7. data/lib/puppet/file_system/memory_file.rb +8 -1
  8. data/lib/puppet/file_system/windows.rb +2 -0
  9. data/lib/puppet/http/factory.rb +4 -0
  10. data/lib/puppet/network/http.rb +5 -2
  11. data/lib/puppet/network/http/api.rb +10 -6
  12. data/lib/puppet/network/http/api/master.rb +3 -2
  13. data/lib/puppet/network/http/api/master/v3.rb +2 -25
  14. data/lib/puppet/network/http/api/master/v3/environments.rb +2 -33
  15. data/lib/puppet/network/http/api/server.rb +10 -0
  16. data/lib/puppet/network/http/api/server/v3.rb +39 -0
  17. data/lib/puppet/network/http/api/server/v3/environments.rb +48 -0
  18. data/lib/puppet/pops/parser/lexer2.rb +0 -4
  19. data/lib/puppet/pops/validation/checker4_0.rb +0 -1
  20. data/lib/puppet/settings/environment_conf.rb +1 -0
  21. data/lib/puppet/util/monkey_patches.rb +7 -0
  22. data/lib/puppet/util/windows/adsi.rb +46 -0
  23. data/lib/puppet/util/windows/principal.rb +9 -2
  24. data/lib/puppet/util/windows/sid.rb +4 -2
  25. data/lib/puppet/version.rb +1 -1
  26. data/man/man5/puppet.conf.5 +10 -2
  27. data/man/man8/puppet-agent.8 +1 -1
  28. data/man/man8/puppet-apply.8 +1 -1
  29. data/man/man8/puppet-catalog.8 +1 -1
  30. data/man/man8/puppet-config.8 +1 -1
  31. data/man/man8/puppet-describe.8 +1 -1
  32. data/man/man8/puppet-device.8 +1 -1
  33. data/man/man8/puppet-doc.8 +1 -1
  34. data/man/man8/puppet-epp.8 +1 -1
  35. data/man/man8/puppet-facts.8 +1 -1
  36. data/man/man8/puppet-filebucket.8 +1 -1
  37. data/man/man8/puppet-generate.8 +1 -1
  38. data/man/man8/puppet-help.8 +1 -1
  39. data/man/man8/puppet-lookup.8 +1 -1
  40. data/man/man8/puppet-module.8 +1 -1
  41. data/man/man8/puppet-node.8 +1 -1
  42. data/man/man8/puppet-parser.8 +1 -1
  43. data/man/man8/puppet-plugin.8 +1 -1
  44. data/man/man8/puppet-report.8 +1 -1
  45. data/man/man8/puppet-resource.8 +1 -1
  46. data/man/man8/puppet-script.8 +1 -1
  47. data/man/man8/puppet-ssl.8 +5 -1
  48. data/man/man8/puppet.8 +2 -2
  49. data/spec/integration/application/plugin_spec.rb +1 -1
  50. data/spec/integration/http/client_spec.rb +12 -0
  51. data/spec/integration/indirector/direct_file_server_spec.rb +1 -3
  52. data/spec/integration/parser/collection_spec.rb +10 -0
  53. data/spec/integration/util/windows/adsi_spec.rb +18 -0
  54. data/spec/integration/util/windows/principal_spec.rb +21 -0
  55. data/spec/integration/util/windows/registry_spec.rb +6 -0
  56. data/spec/unit/application/facts_spec.rb +5 -5
  57. data/spec/unit/application/ssl_spec.rb +23 -0
  58. data/spec/unit/environments_spec.rb +164 -88
  59. data/spec/unit/file_system_spec.rb +9 -0
  60. data/spec/unit/http/factory_spec.rb +19 -0
  61. data/spec/unit/network/http/api/master_spec.rb +38 -0
  62. data/spec/unit/network/http/api/{master → server}/v3/environments_spec.rb +2 -2
  63. data/spec/unit/network/http/api/{master → server}/v3_spec.rb +19 -19
  64. data/spec/unit/network/http/api_spec.rb +11 -11
  65. data/spec/unit/pops/parser/lexer2_spec.rb +0 -4
  66. data/spec/unit/pops/validator/validator_spec.rb +20 -43
  67. data/spec/unit/util/windows/sid_spec.rb +6 -0
  68. metadata +11 -16
  69. data/spec/lib/matchers/include.rb +0 -27
  70. data/spec/lib/matchers/include_spec.rb +0 -32
  71. data/spec/unit/pops/parser/parse_application_spec.rb +0 -13
  72. data/spec/unit/pops/parser/parse_capabilities_spec.rb +0 -23
  73. data/spec/unit/pops/parser/parse_site_spec.rb +0 -43
@@ -999,6 +999,15 @@ describe "Puppet::FileSystem" do
999
999
  Puppet::FileSystem.replace_file(dest, 0755) { |_| }
1000
1000
  }.to raise_error(ArgumentError, /Only modes 0644, 0640, 0660, and 0440 are allowed/)
1001
1001
  end
1002
+
1003
+ it 'falls back to fully qualified user name when sid retrieval fails' do
1004
+ current_user_sid = Puppet::Util::Windows::SID.name_to_sid(Puppet::Util::Windows::ADSI::User.current_user_name)
1005
+ allow(Puppet::Util::Windows::SID).to receive(:name_to_sid).with(Puppet::Util::Windows::ADSI::User.current_user_name).and_return(nil, current_user_sid)
1006
+ allow(Puppet::Util::Windows::SID).to receive(:name_to_sid).with(Puppet::Util::Windows::ADSI::User.current_sam_compatible_user_name).and_call_original
1007
+
1008
+ Puppet::FileSystem.replace_file(dest, 0644) { |f| f.write(content) }
1009
+ expects_public_file(dest)
1010
+ end
1002
1011
  end
1003
1012
  end
1004
1013
 
@@ -138,4 +138,23 @@ describe Puppet::HTTP::Factory do
138
138
  expect(conn.local_host).to eq('127.0.0.1')
139
139
  end
140
140
  end
141
+
142
+ context 'tls' do
143
+ it "sets the minimum version to TLS 1.0", if: RUBY_VERSION.to_f >= 2.5 do
144
+ conn = create_connection(site)
145
+ expect(conn.min_version).to eq(OpenSSL::SSL::TLS1_VERSION)
146
+ end
147
+
148
+ it "defaults to ciphersuites providing 128 bits of security or greater" do
149
+ conn = create_connection(site)
150
+ expect(conn.ciphers).to eq("ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256")
151
+ end
152
+
153
+ it "can be restricted to TLSv1.3 ciphers" do
154
+ tls13_ciphers = "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256"
155
+ Puppet[:ciphers] = tls13_ciphers
156
+ conn = create_connection(site)
157
+ expect(conn.ciphers).to eq(tls13_ciphers)
158
+ end
159
+ end
141
160
  end
@@ -0,0 +1,38 @@
1
+ # Tests the backwards compatibility of our master -> server changes
2
+ # in the HTTP API
3
+ # This may be removed in Puppet 8
4
+ require 'spec_helper'
5
+
6
+ require 'puppet/network/http'
7
+ require 'puppet_spec/network'
8
+
9
+ describe Puppet::Network::HTTP::API::Master::V3 do
10
+ include PuppetSpec::Network
11
+
12
+ let(:response) { Puppet::Network::HTTP::MemoryResponse.new }
13
+ let(:server_url_prefix) { "#{Puppet::Network::HTTP::MASTER_URL_PREFIX}/v3" }
14
+ let(:server_routes) {
15
+ Puppet::Network::HTTP::Route.
16
+ path(Regexp.new("#{Puppet::Network::HTTP::MASTER_URL_PREFIX}/")).
17
+ any.
18
+ chain(Puppet::Network::HTTP::API::Master::V3.routes)
19
+ }
20
+
21
+ # simulate puppetserver registering its authconfigloader class
22
+ around :each do |example|
23
+ Puppet::Network::Authorization.authconfigloader_class = Object
24
+ begin
25
+ example.run
26
+ ensure
27
+ Puppet::Network::Authorization.authconfigloader_class = nil
28
+ end
29
+ end
30
+
31
+ it "mounts the environments endpoint" do
32
+ request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/environments")
33
+ server_routes.process(request, response)
34
+
35
+ expect(response.code).to eq(200)
36
+ end
37
+ end
38
+
@@ -4,12 +4,12 @@ require 'puppet/node/environment'
4
4
  require 'puppet/network/http'
5
5
  require 'matchers/json'
6
6
 
7
- describe Puppet::Network::HTTP::API::Master::V3::Environments do
7
+ describe Puppet::Network::HTTP::API::Server::V3::Environments do
8
8
  include JSONMatchers
9
9
 
10
10
  let(:environment) { Puppet::Node::Environment.create(:production, ["/first", "/second"], '/manifests') }
11
11
  let(:loader) { Puppet::Environments::Static.new(environment) }
12
- let(:handler) { Puppet::Network::HTTP::API::Master::V3::Environments.new(loader) }
12
+ let(:handler) { Puppet::Network::HTTP::API::Server::V3::Environments.new(loader) }
13
13
  let(:request) { Puppet::Network::HTTP::Request.from_hash(:headers => { 'accept' => 'application/json' }) }
14
14
  let(:response) { Puppet::Network::HTTP::MemoryResponse.new }
15
15
 
@@ -3,16 +3,16 @@ require 'spec_helper'
3
3
  require 'puppet/network/http'
4
4
  require 'puppet_spec/network'
5
5
 
6
- describe Puppet::Network::HTTP::API::Master::V3 do
6
+ describe Puppet::Network::HTTP::API::Server::V3 do
7
7
  include PuppetSpec::Network
8
8
 
9
9
  let(:response) { Puppet::Network::HTTP::MemoryResponse.new }
10
- let(:master_url_prefix) { "#{Puppet::Network::HTTP::MASTER_URL_PREFIX}/v3" }
11
- let(:master_routes) {
10
+ let(:server_url_prefix) { "#{Puppet::Network::HTTP::SERVER_URL_PREFIX}/v3" }
11
+ let(:server_routes) {
12
12
  Puppet::Network::HTTP::Route.
13
- path(Regexp.new("#{Puppet::Network::HTTP::MASTER_URL_PREFIX}/")).
13
+ path(Regexp.new("#{Puppet::Network::HTTP::SERVER_URL_PREFIX}/")).
14
14
  any.
15
- chain(Puppet::Network::HTTP::API::Master::V3.routes)
15
+ chain(Puppet::Network::HTTP::API::Server::V3.routes)
16
16
  }
17
17
 
18
18
  # simulate puppetserver registering its authconfigloader class
@@ -26,53 +26,53 @@ describe Puppet::Network::HTTP::API::Master::V3 do
26
26
  end
27
27
 
28
28
  it "mounts the environments endpoint" do
29
- request = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_url_prefix}/environments")
30
- master_routes.process(request, response)
29
+ request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/environments")
30
+ server_routes.process(request, response)
31
31
 
32
32
  expect(response.code).to eq(200)
33
33
  end
34
34
 
35
35
  it "matches only complete routes" do
36
- request = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_url_prefix}/foo/environments")
37
- expect { master_routes.process(request, response) }.to raise_error(Puppet::Network::HTTP::Error::HTTPNotFoundError)
36
+ request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/foo/environments")
37
+ expect { server_routes.process(request, response) }.to raise_error(Puppet::Network::HTTP::Error::HTTPNotFoundError)
38
38
 
39
- request = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_url_prefix}/foo/environment/production")
40
- expect { master_routes.process(request, response) }.to raise_error(Puppet::Network::HTTP::Error::HTTPNotFoundError)
39
+ request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/foo/environment/production")
40
+ expect { server_routes.process(request, response) }.to raise_error(Puppet::Network::HTTP::Error::HTTPNotFoundError)
41
41
  end
42
42
 
43
43
  it "mounts indirected routes" do
44
44
  request = Puppet::Network::HTTP::Request.
45
- from_hash(:path => "#{master_url_prefix}/node/foo",
45
+ from_hash(:path => "#{server_url_prefix}/node/foo",
46
46
  :params => {:environment => "production"},
47
47
  :headers => {"accept" => "application/json"})
48
- master_routes.process(request, response)
48
+ server_routes.process(request, response)
49
49
 
50
50
  expect(response.code).to eq(200)
51
51
  end
52
52
 
53
53
  it "responds to unknown paths by raising not_found_error" do
54
- request = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_url_prefix}/unknown")
54
+ request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/unknown")
55
55
 
56
56
  expect {
57
- master_routes.process(request, response)
57
+ server_routes.process(request, response)
58
58
  }.to raise_error(not_found_error)
59
59
  end
60
60
 
61
61
  it "checks authorization for indirected routes" do
62
62
  Puppet::Network::Authorization.authconfigloader_class = nil
63
63
 
64
- request = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_url_prefix}/catalog/foo")
64
+ request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/catalog/foo")
65
65
  expect {
66
- master_routes.process(request, response)
66
+ server_routes.process(request, response)
67
67
  }.to raise_error(Puppet::Network::HTTP::Error::HTTPNotAuthorizedError, %r{Not Authorized: Forbidden request: /puppet/v3/catalog/foo \(method GET\)})
68
68
  end
69
69
 
70
70
  it "checks authorization for environments" do
71
71
  Puppet::Network::Authorization.authconfigloader_class = nil
72
72
 
73
- request = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_url_prefix}/environments")
73
+ request = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_url_prefix}/environments")
74
74
  expect {
75
- master_routes.process(request, response)
75
+ server_routes.process(request, response)
76
76
  }.to raise_error(Puppet::Network::HTTP::Error::HTTPNotAuthorizedError, %r{Not Authorized: Forbidden request: /puppet/v3/environments \(method GET\)})
77
77
  end
78
78
  end
@@ -36,12 +36,12 @@ describe Puppet::Network::HTTP::API do
36
36
  end
37
37
 
38
38
  describe "Puppet API" do
39
- let(:handler) { PuppetSpec::Handler.new(Puppet::Network::HTTP::API.master_routes,
39
+ let(:handler) { PuppetSpec::Handler.new(Puppet::Network::HTTP::API.server_routes,
40
40
  Puppet::Network::HTTP::API.not_found_upgrade) }
41
41
 
42
- let(:master_prefix) { Puppet::Network::HTTP::MASTER_URL_PREFIX }
42
+ let(:server_prefix) { Puppet::Network::HTTP::SERVER_URL_PREFIX }
43
43
 
44
- it "raises a not-found error for non-CA or master routes and suggests an upgrade" do
44
+ it "raises a not-found error for non-CA or server routes and suggests an upgrade" do
45
45
  req = Puppet::Network::HTTP::Request.from_hash(:path => "/unknown")
46
46
  res = {}
47
47
  handler.process(req, res)
@@ -50,13 +50,13 @@ describe Puppet::Network::HTTP::API do
50
50
  end
51
51
 
52
52
  describe "when processing Puppet 3 routes" do
53
- it "gives an upgrade message for master routes" do
53
+ it "gives an upgrade message for server routes" do
54
54
  req = Puppet::Network::HTTP::Request.from_hash(:path => "/production/node/foo")
55
55
  res = {}
56
56
  handler.process(req, res)
57
57
  expect(res[:status]).to eq(404)
58
58
  expect(res[:body]).to include("Puppet version: #{Puppet.version}")
59
- expect(res[:body]).to include("Supported /puppet API versions: #{Puppet::Network::HTTP::MASTER_URL_VERSIONS}")
59
+ expect(res[:body]).to include("Supported /puppet API versions: #{Puppet::Network::HTTP::SERVER_URL_VERSIONS}")
60
60
  end
61
61
 
62
62
  it "gives an upgrade message for CA routes" do
@@ -65,11 +65,11 @@ describe Puppet::Network::HTTP::API do
65
65
  handler.process(req, res)
66
66
  expect(res[:status]).to eq(404)
67
67
  expect(res[:body]).to include("Puppet version: #{Puppet.version}")
68
- expect(res[:body]).to include("Supported /puppet API versions: #{Puppet::Network::HTTP::MASTER_URL_VERSIONS}")
68
+ expect(res[:body]).to include("Supported /puppet API versions: #{Puppet::Network::HTTP::SERVER_URL_VERSIONS}")
69
69
  end
70
70
  end
71
71
 
72
- describe "when processing master routes" do
72
+ describe "when processing server routes" do
73
73
  # simulate puppetserver registering its authconfigloader class
74
74
  around :each do |example|
75
75
  Puppet::Network::Authorization.authconfigloader_class = Object
@@ -81,7 +81,7 @@ describe Puppet::Network::HTTP::API do
81
81
  end
82
82
 
83
83
  it "responds to v3 indirector requests" do
84
- req = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_prefix}/v3/node/foo",
84
+ req = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_prefix}/v3/node/foo",
85
85
  :params => {:environment => "production"},
86
86
  :headers => {'accept' => "application/json"})
87
87
  res = {}
@@ -90,18 +90,18 @@ describe Puppet::Network::HTTP::API do
90
90
  end
91
91
 
92
92
  it "responds to v3 environments requests" do
93
- req = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_prefix}/v3/environments")
93
+ req = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_prefix}/v3/environments")
94
94
  res = {}
95
95
  handler.process(req, res)
96
96
  expect(res[:status]).to eq(200)
97
97
  end
98
98
 
99
99
  it "responds with a not found error to non-v3 requests and does not suggest an upgrade" do
100
- req = Puppet::Network::HTTP::Request.from_hash(:path => "#{master_prefix}/unknown")
100
+ req = Puppet::Network::HTTP::Request.from_hash(:path => "#{server_prefix}/unknown")
101
101
  res = {}
102
102
  handler.process(req, res)
103
103
  expect(res[:status]).to eq(404)
104
- expect(res[:body]).to include("No route for GET #{master_prefix}/unknown")
104
+ expect(res[:body]).to include("No route for GET #{server_prefix}/unknown")
105
105
  expect(res[:body]).not_to include("Puppet version: #{Puppet.version}")
106
106
  end
107
107
  end
@@ -94,10 +94,6 @@ describe 'Lexer2' do
94
94
  "private" => :PRIVATE,
95
95
  "type" => :TYPE,
96
96
  "attr" => :ATTR,
97
- "application" => :APPLICATION,
98
- "consumes" => :CONSUMES,
99
- "produces" => :PRODUCES,
100
- "site" => :SITE,
101
97
  }.each do |string, name|
102
98
  it "should lex a keyword from '#{string}'" do
103
99
  expect(tokens_scanned_from(string)).to match_tokens2(name)
@@ -344,18 +344,6 @@ describe "validating 4x" do
344
344
  end
345
345
  end
346
346
 
347
- it 'produces a syntax error for application' do
348
- expect {
349
- parse('application test {}')
350
- }.to raise_error(Puppet::ParseErrorWithIssue, /Syntax error at 'application'/)
351
- end
352
-
353
- it 'produces a syntax error for capability mapping' do
354
- expect {
355
- parse('Foo produces Sql {}')
356
- }.to raise_error(Puppet::ParseErrorWithIssue, /Syntax error at 'produces'/)
357
- end
358
-
359
347
  it 'produces an error for collect expressions with virtual query' do
360
348
  acceptor = validate(parse("User <| title == 'admin' |>"))
361
349
  expect(acceptor.error_count).to eql(1)
@@ -410,12 +398,6 @@ describe "validating 4x" do
410
398
  expect(acceptor).to have_issue(Puppet::Pops::Issues::EXPRESSION_NOT_SUPPORTED_WHEN_SCRIPTING)
411
399
  end
412
400
 
413
- it 'produces a syntax error for site definitions' do
414
- expect {
415
- parse('site {}')
416
- }.to raise_error(Puppet::ParseErrorWithIssue, /Syntax error at 'site'/)
417
- end
418
-
419
401
  context 'validating apply() blocks' do
420
402
  it 'allows empty apply() blocks' do
421
403
  acceptor = validate(parse('apply("foo.example.com") { }'))
@@ -468,18 +450,6 @@ describe "validating 4x" do
468
450
  expect(acceptor.error_count).to eql(0)
469
451
  end
470
452
 
471
- it 'produces a syntax error for application' do
472
- expect {
473
- parse('apply("foo.example.com") { application test {} }')
474
- }.to raise_error(Puppet::ParseErrorWithIssue, /Syntax error at 'application'/)
475
- end
476
-
477
- it 'produces a syntax error for capability mapping' do
478
- expect {
479
- parse('apply("foo.example.com") { Foo produces Sql {} }')
480
- }.to raise_error(Puppet::ParseErrorWithIssue, /Syntax error at 'produces'/)
481
- end
482
-
483
453
  it 'produces an error for class expressions' do
484
454
  acceptor = validate(parse('apply("foo.example.com") { class test {} }'))
485
455
  expect(acceptor.error_count).to eql(1)
@@ -503,12 +473,6 @@ describe "validating 4x" do
503
473
  expect(acceptor).to have_issue(Puppet::Pops::Issues::EXPRESSION_NOT_SUPPORTED_WHEN_SCRIPTING)
504
474
  end
505
475
 
506
- it 'produces an error for site definitions' do
507
- expect {
508
- parse('apply("foo.example.com") { site {} }')
509
- }.to raise_error(Puppet::ParseErrorWithIssue, /Syntax error at 'site'/)
510
- end
511
-
512
476
  it 'produces an error for apply() inside apply()' do
513
477
  acceptor = validate(parse('apply("foo.example.com") { apply("foo.example.com") { } }'))
514
478
  expect(acceptor.error_count).to eql(1)
@@ -1010,14 +974,27 @@ describe "validating 4x" do
1010
974
  expect(acceptor.errors[2].source_pos.line).to eql(5)
1011
975
  end
1012
976
  end
1013
- end
977
+ [
978
+ "application",
979
+ "consumes",
980
+ "produces",
981
+ "site",
982
+ ].each do |kw|
983
+ it "allow usage of #{kw} keyword (it was reserved in puppet 6.x)" do
984
+ source = <<-SOURCE
985
+ class foo (
986
+ $#{kw},
987
+ ) {
988
+ notice $#{kw}
989
+ }
990
+
991
+ class { foo:
992
+ #{kw} => 'bar'
993
+ }
994
+ SOURCE
1014
995
 
1015
- context "capability annotations" do
1016
- ['produces', 'consumes'].each do |word|
1017
- it "raises a syntax error in #{word} clauses" do
1018
- expect {
1019
- parse("foo #{word} Bar {}")
1020
- }.to raise_error(Puppet::ParseErrorWithIssue, /Syntax error at '#{word}'/)
996
+ acceptor = validate(parse(source, 'path/foo/manifests/init.pp'))
997
+ expect(acceptor.error_count).to eql(0)
1021
998
  end
1022
999
  end
1023
1000
  end
@@ -158,6 +158,12 @@ describe "Puppet::Util::Windows::SID", :if => Puppet::Util::Platform.windows? do
158
158
  # this works in French Windows, even though the account is really AUTORITE NT\\Syst\u00E8me
159
159
  expect(subject.name_to_principal('NT AUTHORITY\SYSTEM').sid).to eq(sid)
160
160
  end
161
+
162
+ it "should print a debug message on failures" do
163
+ expect(Puppet).to receive(:debug).with(/Could not retrieve raw SID bytes from 'NonExistingUser'/)
164
+ expect(Puppet).to receive(:debug).with(/No mapping between account names and security IDs was done/)
165
+ subject.name_to_principal('NonExistingUser')
166
+ end
161
167
  end
162
168
 
163
169
  context "#ads_to_principal" do
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.1
4
+ version: 7.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Puppet Labs
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-02-11 00:00:00.000000000 Z
11
+ date: 2021-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: facter
@@ -706,6 +706,9 @@ files:
706
706
  - lib/puppet/network/http/api/master.rb
707
707
  - lib/puppet/network/http/api/master/v3.rb
708
708
  - lib/puppet/network/http/api/master/v3/environments.rb
709
+ - lib/puppet/network/http/api/server.rb
710
+ - lib/puppet/network/http/api/server/v3.rb
711
+ - lib/puppet/network/http/api/server/v3/environments.rb
709
712
  - lib/puppet/network/http/connection.rb
710
713
  - lib/puppet/network/http/error.rb
711
714
  - lib/puppet/network/http/handler.rb
@@ -1819,10 +1822,8 @@ files:
1819
1822
  - spec/integration/util/windows/user_spec.rb
1820
1823
  - spec/integration/util_spec.rb
1821
1824
  - spec/lib/matchers/containment_matchers.rb
1822
- - spec/lib/matchers/include.rb
1823
1825
  - spec/lib/matchers/include_in_order.rb
1824
1826
  - spec/lib/matchers/include_in_order_spec.rb
1825
- - spec/lib/matchers/include_spec.rb
1826
1827
  - spec/lib/matchers/json.rb
1827
1828
  - spec/lib/matchers/match_tokens2.rb
1828
1829
  - spec/lib/matchers/relationship_graph_matchers.rb
@@ -2147,8 +2148,9 @@ files:
2147
2148
  - spec/unit/network/format_support_spec.rb
2148
2149
  - spec/unit/network/formats_spec.rb
2149
2150
  - spec/unit/network/http/api/indirected_routes_spec.rb
2150
- - spec/unit/network/http/api/master/v3/environments_spec.rb
2151
- - spec/unit/network/http/api/master/v3_spec.rb
2151
+ - spec/unit/network/http/api/master_spec.rb
2152
+ - spec/unit/network/http/api/server/v3/environments_spec.rb
2153
+ - spec/unit/network/http/api/server/v3_spec.rb
2152
2154
  - spec/unit/network/http/api_spec.rb
2153
2155
  - spec/unit/network/http/connection_spec.rb
2154
2156
  - spec/unit/network/http/error_spec.rb
@@ -2242,10 +2244,8 @@ files:
2242
2244
  - spec/unit/pops/parser/evaluating_parser_spec.rb
2243
2245
  - spec/unit/pops/parser/lexer2_spec.rb
2244
2246
  - spec/unit/pops/parser/locator_spec.rb
2245
- - spec/unit/pops/parser/parse_application_spec.rb
2246
2247
  - spec/unit/pops/parser/parse_basic_expressions_spec.rb
2247
2248
  - spec/unit/pops/parser/parse_calls_spec.rb
2248
- - spec/unit/pops/parser/parse_capabilities_spec.rb
2249
2249
  - spec/unit/pops/parser/parse_conditionals_spec.rb
2250
2250
  - spec/unit/pops/parser/parse_containers_spec.rb
2251
2251
  - spec/unit/pops/parser/parse_functions_spec.rb
@@ -2253,7 +2253,6 @@ files:
2253
2253
  - spec/unit/pops/parser/parse_lambda_spec.rb
2254
2254
  - spec/unit/pops/parser/parse_plan_spec.rb
2255
2255
  - spec/unit/pops/parser/parse_resource_spec.rb
2256
- - spec/unit/pops/parser/parse_site_spec.rb
2257
2256
  - spec/unit/pops/parser/parser_rspec_helper.rb
2258
2257
  - spec/unit/pops/parser/parser_spec.rb
2259
2258
  - spec/unit/pops/parser/parsing_typed_parameters_spec.rb
@@ -3059,10 +3058,8 @@ test_files:
3059
3058
  - spec/integration/util/windows/user_spec.rb
3060
3059
  - spec/integration/util_spec.rb
3061
3060
  - spec/lib/matchers/containment_matchers.rb
3062
- - spec/lib/matchers/include.rb
3063
3061
  - spec/lib/matchers/include_in_order.rb
3064
3062
  - spec/lib/matchers/include_in_order_spec.rb
3065
- - spec/lib/matchers/include_spec.rb
3066
3063
  - spec/lib/matchers/json.rb
3067
3064
  - spec/lib/matchers/match_tokens2.rb
3068
3065
  - spec/lib/matchers/relationship_graph_matchers.rb
@@ -3387,8 +3384,9 @@ test_files:
3387
3384
  - spec/unit/network/format_support_spec.rb
3388
3385
  - spec/unit/network/formats_spec.rb
3389
3386
  - spec/unit/network/http/api/indirected_routes_spec.rb
3390
- - spec/unit/network/http/api/master/v3/environments_spec.rb
3391
- - spec/unit/network/http/api/master/v3_spec.rb
3387
+ - spec/unit/network/http/api/master_spec.rb
3388
+ - spec/unit/network/http/api/server/v3/environments_spec.rb
3389
+ - spec/unit/network/http/api/server/v3_spec.rb
3392
3390
  - spec/unit/network/http/api_spec.rb
3393
3391
  - spec/unit/network/http/connection_spec.rb
3394
3392
  - spec/unit/network/http/error_spec.rb
@@ -3482,10 +3480,8 @@ test_files:
3482
3480
  - spec/unit/pops/parser/evaluating_parser_spec.rb
3483
3481
  - spec/unit/pops/parser/lexer2_spec.rb
3484
3482
  - spec/unit/pops/parser/locator_spec.rb
3485
- - spec/unit/pops/parser/parse_application_spec.rb
3486
3483
  - spec/unit/pops/parser/parse_basic_expressions_spec.rb
3487
3484
  - spec/unit/pops/parser/parse_calls_spec.rb
3488
- - spec/unit/pops/parser/parse_capabilities_spec.rb
3489
3485
  - spec/unit/pops/parser/parse_conditionals_spec.rb
3490
3486
  - spec/unit/pops/parser/parse_containers_spec.rb
3491
3487
  - spec/unit/pops/parser/parse_functions_spec.rb
@@ -3493,7 +3489,6 @@ test_files:
3493
3489
  - spec/unit/pops/parser/parse_lambda_spec.rb
3494
3490
  - spec/unit/pops/parser/parse_plan_spec.rb
3495
3491
  - spec/unit/pops/parser/parse_resource_spec.rb
3496
- - spec/unit/pops/parser/parse_site_spec.rb
3497
3492
  - spec/unit/pops/parser/parser_rspec_helper.rb
3498
3493
  - spec/unit/pops/parser/parser_spec.rb
3499
3494
  - spec/unit/pops/parser/parsing_typed_parameters_spec.rb