r35151 - in /branches/upstream/libapache2-authcassimple-perl/current: Changes MANIFEST META.yml Makefile.PL README examples/apache_conf/ examples/apache_conf/default examples/apache_www/ examples/apache_www/index.html lib/Apache2/AuthCASSimple.pm
yvesago-guest at users.alioth.debian.org
yvesago-guest at users.alioth.debian.org
Mon May 11 06:51:20 UTC 2009
Author: yvesago-guest
Date: Mon May 11 06:51:08 2009
New Revision: 35151
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=35151
Log:
[svn-upgrade] Integrating new upstream version, libapache2-authcassimple-perl (0.10)
Added:
branches/upstream/libapache2-authcassimple-perl/current/examples/apache_conf/
branches/upstream/libapache2-authcassimple-perl/current/examples/apache_conf/default
branches/upstream/libapache2-authcassimple-perl/current/examples/apache_www/
branches/upstream/libapache2-authcassimple-perl/current/examples/apache_www/index.html
Modified:
branches/upstream/libapache2-authcassimple-perl/current/Changes
branches/upstream/libapache2-authcassimple-perl/current/MANIFEST
branches/upstream/libapache2-authcassimple-perl/current/META.yml
branches/upstream/libapache2-authcassimple-perl/current/Makefile.PL
branches/upstream/libapache2-authcassimple-perl/current/README
branches/upstream/libapache2-authcassimple-perl/current/lib/Apache2/AuthCASSimple.pm
Modified: branches/upstream/libapache2-authcassimple-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/Changes?rev=35151&op=diff
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/Changes (original)
+++ branches/upstream/libapache2-authcassimple-perl/current/Changes Mon May 11 06:51:08 2009
@@ -1,4 +1,10 @@
Revision history for Perl module Apache2::AuthCASSimple
+
+0.10 Thu, 10 May 2009 11:53:07 +0200
+ - add dep on Crypt::SSLeay
+ - swap clean login_url (0.07 was a bad idea) with uri_escape
+ - fix _post_to_get with $r->read closes https://rt.cpan.org/Ticket/Display.html?id=45923
+ - add test cases in examples
0.09 Wed, 22 Apr 2009 12:33:26 +0200
- revert use of CGI, better fix up for REMOTE_USER bug
Modified: branches/upstream/libapache2-authcassimple-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/MANIFEST?rev=35151&op=diff
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/MANIFEST (original)
+++ branches/upstream/libapache2-authcassimple-perl/current/MANIFEST Mon May 11 06:51:08 2009
@@ -1,4 +1,6 @@
Changes
+examples/apache_conf/default
+examples/apache_www/index.html
examples/delete_session_data.pl
inc/Module/AutoInstall.pm
inc/Module/Install.pm
Modified: branches/upstream/libapache2-authcassimple-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/META.yml?rev=35151&op=diff
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/META.yml (original)
+++ branches/upstream/libapache2-authcassimple-perl/current/META.yml Mon May 11 06:51:08 2009
@@ -1,15 +1,14 @@
---
-abstract: 'Apache2 module to authentificate trough a CAS server'
+abstract: 'Apache2 module to authentificate through a CAS server'
author:
- 'Yves Agostini'
build_requires:
- Apache2::Connection: 0
- Apache2::Log: 0
Apache::Session::Wrapper: 0
Authen::CAS::Client: 0
Pod::Coverage: 0
Test::More: 0
- mod_perl2: 1.99
+ URI::Escape: 0
+ mod_perl2: 0
distribution_type: module
generated_by: 'Module::Install version 0.76'
license: perl
@@ -24,12 +23,12 @@
- t
- examples
requires:
- Apache2::Connection: 0
- Apache2::Log: 0
Apache::Session::Wrapper: 0
Authen::CAS::Client: 0
- mod_perl: 1.99
+ Crypt::SSLeay: 0
+ URI::Escape: 0
+ mod_perl2: 0
perl: 5.8.0
resources:
license: http://dev.perl.org/licenses/
-version: 0.09
+version: 0.10
Modified: branches/upstream/libapache2-authcassimple-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/Makefile.PL?rev=35151&op=diff
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/Makefile.PL (original)
+++ branches/upstream/libapache2-authcassimple-perl/current/Makefile.PL Mon May 11 06:51:08 2009
@@ -5,19 +5,18 @@
all_from 'lib/Apache2/AuthCASSimple.pm';
version_from 'lib/Apache2/AuthCASSimple.pm';
-requires 'mod_perl' => 1.99;
requires 'Apache::Session::Wrapper';
requires 'Authen::CAS::Client';
-requires 'Apache2::Log';
-requires 'Apache2::Connection';
+requires 'mod_perl2';
+requires 'Crypt::SSLeay';
+requires 'URI::Escape';
build_requires 'Pod::Coverage';
build_requires 'Test::More';
-build_requires 'mod_perl2' => 1.99;
build_requires 'Apache::Session::Wrapper';
build_requires 'Authen::CAS::Client';
-build_requires 'Apache2::Log';
-build_requires 'Apache2::Connection';
+build_requires 'URI::Escape';
+build_requires 'mod_perl2';
auto_install;
Modified: branches/upstream/libapache2-authcassimple-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/README?rev=35151&op=diff
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/README (original)
+++ branches/upstream/libapache2-authcassimple-perl/current/README Mon May 11 06:51:08 2009
@@ -1,10 +1,10 @@
NAME
- Apache2::AuthCASSimple - Apache2 module to authentificate trough a CAS
+ Apache2::AuthCASSimple - Apache2 module to authentificate through a CAS
server
DESCRIPTION
Apache2::AuthCASSimple is an authentication module for
- Apache2/mod_perl2. It allow you to authentificate users trough a Yale
+ Apache2/mod_perl2. It allow you to authentificate users through a Yale
CAS server. It means you don't need to give login/password if you've
already be authentificate by the CAS server, only tickets are exchanged
between Web client, Apache2 server and CAS server. If you not're
@@ -13,6 +13,8 @@
This module allow the use of simple text files for sessions.
SYNOPSIS
+ PerlOptions +GlobalRequest
+
<Location /protected>
AuthType Apache2::AuthCASSimple
PerlAuthenHandler Apache2::AuthCASSimple
@@ -21,10 +23,11 @@
PerlSetVar CASServerPath /
# PerlSetVar CASServerPort 443
# PerlSetVar CASServerNoSSL 1
- PerlSetVar CASSessionTimeout 60
+ PerlSetVar CASSessionTimeout 3660
PerlSetVar CASSessionDirectory /tmp
# PerlSetVar CASFixDirectory /
# PerlSetVar ModProxy 1
+ # PerlSetVar HTTPSServer 1
require valid-user
</Location>
@@ -77,24 +80,40 @@
ModProxy
Apache2 mod_perl2 don't be use with mod_proxy. Default is off.
+ HTTPSServer
+ If you want to keep a HTTPS server for all data. Default is 0.
+
+ OK AUTH_REQUIRED DECLINED REDIRECT SERVER_ERROR M_GET
+ Apache constants to make pod coverage happy
+
METHOD
handler
call by apache2
VERSION
- This documentation describes Apache2::AuthCASSimple version 0.0.1
+ This documentation describes Apache2::AuthCASSimple version 0.10
BUGS AND TROUBLESHOOTING
- * Old expired sessions files must be deleted with an example provided
- script : "delete_session_data.pl"
- * Apache::Session::Wrapper certainly need Apache2::Cookie
- * $r must be global for sessions with Apache::Session::Wrapper, add
+ * Old expired sessions files must be deleted with an example provided
+ script : "delete_session_data.pl"
+
+ * Apache::Session::Wrapper certainly need Apache2::Cookie
+
+ * $r must be global for sessions with Apache::Session::Wrapper, add
+
PerlOptions +GlobalRequest
in your virtualhost conf
- * Apreq module must be enable in debian
+ * Apreq module must be enable in debian
+
+ a2enmod apreq
+
+ or add
+
LoadModule apreq_module /usr/lib/apache2/modules/mod_apreq2.so
+
+ in your apache configuration file
Please submit any bug reports to agostini at univ-metz.fr.
@@ -110,7 +129,7 @@
http://www.crium.univ-metz.fr
COPYRIGHT
- Copyright 2008 Yves Agostini - <agostini at univ-metz.fr>
+ Copyright (c) 2009 by Yves Agostini
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
Added: branches/upstream/libapache2-authcassimple-perl/current/examples/apache_conf/default
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/examples/apache_conf/default?rev=35151&op=file
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/examples/apache_conf/default (added)
+++ branches/upstream/libapache2-authcassimple-perl/current/examples/apache_conf/default Mon May 11 06:51:08 2009
@@ -1,0 +1,49 @@
+
+<VirtualHost *:8001>
+ ServerAdmin webmaster at localhost
+
+ DocumentRoot /var/www/
+ <Directory />
+ Options FollowSymLinks
+ AllowOverride None
+ </Directory>
+ <Directory /var/www/>
+ Options Indexes FollowSymLinks MultiViews
+ AllowOverride None
+ Order allow,deny
+ allow from all
+ </Directory>
+
+ # Possible values include: debug, info, notice, warn, error, crit,
+ # alert, emerg.
+ LogLevel debug
+
+ CustomLog /var/log/apache2/access.log combined
+ ErrorLog /var/log/apache2/error.log
+
+ PerlOptions +GlobalRequest
+
+ <Location />
+ AuthType Apache2::AuthCASSimple
+ PerlAuthenHandler Apache2::AuthCASSimple
+
+ PerlSetVar CASServerName auth.univ.fr
+ PerlSetVar CASServerPath /
+ # PerlSetVar CASServerPort 443
+ # PerlSetVar CASServerNoSSL 1
+ PerlSetVar CASSessionTimeout 6
+ PerlSetVar CASSessionDirectory /tmp
+ # PerlSetVar CASFixDirectory /
+ # PerlSetVar ModProxy 1
+
+ require valid-user
+ </Location>
+
+# use mason for fun
+ <Location />
+ SetHandler perl-script
+ PerlHandler HTML::Mason::ApacheHandler
+ </Location>
+
+
+</VirtualHost>
Added: branches/upstream/libapache2-authcassimple-perl/current/examples/apache_www/index.html
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/examples/apache_www/index.html?rev=35151&op=file
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/examples/apache_www/index.html (added)
+++ branches/upstream/libapache2-authcassimple-perl/current/examples/apache_www/index.html Mon May 11 06:51:08 2009
@@ -1,0 +1,25 @@
+<html>
+<head></head>
+<body>
+% my $noun = 'World';
+ Hello <% $noun %>!
+ How are ya?
+<form action='' method='post'>
+<input type='text' name='test' value='<% $noun %> <% $test %>'>
+<input type='text' name='test2' value='2 <% $noun %> <% $test2 %>'>
+<input type='submit'>
+</form>
+<br><b>REMOTE_USER:</b> -<% $ENV{REMOTE_USER} %>-
+<br><b>$r->user():</b> -<% $r->user() %>-
+<p> <b>Direct link:</b> <a href="?test=yyyy&test2=aaa">?test=yyyy&test2=aaa</a>
+<pre>
+% foreach my $key (sort keys %ENV) {
+% print $key .' = '. $ENV{$key}."\n";
+% }
+</pre>
+</body>
+</html>
+<%args>
+$test => undef
+$test2 => undef
+</%args>
Modified: branches/upstream/libapache2-authcassimple-perl/current/lib/Apache2/AuthCASSimple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libapache2-authcassimple-perl/current/lib/Apache2/AuthCASSimple.pm?rev=35151&op=diff
==============================================================================
--- branches/upstream/libapache2-authcassimple-perl/current/lib/Apache2/AuthCASSimple.pm (original)
+++ branches/upstream/libapache2-authcassimple-perl/current/lib/Apache2/AuthCASSimple.pm Mon May 11 06:51:08 2009
@@ -9,9 +9,11 @@
use Apache::Session::Wrapper;
use Authen::CAS::Client;
use Apache2::Connection;
+use Apache2::RequestIO;
+use URI::Escape;
use vars qw($VERSION);
-$VERSION = '0.09';
+$VERSION = '0.10';
#
# handler()
@@ -66,9 +68,7 @@
}
my $requested_url = _get_requested_url($r,$mod_proxy);
- my $login_url = $requested_url;
- # TODO better clean url
- $login_url =~ s/\?/\&/;
+ my $login_url = uri_escape $requested_url;
$login_url = $cas->login_url().$login_url;
#$log->info( '==login_url==='.$login_url.'____');
@@ -100,7 +100,7 @@
unless ($user) {
$log->info(__PACKAGE__.": Unable to validate ticket ".$ticket." on CAS server.");
- $r->err_headers_out->add("Location" => $login_url);
+ $r->err_headers_out->add("Location" => $r->uri._str_args($r)); # remove ticket
return REDIRECT;
}
@@ -108,12 +108,11 @@
if ( $user ) {
$r->user($user);
- my $str_args = _str_args($r);
+ my $str_args = _str_args($r); # remove ticket
$log->info(__PACKAGE__.": New session ".$r->uri() ."--".$r->args());
# if we are there (and timeout is set), we can create session data and cookie
- _remove_ticket($r);
_create_user_session($r) if($cas_session_timeout >= 0);
$log->debug("Location => ".$r->uri . ($str_args ? '?' . $str_args : ''));
$r->err_headers_out->add("Location" => $r->uri . ($str_args ? '?' . $str_args : '') );
@@ -142,7 +141,6 @@
foreach (sort {$a cmp $b} keys(%args)) {
next if ($_ eq 'ticket' && !$keep_ticket);
my $str = $args{$_};
- $str =~ s/([^A-Za-z0-9])/sprintf("%%%02X", ord($1))/seg;
push(@qs, $_."=".$str);
}
@@ -193,7 +191,8 @@
sub _post_to_get ($) {
my $r = shift;
- my $content = _str_args($r,1);
+ my $content;
+ $r->read($content,$r->headers_in->{'Content-length'});
$r->log()->info('POST to GET: '.$content);
$r->method("GET");
@@ -320,11 +319,11 @@
=head1 NAME
-Apache2::AuthCASSimple - Apache2 module to authentificate trough a CAS server
+Apache2::AuthCASSimple - Apache2 module to authentificate through a CAS server
=head1 DESCRIPTION
-Apache2::AuthCASSimple is an authentication module for Apache2/mod_perl2. It allow you to authentificate users trough a Yale CAS server. It means you don't need to give login/password if you've already be authentificate by the CAS server, only tickets are exchanged between Web client, Apache2 server and CAS server. If you not're authentificate yet, you'll be redirect on the CAS server login form.
+Apache2::AuthCASSimple is an authentication module for Apache2/mod_perl2. It allow you to authentificate users through a Yale CAS server. It means you don't need to give login/password if you've already be authentificate by the CAS server, only tickets are exchanged between Web client, Apache2 server and CAS server. If you not're authentificate yet, you'll be redirect on the CAS server login form.
This module allow the use of simple text files for sessions.
@@ -425,7 +424,7 @@
=head1 VERSION
-This documentation describes Apache2::AuthCASSimple version 0.09
+This documentation describes Apache2::AuthCASSimple version 0.10
=head1 BUGS AND TROUBLESHOOTING
More information about the Pkg-perl-cvs-commits
mailing list