[Bps-public-commit] rt-authen-token branch, master, updated. f62c32b6dca072865360dfde91d10287aa2f0420
Shawn Moore
shawn at bestpractical.com
Thu Jul 20 10:19:55 EDT 2017
The branch, master has been updated
via f62c32b6dca072865360dfde91d10287aa2f0420 (commit)
via 80f7f86e5b7b9eedd3310c33dcab82488ec4da8f (commit)
from 330116bb6d94baffac06efe9fb8dbf59824ffb5d (commit)
Summary of changes:
META.yml | 2 +-
README | 34 +++++++++++++++++++++++++++-
inc/Module/Install.pm | 51 +++++++++++++-----------------------------
inc/Module/Install/Base.pm | 2 +-
inc/Module/Install/Can.pm | 13 +++++++++--
inc/Module/Install/Fetch.pm | 2 +-
inc/Module/Install/Include.pm | 2 +-
inc/Module/Install/Makefile.pm | 4 ++--
inc/Module/Install/Metadata.pm | 6 ++---
inc/Module/Install/Win32.pm | 2 +-
inc/Module/Install/WriteAll.pm | 2 +-
lib/RT/Authen/Token.pm | 35 +++++++++++++++++++++++++++++
12 files changed, 106 insertions(+), 49 deletions(-)
- Log -----------------------------------------------------------------
commit 80f7f86e5b7b9eedd3310c33dcab82488ec4da8f
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Thu Jul 20 14:08:37 2017 +0000
Regenerate build toolchain
diff --git a/META.yml b/META.yml
index 264d548..926924b 100644
--- a/META.yml
+++ b/META.yml
@@ -8,7 +8,7 @@ configure_requires:
ExtUtils::MakeMaker: 6.59
distribution_type: module
dynamic_config: 1
-generated_by: 'Module::Install version 1.06'
+generated_by: 'Module::Install version 1.18'
license: gpl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
diff --git a/README b/README
index a4a19c0..f449bf0 100644
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
RT-Authen-Token - token-based authentication
INSTALLATION
- RT-Authen-Token requires version RT 4.2.0 or later.
+ RT-Authen-Token requires version RT 4.2.5 or later.
perl Makefile.PL
make
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 4ecf46b..07525c5 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -17,7 +17,7 @@ package Module::Install;
# 3. The ./inc/ version of Module::Install loads
# }
-use 5.005;
+use 5.006;
use strict 'vars';
use Cwd ();
use File::Find ();
@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
- $VERSION = '1.06';
+ $VERSION = '1.18';
# Storage for the pseudo-singleton
$MAIN = undef;
@@ -156,10 +156,10 @@ END_DIE
sub autoload {
my $self = shift;
my $who = $self->_caller;
- my $cwd = Cwd::cwd();
+ my $cwd = Cwd::getcwd();
my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
- my $pwd = Cwd::cwd();
+ my $pwd = Cwd::getcwd();
if ( my $code = $sym->{$pwd} ) {
# Delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
@@ -239,11 +239,13 @@ sub new {
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
- unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
+ unless ( Cwd::abs_path(Cwd::getcwd()) eq $base_path ) {
delete $args{prefix};
}
return $args{_self} if $args{_self};
+ $base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';
+
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
$args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
@@ -322,7 +324,7 @@ sub find_extensions {
my ($self, $path) = @_;
my @found;
- File::Find::find( sub {
+ File::Find::find( {no_chdir => 1, wanted => sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
my $subpath = $1;
@@ -336,9 +338,9 @@ sub find_extensions {
# correctly. Otherwise, root through the file to locate the case-preserved
# version of the package name.
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
- my $content = Module::Install::_read($subpath . '.pm');
+ my $content = Module::Install::_read($File::Find::name);
my $in_pod = 0;
- foreach ( split //, $content ) {
+ foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
$in_pod = 0 if /^=cut/;
next if ($in_pod || /^=cut/); # skip pod text
@@ -351,7 +353,7 @@ sub find_extensions {
}
push @found, [ $file, $pkg ];
- }, $path ) if -d $path;
+ }}, $path ) if -d $path;
@found;
}
@@ -373,24 +375,14 @@ sub _caller {
return $call;
}
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
+ binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
}
-END_NEW
-sub _read {
- local *FH;
- open( FH, "< $_[0]" ) or die "open($_[0]): $!";
- my $string = do { local $/; <FH> };
- close FH or die "close($_[0]): $!";
- return $string;
-}
-END_OLD
sub _readperl {
my $string = Module::Install::_read($_[0]);
@@ -411,30 +403,19 @@ sub _readpod {
return $string;
}
-# Done in evals to avoid confusing Perl::MinimumVersion
-eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
+ binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
-END_NEW
-sub _write {
- local *FH;
- open( FH, "> $_[0]" ) or die "open($_[0]): $!";
- foreach ( 1 .. $#_ ) {
- print FH $_[$_] or die "print($_[0]): $!";
- }
- close FH or die "close($_[0]): $!";
-}
-END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
-sub _version ($) {
+sub _version {
my $s = shift || 0;
my $d =()= $s =~ /(\.)/g;
if ( $d >= 2 ) {
@@ -450,12 +431,12 @@ sub _version ($) {
return $l + 0;
}
-sub _cmp ($$) {
+sub _cmp {
_version($_[1]) <=> _version($_[2]);
}
# Cloned from Params::Util::_CLASS
-sub _CLASS ($) {
+sub _CLASS {
(
defined $_[0]
and
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 802844a..b61d424 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
}
# Suspend handler for "redefined" warnings
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index 22167b8..1de368c 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -121,6 +121,15 @@ END_C
# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
+
+ if ($^O eq 'VMS') {
+ require ExtUtils::CBuilder;
+ my $builder = ExtUtils::CBuilder->new(
+ quiet => 1,
+ );
+ return $builder->have_compiler;
+ }
+
my @chunks = split(/ /, $Config::Config{cc}) or return;
# $Config{cc} may contain args; try to find out the program part
@@ -151,4 +160,4 @@ if ( $^O eq 'cygwin' ) {
__END__
-#line 236
+#line 245
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index bee0c4f..54b52cb 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Include.pm b/inc/Module/Install/Include.pm
index 8310e4c..087da8d 100644
--- a/inc/Module/Install/Include.pm
+++ b/inc/Module/Install/Include.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 7052f36..8ba3d88 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -133,7 +133,7 @@ sub makemaker_args {
return $args;
}
-# For mm args that take multiple space-seperated args,
+# For mm args that take multiple space-separated args,
# append an argument to the current list.
sub makemaker_append {
my $self = shift;
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index 58430f3..692ce71 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
@@ -347,7 +347,7 @@ sub name_from {
^ \s*
package \s*
([\w:]+)
- \s* ;
+ [\s|;]*
/ixms
) {
my ($name, $module_name) = ($1, $1);
@@ -705,7 +705,7 @@ sub _write_mymeta_data {
my @yaml = Parse::CPAN::Meta::LoadFile('META.yml');
my $meta = $yaml[0];
- # Overwrite the non-configure dependency hashs
+ # Overwrite the non-configure dependency hashes
delete $meta->{requires};
delete $meta->{build_requires};
delete $meta->{recommends};
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index eeaa3fe..b80c900 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 85d8018..da279c7 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
- $VERSION = '1.06';
+ $VERSION = '1.18';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
commit f62c32b6dca072865360dfde91d10287aa2f0420
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Thu Jul 20 14:19:49 2017 +0000
Additional docs
diff --git a/README b/README
index f449bf0..e606839 100644
--- a/README
+++ b/README
@@ -1,6 +1,29 @@
NAME
RT-Authen-Token - token-based authentication
+DESCRIPTION
+ This module adds the ability for users to generate and login with
+ authentication tokens. Users with the ManageAuthTokens permission will
+ see a new "Auth Tokens" menu item under "Logged in as ____" -> Settings.
+ On that page they will be able to generate new tokens and modify or
+ revoke existing tokens.
+
+ Once you have an authentication token, you may use it in place of a
+ password to log into RT. (Additionally, RT::Extension::REST2 allows for
+ using auth tokens with the Authorization: token HTTP header.) One common
+ use case is to use an authentication token as an application-specific
+ password, so that you may revoke that application's access without
+ disturbing other applications. You also need not change your password,
+ since the application never received it.
+
+ If you have the AdminUsers permission, along with ManageAuthTokens, you
+ may generate, modify, and revoke tokens for other users as well by
+ visiting Admin -> Users -> Select -> (user) -> Auth Tokens.
+
+ Authentication tokens are stored securely (hashed and salted) in the
+ database just like passwords, and so cannot be recovered after they are
+ generated.
+
INSTALLATION
RT-Authen-Token requires version RT 4.2.5 or later.
@@ -9,6 +32,15 @@ INSTALLATION
make install
This step may require root permissions.
+ make initdb
+ Only run this the first time you install this module.
+
+ If you run this twice, you will end up with duplicate data in your
+ database.
+
+ If you are upgrading this module, check for upgrading instructions
+ in case changes need to be made to your database.
+
Edit your /opt/rt4/etc/RT_SiteConfig.pm
Add this line:
diff --git a/lib/RT/Authen/Token.pm b/lib/RT/Authen/Token.pm
index 0100aa9..86fbf4a 100644
--- a/lib/RT/Authen/Token.pm
+++ b/lib/RT/Authen/Token.pm
@@ -46,6 +46,31 @@ sub UserForAuthString {
RT-Authen-Token - token-based authentication
+=head1 DESCRIPTION
+
+This module adds the ability for users to generate and login with
+authentication tokens. Users with the C<ManageAuthTokens> permission
+will see a new "Auth Tokens" menu item under "Logged in as ____" ->
+Settings. On that page they will be able to generate new tokens and
+modify or revoke existing tokens.
+
+Once you have an authentication token, you may use it in place of a
+password to log into RT. (Additionally, L<RT::Extension::REST2> allows
+for using auth tokens with the C<Authorization: token> HTTP header.) One
+common use case is to use an authentication token as an
+application-specific password, so that you may revoke that application's
+access without disturbing other applications. You also need not change
+your password, since the application never received it.
+
+If you have the C<AdminUsers> permission, along with
+C<ManageAuthTokens>, you may generate, modify, and revoke tokens for
+other users as well by visiting Admin -> Users -> Select -> (user) ->
+Auth Tokens.
+
+Authentication tokens are stored securely (hashed and salted) in the
+database just like passwords, and so cannot be recovered after they are
+generated.
+
=head1 INSTALLATION
RT-Authen-Token requires version RT 4.2.5 or later.
@@ -60,6 +85,16 @@ RT-Authen-Token requires version RT 4.2.5 or later.
This step may require root permissions.
+=item make initdb
+
+Only run this the first time you install this module.
+
+If you run this twice, you will end up with duplicate data
+in your database.
+
+If you are upgrading this module, check for upgrading instructions
+in case changes need to be made to your database.
+
=item Edit your /opt/rt4/etc/RT_SiteConfig.pm
Add this line:
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list