From a72596bf6d09a85f7d720e5f6b8cacd9ca4cf37d Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 18 Feb 2011 12:26:41 -0500 Subject: [PATCH 01/10] Add an example script that checks the login credentials --- MANIFEST | 1 + ex/check_login.pl | 105 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100755 ex/check_login.pl diff --git a/MANIFEST b/MANIFEST index d5048b0..215c2d2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,5 +1,6 @@ Build.PL Changes +ex/check_login.pl lib/WWW/USF/WebAuth.pm LICENSE MANIFEST This list of files diff --git a/ex/check_login.pl b/ex/check_login.pl new file mode 100755 index 0000000..ce701d5 --- /dev/null +++ b/ex/check_login.pl @@ -0,0 +1,105 @@ +#!/usr/bin/env perl + +use v5.10.1; +use strict; +use warnings 'all'; + +# METADATA +our $AUTHORITY = 'cpan:DOUGDUDE'; +our $VERSION = '0.000'; + +# MODULES +use Const::Fast qw(const); +use Getopt::Long::Descriptive; +use WWW::USF::WebAuth 0.002; + +# CONSTANTS +const my $EXIT_SUCCESS => 0; +const my $EXIT_ERROR_UNKNOWNSERVICE => 19; +const my $EXIT_ERROR_IOPROMPTER => 20; +const my $EXIT_ERROR_BADPASSWORD => 30; +const my %SERVICE => ( + Blackboard_Learn => 'https://learn.usf.edu/webapps/login/', + MyUSF_Portal => 'https://usfsts.usf.edu/Login.aspx', + UNA => 'https://netid.usf.edu/una/', +); + +# COMMAND LINE OPTIONS +my ($opt, $usage) = describe_options( + '%c %o', + ['netid|username|u:s', 'the NetID to authenticate with'], + ['password|p:s', 'the NetID password'], + ['service:s', 'a service to authenticate for (some notifications are only present with a service)'], + [], + ['verbose|v', 'print extra information'], + ['help', 'print usage message and exit'], +); + +if ($opt->help) { + # Print the help message and exit successfully + print $usage->text; + exit $EXIT_SUCCESS; +} + +if ($opt->_specified('service') && !exists $SERVICE{$opt->service}) { + say 'Unknown service specified; known options are: ', join q{ }, keys %SERVICE; + exit $EXIT_ERROR_UNKNOWNSERVICE; +} + +# Get the NetID and password +my $netid = $opt->_specified('netid') ? $opt->netid : prompt_for('NetID'); +my $password = $opt->_specified('password') ? $opt->password : prompt_for('Password', 1); + +# Make the webauth object +my $webauth = WWW::USF::WebAuth->new( + netid => $netid, + password => $password, +); + +# Attempt to authenticate +say 'Authenticating with WebAuth' if $opt->verbose; +my $response = $webauth->authenticate( + ($opt->_specified('service') ? (service => $SERVICE{$opt->service}) : ()), +); + +if ($response->has_notification) { + # There is a notification to show the user + say $response->notification; +} + +if (!$response->is_success) { + say 'The supplied NetID and password combination was incorrect.'; + exit $EXIT_ERROR_BADPASSWORD; +} +else { + say 'NetID and password match'; +} + +if ($response->has_ticket_granting_cookie && $opt->verbose) { + say 'Your ticket granting cookie is ', $response->ticket_granting_cookie; +} + +exit $EXIT_SUCCESS; + +# FUNCTIONS +sub prompt_for { + my ($prompt, $hide_input) = @_; + + if (!eval 'use IO::Prompter (); 1') { + say "When IO::Prompter is not installed, please use the command-line options: $@"; + exit $EXIT_ERROR_IOPROMPTER; + } + + # Arguments to prompt + my @prompt_args = "$prompt:"; + + if ($hide_input) { + push @prompt_args, -echo => q{*}; + } + + # Prompt for the input + my $input = IO::Prompter::prompt(@prompt_args); + + # Force the input into a string + return "$input"; +} From a318e0e4cc54818c88b724c0e5e257fc5bed13c2 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 18 Feb 2011 12:28:35 -0500 Subject: [PATCH 02/10] Update year in LICENSE --- LICENSE | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/LICENSE b/LICENSE index f4499a4..541ef24 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -This software is copyright (c) 2010 by Douglas Christopher Wilson . +This software is copyright (c) 2011 by Douglas Christopher Wilson . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2010 by Douglas Christopher Wilson . +This software is Copyright (c) 2011 by Douglas Christopher Wilson . This is free software, licensed under: @@ -270,7 +270,7 @@ That's all there is to it! --- The Artistic License 1.0 --- -This software is Copyright (c) 2010 by Douglas Christopher Wilson . +This software is Copyright (c) 2011 by Douglas Christopher Wilson . This is free software, licensed under: From 06daad1541a459b848d0d6761f2de7155a709856 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 18 Feb 2011 12:29:03 -0500 Subject: [PATCH 03/10] Fix the version of a required dependency listed in Build.PL and META.yml --- Build.PL | 3 ++- META.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Build.PL b/Build.PL index a1beb07..8481f16 100644 --- a/Build.PL +++ b/Build.PL @@ -34,7 +34,7 @@ my $build = Module::Build->new( requires => { 'perl' => '5.008003', 'Authen::CAS::External' => '0.05', - 'Moose' => '0.89', + 'Moose' => '1.03', 'MooseX::Aliases' => '0.05', 'MooseX::StrictConstructor' => '0.09', 'MooseX::Types' => '0.08', @@ -53,3 +53,4 @@ my $build = Module::Build->new( $build->create_build_script; exit 0; + diff --git a/META.yml b/META.yml index ad9ad73..9f75eb5 100644 --- a/META.yml +++ b/META.yml @@ -25,7 +25,7 @@ provides: version: 0.003 requires: Authen::CAS::External: 0.05 - Moose: 0.89 + Moose: 1.03 MooseX::Aliases: 0.05 MooseX::StrictConstructor: 0.09 MooseX::Types: 0.08 From 817a32b53645e266380b541b387e60ed03dbdcda Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 27 Mar 2011 21:17:49 -0400 Subject: [PATCH 04/10] Add a dependency on the LWP https protocol --- Build.PL | 6 ++++++ META.yml | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/Build.PL b/Build.PL index 8481f16..6122d4f 100644 --- a/Build.PL +++ b/Build.PL @@ -30,10 +30,16 @@ my $build = Module::Build->new( 'Test::Requires' => '0.02', }, + # Modules that are required for configuration (this file) + configure_requires => { + 'Module::Build' => '0.31', + }, + # Module that are required requires => { 'perl' => '5.008003', 'Authen::CAS::External' => '0.05', + 'LWP::Protocol::https' => 0, 'Moose' => '1.03', 'MooseX::Aliases' => '0.05', 'MooseX::StrictConstructor' => '0.09', diff --git a/META.yml b/META.yml index 9f75eb5..834a943 100644 --- a/META.yml +++ b/META.yml @@ -7,8 +7,8 @@ build_requires: Test::More: 0 Test::Requires: 0.02 configure_requires: - Module::Build: 0.36 -generated_by: 'Module::Build version 0.3607' + Module::Build: 0.31 +generated_by: 'Module::Build version 0.3624' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html @@ -25,6 +25,7 @@ provides: version: 0.003 requires: Authen::CAS::External: 0.05 + LWP::Protocol::https: 0 Moose: 1.03 MooseX::Aliases: 0.05 MooseX::StrictConstructor: 0.09 From 109f057b952e70ee8b9f0edee94e843467e1cf79 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 27 Mar 2011 21:55:41 -0400 Subject: [PATCH 05/10] Switch Changes formatting to match CPAN::Changes --- Changes | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/Changes b/Changes index bf79c37..bff9a54 100644 --- a/Changes +++ b/Changes @@ -1,16 +1,17 @@ -Revision history for WWW-USF-WebAuth -==================================== +Revision history for Perl 5 distribution WWW-USF-WebAuth -0.003 Sun, November 21, 2010 00:51:22 -0500 - * Fix the POD tests in `xt/` to work when the POD modules are not - installed. +0.003 2010-11-21 + [BUG FIXES] + - Fix the POD tests in xt/ to work when the POD modules are not installed. -0.002 Fri, November 19, 2010 15:07:42 -0500 - * Removed dependency on `URI` and need at least 0.05 of - `Authen::CAS::External`. - * Change from `Module::Install` system to `Module::Build`. - * Fix constructor to work with children classes. - * Change from `Test::Exception` to `Test::Fatal`. +0.002 2010-11-19 + [BUG FIXES] + - Fix constructor to work with children classes. -0.001 Wed, January 20, 2010 17:18:19 -0500 - * First release. + [OTHER] + - Removed dependency on URI and need at least 0.05 of Authen::CAS::External. + - Change from Module::Install system to Module::Build. + - Change from Test::Exception to Test::Fatal. + +0.001 2010-01-20 + - Initial release. From e8b4aa1b3fe10d86a198f1692da8db245dcdb580 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Fri, 1 Apr 2011 15:00:37 -0400 Subject: [PATCH 06/10] Add text representation to the POD links --- lib/WWW/USF/WebAuth.pm | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/WWW/USF/WebAuth.pm b/lib/WWW/USF/WebAuth.pm index 12370fd..5abab9c 100644 --- a/lib/WWW/USF/WebAuth.pm +++ b/lib/WWW/USF/WebAuth.pm @@ -99,11 +99,11 @@ University of South Florida. This is fully object-oriented, and as such before any method can be used, the constructor needs to be called to create an object to work with. Please see -the documentation for L. +the documentation for L. =head1 ATTRIBUTES -Please see the documentation for L. +Please see the documentation for L. =head2 netid @@ -112,8 +112,9 @@ to the inherited C attribute. =head1 METHODS -This module provides the identical methods as L and you -should look at the documentation for the supported methods. +This module provides the identical methods as +L and you should look at the +documentation for the supported methods. =head2 clear_netid @@ -127,17 +128,17 @@ This will report if the current instance has L defined. =over 4 -=item * L 0.05 +=item * L 0.05 -=item * L 1.03 +=item * L 1.03 -=item * L 0.05 +=item * L 0.05 -=item * L 0.09 +=item * L 0.09 -=item * L +=item * L -=item * L 0.04 +=item * L 0.04 =back @@ -163,14 +164,10 @@ You can also look for information at: =over 4 -=item * RT: CPAN's request tracker +=item * RT: Request tracker for CPAN L -=item * AnnoCPAN: Annotated CPAN documentation - -L - =item * CPAN Ratings L From 8fb0dc1829f25275bc2effe0b6e7aaa37273eac1 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 23 Oct 2011 14:13:48 -0400 Subject: [PATCH 07/10] Mark dependency list as static --- .gitignore | 1 + Build.PL | 3 +++ MANIFEST | 1 + MANIFEST.SKIP | 5 ++-- META.json | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ META.yml | 3 ++- 6 files changed, 76 insertions(+), 3 deletions(-) create mode 100644 META.json diff --git a/.gitignore b/.gitignore index 8b98447..9643d88 100644 --- a/.gitignore +++ b/.gitignore @@ -5,5 +5,6 @@ Debian_CPANTS.txt Makefile Makefile.old MANIFEST.bak +MYMETA.json MYMETA.yml pm_to_blib diff --git a/Build.PL b/Build.PL index 6122d4f..aaa18ec 100644 --- a/Build.PL +++ b/Build.PL @@ -47,6 +47,9 @@ my $build = Module::Build->new( 'namespace::clean' => '0.04', }, + # The above requirements are static + dynamic_config => 0, + # Enable tests to be in multi-level directories recursive_test_files => 1, diff --git a/MANIFEST b/MANIFEST index 215c2d2..531a8cd 100644 --- a/MANIFEST +++ b/MANIFEST @@ -19,3 +19,4 @@ xt/perl-version.t xt/perlcriticrc xt/pod-coverage.t xt/pod.t +META.json diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 0ca43df..5f4bfbb 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -5,7 +5,8 @@ \ABuild\z \AMakefile(?:\.old|)?\z \AMANIFEST\.(?:bak|SKIP)\z -\AMYMETA\.yml\z \Apm_to_blib\z \ADebian_CPANTS.txt\z -\AREADME\.mkdn\z^MYMETA.yml$ +\AREADME\.mkdn\z +^MYMETA.json$ +^MYMETA.yml$ diff --git a/META.json b/META.json new file mode 100644 index 0000000..94745d1 --- /dev/null +++ b/META.json @@ -0,0 +1,66 @@ +{ + "abstract" : "Access to USF's WebAuth system", + "author" : [ + "Douglas Christopher Wilson " + ], + "dynamic_config" : 0, + "generated_by" : "Module::Build version 0.38, CPAN::Meta::Converter version 2.112150", + "license" : [ + "perl_5" + ], + "meta-spec" : { + "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", + "version" : "2" + }, + "name" : "WWW-USF-WebAuth", + "no_index" : { + "directory" : [ + "inc", + "t", + "xt" + ] + }, + "prereqs" : { + "build" : { + "requires" : { + "Test::Fatal" : 0, + "Test::More" : 0, + "Test::Requires" : "0.02" + } + }, + "configure" : { + "requires" : { + "Module::Build" : "0.31" + } + }, + "runtime" : { + "requires" : { + "Authen::CAS::External" : "0.05", + "LWP::Protocol::https" : 0, + "Moose" : "1.03", + "MooseX::Aliases" : "0.05", + "MooseX::StrictConstructor" : "0.09", + "MooseX::Types" : "0.08", + "namespace::clean" : "0.04", + "perl" : "5.008003" + } + } + }, + "provides" : { + "WWW::USF::WebAuth" : { + "file" : "lib/WWW/USF/WebAuth.pm", + "version" : "0.003" + } + }, + "release_status" : "stable", + "resources" : { + "homepage" : "http://github.com/dougwilson/perl5-www-usf-webauth/", + "license" : [ + "http://dev.perl.org/licenses/" + ], + "repository" : { + "url" : "git://github.com/dougwilson/perl5-www-usf-webauth.git" + } + }, + "version" : "0.003" +} diff --git a/META.yml b/META.yml index 834a943..c37a414 100644 --- a/META.yml +++ b/META.yml @@ -8,7 +8,8 @@ build_requires: Test::Requires: 0.02 configure_requires: Module::Build: 0.31 -generated_by: 'Module::Build version 0.3624' +dynamic_config: 0 +generated_by: 'Module::Build version 0.38, CPAN::Meta::Converter version 2.112150' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html From 22a47276bb9f90258f9c8d39c8676bdab9333651 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 23 Oct 2011 14:14:44 -0400 Subject: [PATCH 08/10] Sign future distributions --- Build.PL | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Build.PL b/Build.PL index aaa18ec..e0a898a 100644 --- a/Build.PL +++ b/Build.PL @@ -56,6 +56,9 @@ my $build = Module::Build->new( # Create a LICENSE file create_license => 1, + # Sign the distribution + sign => 1, + test_files => 't/*.t xt/*.t', ); From b77564701a8879aca06408dba24d3e00dfe54473 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 23 Oct 2011 14:24:40 -0400 Subject: [PATCH 09/10] Fix MANIFEST --- MANIFEST | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MANIFEST b/MANIFEST index 531a8cd..62f49de 100644 --- a/MANIFEST +++ b/MANIFEST @@ -4,9 +4,9 @@ ex/check_login.pl lib/WWW/USF/WebAuth.pm LICENSE MANIFEST This list of files +META.json META.yml README -README.mkdn t/00-load.t t/netid_attribute.t xt/clean-namespaces.t @@ -19,4 +19,3 @@ xt/perl-version.t xt/perlcriticrc xt/pod-coverage.t xt/pod.t -META.json From d92bcd4ad9acde79409376d82609d49f71fb8cb2 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sun, 23 Oct 2011 14:39:51 -0400 Subject: [PATCH 10/10] Bump version to 0.003001 --- Changes | 6 ++++++ LICENSE | 22 ++++++++++++---------- META.json | 4 ++-- META.yml | 4 ++-- README | 4 ++-- README.mkdn | 4 ++-- lib/WWW/USF/WebAuth.pm | 4 ++-- 7 files changed, 28 insertions(+), 20 deletions(-) diff --git a/Changes b/Changes index bff9a54..f63d1dc 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for Perl 5 distribution WWW-USF-WebAuth +0.003001 2011-10-23 + [OTHER] + - Add dependency on LWP::Protocol::https to guarantee HTTPS support is + installed. + - Add usage example script in ex/. + 0.003 2010-11-21 [BUG FIXES] - Fix the POD tests in xt/ to work when the POD modules are not installed. diff --git a/LICENSE b/LICENSE index 541ef24..a446779 100644 --- a/LICENSE +++ b/LICENSE @@ -18,15 +18,16 @@ This is free software, licensed under: The GNU General Public License, Version 1, February 1989 - GNU GENERAL PUBLIC LICENSE - Version 1, February 1989 + GNU GENERAL PUBLIC LICENSE + Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA + 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. - Preamble + Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public @@ -67,7 +68,7 @@ authors' reputations. The precise terms and conditions for copying, distribution and modification follow. - GNU GENERAL PUBLIC LICENSE + GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which @@ -185,7 +186,7 @@ make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. - NO WARRANTY + NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN @@ -207,9 +208,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. - END OF TERMS AND CONDITIONS + END OF TERMS AND CONDITIONS - Appendix: How to Apply These Terms to Your New Programs + Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it @@ -235,8 +236,9 @@ the exclusion of warranty; and each file should have at least 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA + Also add information on how to contact you by electronic and paper mail. diff --git a/META.json b/META.json index 94745d1..190ea02 100644 --- a/META.json +++ b/META.json @@ -49,7 +49,7 @@ "provides" : { "WWW::USF::WebAuth" : { "file" : "lib/WWW/USF/WebAuth.pm", - "version" : "0.003" + "version" : "0.003001" } }, "release_status" : "stable", @@ -62,5 +62,5 @@ "url" : "git://github.com/dougwilson/perl5-www-usf-webauth.git" } }, - "version" : "0.003" + "version" : "0.003001" } diff --git a/META.yml b/META.yml index c37a414..2cd2246 100644 --- a/META.yml +++ b/META.yml @@ -23,7 +23,7 @@ no_index: provides: WWW::USF::WebAuth: file: lib/WWW/USF/WebAuth.pm - version: 0.003 + version: 0.003001 requires: Authen::CAS::External: 0.05 LWP::Protocol::https: 0 @@ -37,4 +37,4 @@ resources: homepage: http://github.com/dougwilson/perl5-www-usf-webauth/ license: http://dev.perl.org/licenses/ repository: git://github.com/dougwilson/perl5-www-usf-webauth.git -version: 0.003 +version: 0.003001 diff --git a/README b/README index 5943e1c..84d78e3 100644 --- a/README +++ b/README @@ -1,5 +1,5 @@ -WWW-USF-WebAuth 0.003 -===================== +WWW-USF-WebAuth 0.003001 +======================== INSTALLATION ------------ diff --git a/README.mkdn b/README.mkdn index 5943e1c..84d78e3 100644 --- a/README.mkdn +++ b/README.mkdn @@ -1,5 +1,5 @@ -WWW-USF-WebAuth 0.003 -===================== +WWW-USF-WebAuth 0.003001 +======================== INSTALLATION ------------ diff --git a/lib/WWW/USF/WebAuth.pm b/lib/WWW/USF/WebAuth.pm index 5abab9c..56dcb5a 100644 --- a/lib/WWW/USF/WebAuth.pm +++ b/lib/WWW/USF/WebAuth.pm @@ -6,7 +6,7 @@ use warnings 'all'; # METADATA our $AUTHORITY = 'cpan:DOUGDUDE'; -our $VERSION = '0.003'; +our $VERSION = '0.003001'; # MOOSE use Moose 1.03; @@ -62,7 +62,7 @@ WWW::USF::WebAuth - Access to USF's WebAuth system =head1 VERSION -Version 0.003 +This documentation refers to version 0.003001 =head1 SYNOPSIS