From: Tomas Doran Date: Sun, 28 Sep 2008 16:00:34 +0000 (+0000) Subject: Checking in changes prior to tagging of version 1.000. Changelog diff is: X-Git-Tag: v1.000^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Authentication-Store-Htpasswd.git;a=commitdiff_plain;h=e82cdd07bbea6a1c440034d6c6b5adf89a62b055 Checking in changes prior to tagging of version 1.000. Changelog diff is: === Changes ================================================================== --- Changes (revision 7764) +++ Changes (local) @@ -1,5 +1,7 @@ -0.03 XXX XXX x XX:XX:XX GMT 2008 +1.000 Sun Sept 28 16:58:30 GMT 2008 Change from Module::Build to Module::Install + - Update to the new authentication framework. + - Bump revision number due to moving to new repository layout. 0.02 Wed Feb 8 01:18:17 CET 2006 work properly again with roles --- diff --git a/.shipit b/.shipit new file mode 100644 index 0000000..f528ef8 --- /dev/null +++ b/.shipit @@ -0,0 +1,3 @@ +steps = FindVersion, ChangeVersion, CheckChangeLog, DistTest, Commit, Tag, MakeDist, UploadCPAN +svk.tagpattern = //mirror/Catalyst-Authentication-Store-Htpasswd/1.000/tags/%v +CheckChangeLog.files = Changes diff --git a/Changes b/Changes index 39db1ef..7f7369b 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,7 @@ -0.03 XXX XXX x XX:XX:XX GMT 2008 +1.000 Sun Sept 28 16:58:30 GMT 2008 - Change from Module::Build to Module::Install + - Update to the new authentication framework. + - Bump revision number due to moving to new repository layout. 0.02 Wed Feb 8 01:18:17 CET 2006 - work properly again with roles diff --git a/MANIFEST b/MANIFEST index c99f2fd..c6fe1e2 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,3 +1,4 @@ +README Changes inc/Module/Install.pm inc/Module/Install/Base.pm diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index 78d91fa..1d10927 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -32,3 +32,6 @@ # skip OS X finder file \.DS_Store + +# Don't distribute the shipit config. +.shipit diff --git a/Todo b/Todo index 5ff7527..adc4f56 100644 --- a/Todo +++ b/Todo @@ -1 +1,4 @@ . Paths to htpasswd which start with / should be taken from root, not the app root +. Better docs +. Configurable user class +. Configurable username/password fields. \ No newline at end of file diff --git a/lib/Catalyst/Authentication/Store/Htpasswd.pm b/lib/Catalyst/Authentication/Store/Htpasswd.pm index 0ad445f..d4daf20 100644 --- a/lib/Catalyst/Authentication/Store/Htpasswd.pm +++ b/lib/Catalyst/Authentication/Store/Htpasswd.pm @@ -9,7 +9,7 @@ use Authen::Htpasswd; use Catalyst::Authentication::Store::Htpasswd::User; use Scalar::Util qw/blessed/; -our $VERSION = '0.03'; +our $VERSION = '1.000'; BEGIN { __PACKAGE__->mk_accessors(qw/file/) } diff --git a/lib/Catalyst/Authentication/Store/Htpasswd/Backend.pm b/lib/Catalyst/Authentication/Store/Htpasswd/Backend.pm deleted file mode 100644 index a088c30..0000000 --- a/lib/Catalyst/Authentication/Store/Htpasswd/Backend.pm +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/perl - -package Catalyst::Plugin::Authentication::Store::Htpasswd::Backend; -use base qw/Class::Accessor::Fast/; - -use strict; -use warnings; - -use Authen::Htpasswd; -use Catalyst::Plugin::Authentication::Store::Htpasswd::User; - -BEGIN { __PACKAGE__->mk_accessors(qw/file/) } - -sub new { - my ( $class, $file, %extra ) = @_; - - bless { file => ( ref $file ? $file : Authen::Htpasswd->new($file, \%extra) ) }, $class; -} - -sub get_user { - my ( $self, $id ) = @_; - Catalyst::Plugin::Authentication::Store::Htpasswd::User->new( $self, $self->file->lookup_user($id) ); -} - -sub user_supports { - my $self = shift; - - # this can work as a class method - Catalyst::Plugin::Authentication::Store::Htpasswd::User->supports(@_); -} - -sub from_session { - my ( $self, $c, $id ) = @_; - $self->get_user( $id ); -} - -__PACKAGE__; - -__END__ - -=pod - -=head1 NAME - -Catalyst::Plugin::Authentication::Store::Htpasswd::Backend - Htpasswd -authentication storage backend. - -=head1 SYNOPSIS - - # you probably just want Store::Htpasswd under most cases, - # but if you insist you can instantiate your own store: - - use Catalyst::Plugin::Authentication::Store::Htpasswd::Backend; - - use Catalyst qw/ - Authentication - Authentication::Credential::Password - /; - - my %users = ( - user => { password => "s3cr3t" }, - ); - - our $users = Catalyst::Plugin::Authentication::Store::Htpasswd::Backend->new(\%users); - - sub action : Local { - my ( $self, $c ) = @_; - - $c->login( $users->get_user( $c->req->param("login") ), - $c->req->param("password") ); - } - -=head1 DESCRIPTION - -You probably want L, unless -you are mixing several stores in a single app and one of them is Htpasswd. - -Otherwise, this lets you create a store manually. - -=head1 METHODS - -=head2 new $hash_ref - -Constructs a new store object, which uses the supplied hash ref as it's backing -structure. - -=head2 get_user $id - -Keys the hash by $id and returns the value. - -If the return value is unblessed it will be blessed as -L. - -=head2 user_supports - -Chooses a random user from the hash and delegates to it. - -=head1 COPYRIGHT & LICENSE - - Copyright (c) 2005 the aforementioned authors. All rights - reserved. This program is free software; you can redistribute - it and/or modify it under the same terms as Perl itself. - -=cut - -