|
33 | 33 | it { is_expected.to contain_postgresql__server__role('test') }
|
34 | 34 | it 'has create role for "test" user with password as ****' do
|
35 | 35 | is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****')
|
36 |
| - .with('command' => "CREATE ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD' LOGIN NOCREATEROLE NOCREATEDB NOSUPERUSER CONNECTION LIMIT -1", |
37 |
| - 'environment' => 'NEWPGPASSWD=new-pa$s', |
| 36 | + .with('command' => 'Sensitive [value redacted]', |
| 37 | + 'sensitive' => 'true', |
38 | 38 | 'unless' => "SELECT 1 FROM pg_roles WHERE rolname = 'test'",
|
39 | 39 | 'port' => '5432')
|
40 | 40 | end
|
41 | 41 | it 'has alter role for "test" user with password as ****' do
|
42 | 42 | is_expected.to contain_postgresql_psql('ALTER ROLE test ENCRYPTED PASSWORD ****')
|
43 |
| - .with('command' => "ALTER ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD'", |
44 |
| - 'environment' => 'NEWPGPASSWD=new-pa$s', |
45 |
| - 'unless' => "SELECT 1 FROM pg_shadow WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
| 43 | + .with('command' => 'Sensitive [value redacted]', |
| 44 | + 'sensitive' => 'true', |
| 45 | + 'unless' => 'Sensitive [value redacted]', |
46 | 46 | 'port' => '5432')
|
47 | 47 | end
|
48 | 48 |
|
|
64 | 64 | it { is_expected.to contain_postgresql__server__role('test') }
|
65 | 65 | it 'has create role for "test" user with password as ****' do
|
66 | 66 | is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****')
|
67 |
| - .with_command("CREATE ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD' LOGIN NOCREATEROLE NOCREATEDB NOSUPERUSER CONNECTION LIMIT -1") |
68 |
| - .with_environment('NEWPGPASSWD=new-pa$s') |
| 67 | + .with_command('Sensitive [value redacted]') |
| 68 | + .with_sensitive('true') |
69 | 69 | .with_unless("SELECT 1 FROM pg_roles WHERE rolname = 'test'")
|
70 | 70 | .with_port(5432)
|
71 | 71 | .with_connect_settings('PGHOST' => 'postgres-db-server', 'DBVERSION' => '9.1', 'PGUSER' => 'login-user', 'PGPASSWORD' => 'login-pass')
|
72 | 72 | .that_requires('Class[postgresql::server::service]')
|
73 | 73 | end
|
74 | 74 | it 'has alter role for "test" user with password as ****' do
|
75 | 75 | is_expected.to contain_postgresql_psql('ALTER ROLE test ENCRYPTED PASSWORD ****')
|
76 |
| - .with('command' => "ALTER ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD'", 'environment' => 'NEWPGPASSWD=new-pa$s', |
77 |
| - 'unless' => "SELECT 1 FROM pg_shadow WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", 'port' => '5432', |
| 76 | + .with('command' => 'Sensitive [value redacted]', 'sensitive' => 'true', |
| 77 | + 'unless' => 'Sensitive [value redacted]', 'port' => '5432', |
78 | 78 | 'connect_settings' => { 'PGHOST' => 'postgres-db-server', 'DBVERSION' => '9.1',
|
79 | 79 | 'PGUSER' => 'login-user', 'PGPASSWORD' => 'login-pass' })
|
80 | 80 | end
|
|
99 | 99 | it { is_expected.to contain_postgresql__server__role('test') }
|
100 | 100 | it 'has create role for "test" user with password as ****' do
|
101 | 101 | is_expected.to contain_postgresql_psql('CREATE ROLE test ENCRYPTED PASSWORD ****')
|
102 |
| - .with('command' => "CREATE ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD' LOGIN NOCREATEROLE NOCREATEDB NOSUPERUSER CONNECTION LIMIT -1", |
103 |
| - 'environment' => 'NEWPGPASSWD=new-pa$s', 'unless' => "SELECT 1 FROM pg_roles WHERE rolname = 'test'", |
104 |
| - 'connect_settings' => { 'PGHOST' => 'postgres-db-server', 'DBVERSION' => '9.1', |
105 |
| - 'PGPORT' => '1234', 'PGUSER' => 'login-user', 'PGPASSWORD' => 'login-pass' }) |
| 102 | + .with('command' => 'Sensitive [value redacted]', |
| 103 | + 'sensitive' => 'true', 'unless' => "SELECT 1 FROM pg_roles WHERE rolname = 'test'", |
| 104 | + 'connect_settings' => { 'PGHOST' => 'postgres-db-server', 'DBVERSION' => '9.1', |
| 105 | + 'PGPORT' => '1234', 'PGUSER' => 'login-user', 'PGPASSWORD' => 'login-pass' }) |
106 | 106 | end
|
107 | 107 | it 'has alter role for "test" user with password as ****' do
|
108 | 108 | is_expected.to contain_postgresql_psql('ALTER ROLE test ENCRYPTED PASSWORD ****')
|
109 |
| - .with('command' => "ALTER ROLE \"test\" ENCRYPTED PASSWORD '$NEWPGPASSWD'", 'environment' => 'NEWPGPASSWD=new-pa$s', |
110 |
| - 'unless' => "SELECT 1 FROM pg_shadow WHERE usename = 'test' AND passwd = 'md5b6f7fcbbabb4befde4588a26c1cfd2fa'", |
| 109 | + .with('command' => 'Sensitive [value redacted]', 'sensitive' => 'true', |
| 110 | + 'unless' => 'Sensitive [value redacted]', |
111 | 111 | 'connect_settings' => { 'PGHOST' => 'postgres-db-server', 'DBVERSION' => '9.1',
|
112 | 112 | 'PGPORT' => '1234', 'PGUSER' => 'login-user', 'PGPASSWORD' => 'login-pass' })
|
113 | 113 | end
|
|
0 commit comments