[Bps-public-commit] rt-authen-externalauth branch, master, updated. 0.17-3-g3b19f7d

Kevin Falcone falcone at bestpractical.com
Fri Mar 7 17:18:38 EST 2014


The branch, master has been updated
       via  3b19f7ddf2ecea87fe2e338ed931a1245e3606a4 (commit)
       via  9662d717617ee77c24817ba064345a9c3b6e7130 (commit)
      from  4214e8c4d45f8afe0c39b766ca2e563ae7506cf6 (commit)

Summary of changes:
 ChangeLog                           |  3 ++
 META.yml                            |  2 +-
 etc/RT_SiteConfig.pm                | 47 -------------------------
 inc/Module/Install/RTx.pm           | 69 ++++++++++++++++++++++---------------
 inc/Module/Install/ReadmeFromPod.pm |  2 +-
 lib/RT/Authen/ExternalAuth.pm       |  2 +-
 6 files changed, 47 insertions(+), 78 deletions(-)

- Log -----------------------------------------------------------------
commit 9662d717617ee77c24817ba064345a9c3b6e7130
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Mar 7 16:53:18 2014 -0500

    Remove erroneous docs.
    
    These were written on the docs-improvements branch and describe code
    from the multiple-emails branch, which has not been merged.
    
    Shipping these docs makes end users believe that this extension contains
    code that it does not.
    
    The docs have been moved to the tip of multiple-emails.  They will
    re-enter when that branch is merged.

diff --git a/etc/RT_SiteConfig.pm b/etc/RT_SiteConfig.pm
index c539d23..801409a 100644
--- a/etc/RT_SiteConfig.pm
+++ b/etc/RT_SiteConfig.pm
@@ -156,53 +156,6 @@ For example, an LDAP mapping might look like:
         ...
     },
 
-Since version 0.10 it's possible to map one RT field to multiple
-external attributes, for example:
-
-    attr_map => {
-        EmailAddress => ['mail', 'alias'],
-        ...
-    },
-
-Note that only one value is stored in RT, so this doesn't enable RT
-users to have multiple email addresses defined. However, the search
-will use all of the attributes to try to match a user if the field is
-defined in the C<attr_match_list>.
-
-On create or update, the original value input by the user, from an email
-or login attempt, is used as long as it's valid. If user didn't enter a
-value for that attribute, then the value retrieved from the first external
-attribute is used.
-
-For example, for the following configuration:
-
-    attr_match_list => ['Name', 'EmailAddress'],
-    attr_map => {
-        Name         => 'account',
-        EmailAddress => ['mail', 'alias'],
-        ...
-    },
-
-If a new user sent an email to RT from an email alias, the search
-would match on the alias and that alias would be set as the user's
-EmailAddress in RT when the new account is created.
-
-However, if a user with an existing RT account with EmailAddress set to the
-C<mail> address, sent mail from C<alias>, it would still match. The user's
-EmailAddress in RT would remain the primary C<mail> address.
-
-This feature is useful for LDAP configurations where users have
-a primary institutional email address, but might also use aliases from
-subdomains or other email services. This prevents RT from creating
-multiple accounts for the same person.
-
-If you want the RT user accounts to always have the primary C<mail>
-address for EmailAddress, you likely want to run
-L<RT::Extension::LDAPImport> to make sure the user accounts are
-created with the desired email address set.
-
-=back
-
 =back
 
 =cut

commit 3b19f7ddf2ecea87fe2e338ed931a1245e3606a4
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Fri Mar 7 17:16:12 2014 -0500

    Bump version for a release

diff --git a/ChangeLog b/ChangeLog
index 070b881..f4e9df7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,6 @@
+0.18 2014-03-07 Kevin falcone
+	- Remove docs that reference unmerged features (multiple emails)
+
 0.17	2013-07-10	Thomas Sibley
 	* Forbid using RT's internal Users table as an auth service
 
diff --git a/META.yml b/META.yml
index 314aa08..bedfd35 100644
--- a/META.yml
+++ b/META.yml
@@ -33,4 +33,4 @@ requires:
   Net::SSLeay: 0
 resources:
   license: http://opensource.org/licenses/gpl-license.php
-version: 0.17
+version: 0.18
diff --git a/inc/Module/Install/RTx.pm b/inc/Module/Install/RTx.pm
index c9fe996..469eb42 100644
--- a/inc/Module/Install/RTx.pm
+++ b/inc/Module/Install/RTx.pm
@@ -8,7 +8,7 @@ no warnings 'once';
 
 use Module::Install::Base;
 use base 'Module::Install::Base';
-our $VERSION = '0.31';
+our $VERSION = '0.32_02';
 
 use FindBin;
 use File::Glob     ();
@@ -136,6 +136,9 @@ install ::
         $has_etc{acl}++;
     }
     if ( -e 'etc/initialdata' ) { $has_etc{initialdata}++; }
+    if ( grep { /\d+\.\d+\.\d+.*$/ } glob('etc/upgrade/*.*.*') ) {
+        $has_etc{upgrade}++;
+    }
 
     $self->postamble("$postamble\n");
     unless ( $subdirs{'lib'} ) {
@@ -164,49 +167,59 @@ install ::
 .
         $self->postamble("initdb ::\n$initdb\n");
         $self->postamble("initialize-database ::\n$initdb\n");
+        if ($has_etc{upgrade}) {
+            print "To upgrade from a previous version of this extension, use 'make upgrade-database'\n";
+            my $upgradedb = qq|\t\$(NOECHO) \$(PERL) -Ilib -I"$local_lib_path" -I"$lib_path" -Minc::Module::Install -e"RTxInitDB(qw(upgrade \$(NAME) \$(VERSION)))"\n|;
+            $self->postamble("upgrade-database ::\n$upgradedb\n");
+            $self->postamble("upgradedb ::\n$upgradedb\n");
+        }
     }
 }
 
-# stolen from RT::Handle so we work on 3.6 (cmp_versions came in with 3.8)
-{ my %word = (
-    a     => -4,
-    alpha => -4,
-    b     => -3,
-    beta  => -3,
-    pre   => -2,
-    rc    => -1,
-    head  => 9999,
-);
-sub cmp_version($$) {
-    my ($a, $b) = (@_);
-    my @a = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $a;
-    my @b = grep defined, map { /^[0-9]+$/? $_ : /^[a-zA-Z]+$/? $word{$_}|| -10 : undef }
-        split /([^0-9]+)/, $b;
-    @a > @b
-        ? push @b, (0) x (@a- at b)
-        : push @a, (0) x (@b- at a);
-    for ( my $i = 0; $i < @a; $i++ ) {
-        return $a[$i] <=> $b[$i] if $a[$i] <=> $b[$i];
-    }
-    return 0;
-}}
 sub requires_rt {
     my ($self,$version) = @_;
 
     # if we're exactly the same version as what we want, silently return
     return if ($version eq $RT::VERSION);
 
-    my @sorted = sort cmp_version $version,$RT::VERSION;
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
 
     if ($sorted[-1] eq $version) {
         # should we die?
-        warn "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+        die "\nWarning: prerequisite RT $version not found. Your installed version of RT ($RT::VERSION) is too old.\n\n";
+    }
+}
+
+sub rt_too_new {
+    my ($self,$version,$msg) = @_;
+    $msg ||= "Your version %s is too new, this extension requires a release of RT older than %s\n";
+
+    _load_rt_handle();
+    my @sorted = sort RT::Handle::cmp_version $version,$RT::VERSION;
+
+    if ($sorted[0] eq $version) {
+        die sprintf($msg,$RT::VERSION,$version);
+    }
+}
+
+# RT::Handle runs FinalizeDatabaseType which calls RT->Config->Get
+# On 3.8, this dies.  On 4.0/4.2 ->Config transparently runs LoadConfig.
+# LoadConfig requires being able to read RT_SiteConfig.pm (root) so we'd
+# like to avoid pushing that on users.
+# Fake up just enough Config to let FinalizeDatabaseType finish, and
+# anyone later calling LoadConfig will overwrite our shenanigans.
+sub _load_rt_handle {
+    unless ($RT::Config) {
+        require RT::Config;
+        $RT::Config = RT::Config->new;
+        RT->Config->Set('DatabaseType','mysql');
     }
+    require RT::Handle;
 }
 
 1;
 
 __END__
 
-#line 329
+#line 362
diff --git a/inc/Module/Install/ReadmeFromPod.pm b/inc/Module/Install/ReadmeFromPod.pm
index 6a80818..b5e03c3 100644
--- a/inc/Module/Install/ReadmeFromPod.pm
+++ b/inc/Module/Install/ReadmeFromPod.pm
@@ -7,7 +7,7 @@ use warnings;
 use base qw(Module::Install::Base);
 use vars qw($VERSION);
 
-$VERSION = '0.20';
+$VERSION = '0.22';
 
 sub readme_from {
   my $self = shift;
diff --git a/lib/RT/Authen/ExternalAuth.pm b/lib/RT/Authen/ExternalAuth.pm
index 39b17cf..e0da5b1 100644
--- a/lib/RT/Authen/ExternalAuth.pm
+++ b/lib/RT/Authen/ExternalAuth.pm
@@ -1,6 +1,6 @@
 package RT::Authen::ExternalAuth;
 
-our $VERSION = '0.17';
+our $VERSION = '0.18';
 
 =head1 NAME
 

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



More information about the Bps-public-commit mailing list