[Rt-commit] rt branch, 4.4/test-obfuscated-config, created. rt-4.4.2-153-g0c76c0c06

? sunnavy sunnavy at bestpractical.com
Tue Apr 17 03:19:51 EDT 2018


The branch, 4.4/test-obfuscated-config has been created
        at  0c76c0c0662e3d6a4a6f5edb3d8480a2bc50d374 (commit)

- Log -----------------------------------------------------------------
commit 0c76c0c0662e3d6a4a6f5edb3d8480a2bc50d374
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Apr 17 15:13:46 2018 +0800

    Test RT::Config::GetObfuscated

diff --git a/t/api/config.t b/t/api/config.t
index 34b68d72a..9d9ee902d 100644
--- a/t/api/config.t
+++ b/t/api/config.t
@@ -46,4 +46,23 @@ warning_like {RT::Config->PostLoadCheck} qr{rudder},
 my @canonical_encodings = RT::Config->Get('EmailInputEncodings');
 is_deeply(\@encodings, \@canonical_encodings, 'Got correct encoding list');
 
-done_testing;
\ No newline at end of file
+RT->Config->Set(
+    ExternalSettings => {
+        'My_LDAP' => {
+            'user'          => 'rt_ldap_username',
+            'pass'          => 'rt_ldap_password',
+            'net_ldap_args' => [
+                raw => qr/^givenName/,
+            ],
+            subroutine => sub { },
+        },
+    }
+);
+
+my $external_settings = RT::Config->GetObfuscated( 'ExternalSettings', RT->SystemUser );
+is( $external_settings->{My_LDAP}{user}, 'rt_ldap_username',     'plain value' );
+is( $external_settings->{My_LDAP}{pass}, 'Password not printed', 'obfuscated password' );
+is( $external_settings->{My_LDAP}{net_ldap_args}[ 1 ], qr/^givenName/, 'regex correct' );
+is( ref $external_settings->{My_LDAP}{subroutine},     'CODE',         'subroutine type correct' );
+
+done_testing;

-----------------------------------------------------------------------


More information about the rt-commit mailing list