[Rt-commit] rt branch, 5.0/core-rt-authentoken, repushed

Craig Kaiser craig at bestpractical.com
Thu May 7 14:22:11 EDT 2020


The branch 5.0/core-rt-authentoken was deleted and repushed:
       was 0b60bb02603020a6a22c6bb9c1d1f5cafc11a58c
       now 9f53bca7004de07d001916eeb03777edd8ed5219

1: 7043b5c06d = 1: 7043b5c06d Core RT::Authen::Token
2: 6bc02ace62 = 2: 6bc02ace62 Migrate to elevator theme
3: 0b60bb0260 ! 3: db91f74aa3 Migrate Authen-Token code to work like other RT pages
    @@ -1,6 +1,199 @@
     Author: Craig <craig at bestpractical.com>
     
         Migrate Authen-Token code to work like other RT pages
    +
    +diff --git a/lib/RT/Authen/Token.pm b/lib/RT/Authen/Token.pm
    +--- a/lib/RT/Authen/Token.pm
    ++++ b/lib/RT/Authen/Token.pm
    +@@
    + Apache configuration to allow RT to access the Authorization header.
    + 
    +     SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1
    ++
    + =cut
    + 
    + 1;
    +
    +diff --git a/lib/RT/Authen/Token/AuthToken.pm b/lib/RT/Authen/Token/AuthToken.pm
    +--- a/lib/RT/Authen/Token/AuthToken.pm
    ++++ b/lib/RT/Authen/Token/AuthToken.pm
    +@@
    ++# BEGIN BPS TAGGED BLOCK {{{
    ++#
    ++# COPYRIGHT:
    ++#
    ++# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
    ++#                                          <sales at bestpractical.com>
    ++#
    ++# (Except where explicitly superseded by other copyright notices)
    ++#
    ++#
    ++# LICENSE:
    ++#
    ++# This work is made available to you under the terms of Version 2 of
    ++# the GNU General Public License. A copy of that license should have
    ++# been provided with this software, but in any event can be snarfed
    ++# from www.gnu.org.
    ++#
    ++# This work is distributed in the hope that it will be useful, but
    ++# WITHOUT ANY WARRANTY; without even the implied warranty of
    ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    ++# General Public License for more details.
    ++#
    ++# You should have received a copy of the GNU General Public License
    ++# along with this program; if not, write to the Free Software
    ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    ++# 02110-1301 or visit their web page on the internet at
    ++# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
    ++#
    ++#
    ++# CONTRIBUTION SUBMISSION POLICY:
    ++#
    ++# (The following paragraph is not intended to limit the rights granted
    ++# to you to modify and distribute this software under the terms of
    ++# the GNU General Public License and is only of importance to you if
    ++# you choose to contribute your changes and enhancements to the
    ++# community by submitting them to Best Practical Solutions, LLC.)
    ++#
    ++# By intentionally submitting any modifications, corrections or
    ++# derivatives to this work, or any other work intended for use with
    ++# Request Tracker, to Best Practical Solutions, LLC, you confirm that
    ++# you are the copyright holder for those contributions and you grant
    ++# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
    ++# royalty-free, perpetual, license to use, copy, create derivative
    ++# works based on those contributions, and sublicense and distribute
    ++# those contributions and any derivatives thereof.
    ++#
    ++# END BPS TAGGED BLOCK }}}
    ++
    + use strict;
    + use warnings;
    + use 5.10.1;
    +
    +diff --git a/lib/RT/Authen/Token/AuthTokens.pm b/lib/RT/Authen/Token/AuthTokens.pm
    +--- a/lib/RT/Authen/Token/AuthTokens.pm
    ++++ b/lib/RT/Authen/Token/AuthTokens.pm
    +@@
    +-use strict;
    +-use warnings;
    +-
    +-package RT::AuthTokens;
    +-use base 'RT::SearchBuilder';
    ++# BEGIN BPS TAGGED BLOCK {{{
    ++#
    ++# COPYRIGHT:
    ++#
    ++# This software is Copyright (c) 1996-2019 Best Practical Solutions, LLC
    ++#                                          <sales at bestpractical.com>
    ++#
    ++# (Except where explicitly superseded by other copyright notices)
    ++#
    ++#
    ++# LICENSE:
    ++#
    ++# This work is made available to you under the terms of Version 2 of
    ++# the GNU General Public License. A copy of that license should have
    ++# been provided with this software, but in any event can be snarfed
    ++# from www.gnu.org.
    ++#
    ++# This work is distributed in the hope that it will be useful, but
    ++# WITHOUT ANY WARRANTY; without even the implied warranty of
    ++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    ++# General Public License for more details.
    ++#
    ++# You should have received a copy of the GNU General Public License
    ++# along with this program; if not, write to the Free Software
    ++# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    ++# 02110-1301 or visit their web page on the internet at
    ++# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
    ++#
    ++#
    ++# CONTRIBUTION SUBMISSION POLICY:
    ++#
    ++# (The following paragraph is not intended to limit the rights granted
    ++# to you to modify and distribute this software under the terms of
    ++# the GNU General Public License and is only of importance to you if
    ++# you choose to contribute your changes and enhancements to the
    ++# community by submitting them to Best Practical Solutions, LLC.)
    ++#
    ++# By intentionally submitting any modifications, corrections or
    ++# derivatives to this work, or any other work intended for use with
    ++# Request Tracker, to Best Practical Solutions, LLC, you confirm that
    ++# you are the copyright holder for those contributions and you grant
    ++# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
    ++# royalty-free, perpetual, license to use, copy, create derivative
    ++# works based on those contributions, and sublicense and distribute
    ++# those contributions and any derivatives thereof.
    ++#
    ++# END BPS TAGGED BLOCK }}}
    + 
    + =head1 NAME
    + 
    +@@
    + 
    + =cut
    + 
    ++use strict;
    ++use warnings;
    ++
    ++package RT::AuthTokens;
    ++use base 'RT::SearchBuilder';
    ++
    + =head2 LimitOwner
    + 
    + Limit Owner
    +
    +diff --git a/lib/RT/Interface/Web/MenuBuilder.pm b/lib/RT/Interface/Web/MenuBuilder.pm
    +--- a/lib/RT/Interface/Web/MenuBuilder.pm
    ++++ b/lib/RT/Interface/Web/MenuBuilder.pm
    +@@
    +         $page->child( history => title => loc('History'), path => "/Admin/Tools/ConfigHistory.html" );
    +     }
    + 
    ++    if ( $request_path =~ m{^/Prefs/AuthTokens} ) {
    ++        $page->child( select_auth_token => title => loc('Select'), path => '/Prefs/AuthTokens.html');
    ++        $page->child( create_auth_token => title => loc('Create'),
    ++            raw_html => q[<a class="btn menu-item" href="#create-auth-token" data-toggle="modal" rel="modal:open">].loc("Create")."</a>"
    ++        );
    ++    }
    ++
    +     # due to historical reasons of always having been in /Elements/Tabs
    +     $HTML::Mason::Commands::m->callback( CallbackName => 'Privileged', Path => $request_path, Search_Args => $args, Has_Query => $has_query, ARGSRef => \%args, CallbackPage => '/Elements/Tabs' );
    + }
    +@@
    +                     $page->child( keys    => title => loc('Private keys'),   path => "/Admin/Users/Keys.html?id=" . $id );
    +                 }
    +                 $page->child( 'summary'   => title => loc('User Summary'),   path => "/User/Summary.html?id=" . $id );
    ++
    ++                my $auth_tokens = $page->child(auth_tokens => title => loc('Auth Tokens'), path => '/Admin/Users/AuthTokens.html?id=' . $id);
    ++                $auth_tokens->child( select_auth_token => title => loc('Select'), path => '/Admin/Users/AuthTokens.html');
    ++                $auth_tokens->child( create_auth_token => title => loc('Create'),
    ++                    raw_html => q[<a class="btn menu-item" href="#create-auth-token" data-toggle="modal" rel="modal:open">].loc("Create")."</a>"
    ++                );
    +             }
    +         }
    + 
    +@@
    +             $page->child( create => title => loc('Create'), path => "/Admin/Articles/Classes/Modify.html?Create=1" );
    +         }
    +     }
    +-
    +-    my $request_path_token = $request_path =~ s!/{2,}!/!g;
    +-    if ( $request_path_token =~ m{^(/Admin/Users|/User/(Summary|History)\.html)} and $admin->child("users") ) {
    +-        if ( $HTML::Mason::Commands::DECODED_ARGS->{'id'} && $HTML::Mason::Commands::DECODED_ARGS->{'id'} =~ /^\d+$/ ) {
    +-            my $id = $HTML::Mason::Commands::DECODED_ARGS->{'id'};
    +-            my $obj = RT::User->new( $HTML::Mason::Commands::session{'CurrentUser'} );
    +-            $obj->Load($id);
    +-
    +-            if ( $obj and $obj->id ) {
    +-                my $tabs = PageMenu();
    +-                $tabs->child(auth_tokens => title => loc('Auth Tokens'), path => '/Admin/Users/AuthTokens.html?id=' . $id);
    +-            }
    +-        }
    +-    }
    + }
    + 
    + sub BuildSelfServiceNav {
     
     diff --git a/share/html/Admin/Users/AuthToken/Create.html b/share/html/Admin/Users/AuthToken/Create.html
     new file mode 100644
    @@ -753,6 +946,30 @@
     -% }
     -</div>
     
    +diff --git a/share/html/Helpers/AuthToken/Create b/share/html/Helpers/AuthToken/Create
    +deleted file mode 100644
    +--- a/share/html/Helpers/AuthToken/Create
    ++++ /dev/null
    +@@
    +-<& /Elements/AuthToken/CreateResults, %ARGS &>
    +-% $m->abort;
    +
    +diff --git a/share/html/Helpers/AuthToken/List b/share/html/Helpers/AuthToken/List
    +deleted file mode 100644
    +--- a/share/html/Helpers/AuthToken/List
    ++++ /dev/null
    +@@
    +-<& /Elements/AuthToken/List, Owner => $ARGS{owner} &>
    +-% $m->abort;
    +
    +diff --git a/share/html/Helpers/AuthToken/Modify b/share/html/Helpers/AuthToken/Modify
    +deleted file mode 100644
    +--- a/share/html/Helpers/AuthToken/Modify
    ++++ /dev/null
    +@@
    +-<& /Elements/AuthToken/ModifyResults, %ARGS &>
    +-% $m->abort;
    +
     diff --git a/share/html/Prefs/AuthTokens.html b/share/html/Prefs/AuthTokens.html
     --- a/share/html/Prefs/AuthTokens.html
     +++ b/share/html/Prefs/AuthTokens.html
    @@ -924,3 +1141,4 @@
     +    jQuery('#auth-token-auth-string').modal('show');
      });
     -
    +
-:  ------- > 4: 9f53bca700 Add documentation for using token auth



More information about the rt-commit mailing list