From b5b4b43acdc3df97a671cd02ead170d8309f60a9 Mon Sep 17 00:00:00 2001 From: Steve Russell Date: Thu, 11 Aug 2022 20:06:13 -0700 Subject: [PATCH] (SIMP-10739) Update documentation and acc. tests Updated the acceptance tests (which I cannot run, so gosh I hope they work) to use the newer convention for user/password specification. --- manifests/server/section.pp | 2 +- .../suites/default/10_server_client_spec.rb | 3 +-- .../default/20_server_client_stunnel_spec.rb | 18 ++++++++---------- types/auth_users.pp | 2 +- 4 files changed, 11 insertions(+), 14 deletions(-) diff --git a/manifests/server/section.pp b/manifests/server/section.pp index 6b36aff..fd0903e 100644 --- a/manifests/server/section.pp +++ b/manifests/server/section.pp @@ -140,7 +140,7 @@ $secretsfile_lines = $user_pass .map |$line| { "${line}\n" } } else { - $secretsfile_lines = Hash.assert_type($auth_users) |$ex, $act| { + $secretsfile_lines = Hash.assert_type($auth_users) |$ex, $act| { $auth_users.reduce({}) |$hash, $user| { $hash + { $user => undef } } }.map |$username, $maybe_password| { $password = $maybe_password ? { diff --git a/spec/acceptance/suites/default/10_server_client_spec.rb b/spec/acceptance/suites/default/10_server_client_spec.rb index 02cde0f..26b1911 100644 --- a/spec/acceptance/suites/default/10_server_client_spec.rb +++ b/spec/acceptance/suites/default/10_server_client_spec.rb @@ -45,8 +45,7 @@ } rsync::server::section { 'test': - auth_users => ['test_user'], - user_pass => ['test_user:test_pass'], + auth_users => { 'test_user' => 'test_pass' }, comment => 'A test system', hosts_allow => ['#{server1_ip}', '#{server2_ip}'], path => '/srv/rsync/test', diff --git a/spec/acceptance/suites/default/20_server_client_stunnel_spec.rb b/spec/acceptance/suites/default/20_server_client_stunnel_spec.rb index a17dc58..b672ac4 100644 --- a/spec/acceptance/suites/default/20_server_client_stunnel_spec.rb +++ b/spec/acceptance/suites/default/20_server_client_stunnel_spec.rb @@ -49,11 +49,10 @@ } rsync::server::section { 'test': - auth_users => ['test_user'], - user_pass => ['test_user:test_pass'], - comment => 'A test system', - path => '/srv/rsync/test', - require => File['/srv/rsync/test/test_file_srvcli2_server1'] + auth_users => { 'test_user' => 'test_pass' }, + comment => 'A test system', + path => '/srv/rsync/test', + require => File['/srv/rsync/test/test_file_srvcli2_server1'] } stunnel::connection { 'rsync': @@ -88,11 +87,10 @@ } rsync::server::section { 'test': - auth_users => ['test_user'], - user_pass => ['test_user:test_pass'], - comment => 'A test system', - path => '/srv/rsync/test', - require => File['/srv/rsync/test/test_file_srvcli2_server2'] + auth_users => { 'test_user' => 'test_pass' }, + comment => 'A test system', + path => '/srv/rsync/test', + require => File['/srv/rsync/test/test_file_srvcli2_server2'] } stunnel::connection { 'rsync': diff --git a/types/auth_users.pp b/types/auth_users.pp index 2478cbb..ca4394a 100644 --- a/types/auth_users.pp +++ b/types/auth_users.pp @@ -1,6 +1,6 @@ # @summary Validator for rsync::server::auth_users # type Rsync::Auth_users = Variant[ - Array[String[1]], + Array[String[1]], Hash[String[1], Optional[String]] ]