[Rt-commit] rt branch, 5.0/disable-password-option-for-authtoken, updated. rt-5.0.0-4-gfe67f7888f

Aaron Trevena ast at bestpractical.com
Mon Aug 3 12:19:24 EDT 2020


The branch, 5.0/disable-password-option-for-authtoken has been updated
       via  fe67f7888fe0c407f38a896bab0184af26412885 (commit)
       via  90bbcae9197211f93fab00ae58716a2d95828870 (commit)
      from  eada50f40613a7651bd1d315e091ee899e489fa5 (commit)

Summary of changes:
 lib/RT/Config.pm                              | 3 ++-
 share/html/Admin/Tools/Config/Elements/Option | 2 +-
 share/html/Admin/Tools/Configuration.html     | 5 +++--
 share/html/Admin/Tools/EditConfig.html        | 3 ++-
 4 files changed, 8 insertions(+), 5 deletions(-)

- Log -----------------------------------------------------------------
commit 90bbcae9197211f93fab00ae58716a2d95828870
Author: Aaron Trevena <ast at bestpractical.com>
Date:   Mon Aug 3 17:18:23 2020 +0100

    Add flag to not hide configuration otherwise masked as password

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 79e54f1ad1..8bfcf96db5 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1727,6 +1727,7 @@ our %META;
     },
     MinimumPasswordLength => {
         Widget => '/Widgets/Form/Integer',
+        DoNotObfuscate => 1,
     },
     MoreAboutRequestorGroupsLimit => {
         Widget => '/Widgets/Form/Integer',
diff --git a/share/html/Admin/Tools/Config/Elements/Option b/share/html/Admin/Tools/Config/Elements/Option
index f10e84e284..7cfd7576b9 100644
--- a/share/html/Admin/Tools/Config/Elements/Option
+++ b/share/html/Admin/Tools/Config/Elements/Option
@@ -66,7 +66,7 @@ $doc_version =~ s/\.\d+-\d+-g\w+$//;  # 4.4.3-1-g123 -> 4.4
 my $name = $option->{Name};
 my $meta = RT->Config->Meta( $name );
 return if $meta->{Invisible} || $meta->{Deprecated};
-return if $name =~ /Password/i && $name !~ /MinimumPasswordLength/;
+return if ($name =~ /Password/i and not (defined $meta->{DoNotObfuscate} && $meta->{DoNotObfuscate}) );
 
 my $has_execute_code = $session{CurrentUser}->HasRight(Right => 'ExecuteCode', Object => RT->System);
 
diff --git a/share/html/Admin/Tools/Configuration.html b/share/html/Admin/Tools/Configuration.html
index 5e6cdce28b..958740f9e7 100644
--- a/share/html/Admin/Tools/Configuration.html
+++ b/share/html/Admin/Tools/Configuration.html
@@ -91,7 +91,7 @@ foreach my $key ( RT->Config->Options( Overridable => undef, Sorted => 0 ) ) {
   <div class="form-row <% $index_conf%2 ? 'oddline' : 'evenline'%>">
     <div class="value col-4 collection-as-table"><% $key %></div>
     <div class="value col-4 collection-as-table">
-% if ( $key =~ /Password/i and $key !~ /MinimumPasswordLength/ ) {
+% if ( $key =~ /Password/i and not (defined $meta->{DoNotObfuscate} && $meta->{DoNotObfuscate} ) ) {
 <em><% loc('Password not printed' ) %></em>\
 % } else {
 <% stringify($val) |n %>\
@@ -123,11 +123,12 @@ my $index_var;
 foreach my $key ( sort keys %{*RT::} ) {
     next if !${'RT::'.$key} || ref ${'RT::'.$key} || $config_opt{ $key };
     $index_var++;
+    my $meta = RT->Config->Meta( $key );
 </%PERL>
       <div class="form-row collection-as-table <% $index_var%2 ? 'oddline' : 'evenline'%>">
         <div class="value col-6 collection-as-table">RT::<% $key %></div>
         <div class="value col-6 collection-as-table">
-% if ( $key =~ /Password(?!Length)/i ) { 
+% if ($key =~ /Password/i and not (defined $meta->{DoNotObfuscate} && $meta->{DoNotObfuscate})) {
 <em><% loc('Password not printed' ) %></em>\
 % } else {
 <% ${'RT::'.$key} %>
diff --git a/share/html/Admin/Tools/EditConfig.html b/share/html/Admin/Tools/EditConfig.html
index 2a33c93348..872f30357d 100644
--- a/share/html/Admin/Tools/EditConfig.html
+++ b/share/html/Admin/Tools/EditConfig.html
@@ -94,7 +94,8 @@ if (delete $ARGS{Update}) {
                 next if !!$val eq !!$prev;
             }
 
-            if ( $meta->{Immutable} || $meta->{Obfuscate} || ($key =~ /Password/i and $key !~ /MinimumPasswordLength/ )) {
+            if ( $meta->{Immutable} || $meta->{Obfuscate}
+                     || ($key =~ /Password/i and not (defined $meta->{DoNotObfuscate} && $meta->{DoNotObfuscate} )) ) {
                 push @results, loc("Cannot change [_1]: Permission Denied", $key);
                 $has_error++;
                 next;

commit fe67f7888fe0c407f38a896bab0184af26412885
Author: Aaron Trevena <ast at bestpractical.com>
Date:   Mon Aug 3 14:40:10 2020 +0100

    Add flag to not hide new field to disable password for auth tokens

diff --git a/lib/RT/Config.pm b/lib/RT/Config.pm
index 8bfcf96db5..2730d73026 100644
--- a/lib/RT/Config.pm
+++ b/lib/RT/Config.pm
@@ -1293,9 +1293,9 @@ our %META;
     DisablePasswordForAuthToken => {
         Immutable => 1,
         Widget    => '/Widgets/Form/Boolean',
+        DoNotObfuscate => 1,
     },
 
-
     ExternalSettings => {
         Immutable     => 1,
         Obfuscate => sub {

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


More information about the rt-commit mailing list