[Catalyst-commits] r6322 - in
trunk/Catalyst-Plugin-Authentication-Credential-TypeKey: .
lib/Catalyst/Plugin/Authentication/Credential
bricas at dev.catalyst.perl.org
bricas at dev.catalyst.perl.org
Thu Apr 26 21:32:54 GMT 2007
Author: bricas
Date: 2007-04-26 21:32:52 +0100 (Thu, 26 Apr 2007)
New Revision: 6322
Added:
trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/MANIFEST.SKIP
trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Makefile.PL
trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/README
Removed:
trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Build.PL
Modified:
trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Changes
trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/lib/Catalyst/Plugin/Authentication/Credential/TypeKey.pm
Log:
switch to Module::Install. add MANIFEST.SKIP, add README
Deleted: trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Build.PL
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Build.PL 2007-04-26 20:18:04 UTC (rev 6321)
+++ trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Build.PL 2007-04-26 20:32:52 UTC (rev 6322)
@@ -1,18 +0,0 @@
-use strict;
-use Module::Build;
-
-my $build = Module::Build->new(
- create_makefile_pl => 'traditional',
- license => 'perl',
- module_name => 'Catalyst::Plugin::Authentication::Credential::TypeKey',
- requires => {
- 'Catalyst' => '5.5',
- 'Catalyst::Plugin::Authentication' => 0,
- 'Authen::TypeKey' => 0,
- 'Test::MockObject' => '1.01',
- },
- create_readme => 1,
- sign => 1,
-);
-$build->create_build_script;
-
Modified: trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Changes
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Changes 2007-04-26 20:18:04 UTC (rev 6321)
+++ trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Changes 2007-04-26 20:32:52 UTC (rev 6322)
@@ -1,10 +1,11 @@
-0.04
+0.04 XXX
- refactor some yuckiness
- Locally override pluginn configuration (user_class, etc)
- Locally override typekey configuration (token, etc)
- last_typekey_{error,object}
- Doc improvements
- use Catalyst::Utils::ensure_class_loaded instead of UNIVERSAL::require
+ - Switch to Module::Install
0.03 2006-01-01 13:35:00
- $store->get_user now gets the user name as the first arg for maximum
Added: trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/MANIFEST.SKIP
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/MANIFEST.SKIP (rev 0)
+++ trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/MANIFEST.SKIP 2007-04-26 20:32:52 UTC (rev 6322)
@@ -0,0 +1,29 @@
+# Avoid version control files.
+\bRCS\b
+\bCVS\b
+,v$
+\B\.svn\b
+
+# Avoid Makemaker generated and utility files.
+\bMakefile$
+\bblib
+\bMakeMaker-\d
+\bpm_to_blib$
+\bblibdirs$
+^MANIFEST\.SKIP$
+
+# Avoid Module::Build generated and utility files.
+\bBuild$
+\b_build
+
+# Avoid temp and backup files.
+~$
+\.tmp$
+\.old$
+\.bak$
+\#$
+\b\.#
+\.DS_Store$
+
+# No tarballs!
+\.gz$
Added: trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Makefile.PL
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Makefile.PL (rev 0)
+++ trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/Makefile.PL 2007-04-26 20:32:52 UTC (rev 6322)
@@ -0,0 +1,13 @@
+use inc::Module::Install 0.65;
+
+name 'Catalyst-Plugin-Authentication-Credential-TypeKey';
+all_from 'lib/Catalyst/Plugin/Authentication/Credential/TypeKey.pm';
+
+requires 'Catalyst::Runtime';
+requires 'Catalyst::Plugin::Authentication';
+requires 'Test::MockObject';
+requires 'Authen::TypeKey';
+
+auto_install;
+WriteAll;
+
Added: trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/README
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/README (rev 0)
+++ trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/README 2007-04-26 20:32:52 UTC (rev 6322)
@@ -0,0 +1,130 @@
+NAME
+ Catalyst::Plugin::Authentication::Credential::TypeKey - TypeKey
+ Authentication for Catalyst.
+
+SYNOPSIS
+ use Catalyst qw/Authentication::Credential::TypeKey/;
+
+ MyApp->config->{authentication}{typekey} = {
+ token => 'xxxxxxxxxxxxxxxxxxxx',
+ };
+
+ sub foo : Local {
+ my ( $self, $c ) = @_;
+
+ if ( $c->authenticate_typekey ) {
+
+ # you can also specify the params manually: $c->authenticate_typekey(
+ # name => $name,
+ # email => $email,
+ # ...
+ #)
+
+ # successful autentication
+
+ $c->user; # this is set
+ }
+ }
+
+ sub auto : Private {
+ my ( $self, $c ) = @_;
+
+ $c->authenticate_typekey; # uses $c->req
+
+ return 1;
+ }
+
+DESCRIPTION
+ This module integrates Authen::TypeKey with
+ Catalyst::Plugin::Authentication.
+
+METHODS
+ authenticate_typekey $user_object, %parameters
+ authenticate_typekey %parameters
+ authenticate_typekey { ... parameters ... }
+ authenticate_typekey
+ This method performs the actual authentication. It's pretty complicated.
+
+ Any configuration field (this plugin's configuration, e.g. "user_class",
+ as well as any Authen::TypeKey configuration fields, e.g. "token", etc)
+ can be in %parameters. This will clone the configured typekey object if
+ needed and set the fields locally for this call only.
+
+ All other fields are assumed to be typekey credentials.
+
+ If a user object is provided it will be asked for it's typekey
+ credentials and then authenticated against the server keys.
+
+ If there are no typekey credentials in the paramters or the user object,
+ the credentials will be taken from "$c->request".
+
+ If a user object exists and is authenticated correctly it will be marked
+ as authenticated. If no such object exists but "auth_store" is provided
+ (or configured) then it will attempt to retrieve a user from that store
+ using the "name" typekey credential field. If no "auth_store" is
+ configured or a user was not found in that store "user_class" is used to
+ create a temporary user using the parameters as fields.
+
+ last_typekey_object
+ The last typekey object used for authentication. This is useful if you
+ use overrides or need to check errors.
+
+ last_typekey_error
+ This is "$c->last_typekey_object->errstr"
+
+ EXTENDED METHODS
+ setup
+ Fills the config with defaults.
+
+CONFIGURATION
+ "<$c-"config->{autentication}{typekey}>> is a hash with these fields
+ (all can be left out):
+
+ typekey_object
+ If this field does not exist an Authen::TypeKey object will be
+ created based on the other param and put here.
+
+ expires
+ key_url
+ token
+ version
+ See Authen::TypeKey for all of these. If they aren't specified
+ Authen::TypeKey's defaults will be used.
+
+ key_cache
+ Also see Authen::TypeKey.
+
+ Defaults to "regkeys.txt" under "class2tempdir" in Catalyst::Utils.
+
+ auth_store
+ A store (or store name) to retrieve the user from.
+
+ When a user is successfully authenticated it will call this:
+
+ $store->get_user( $name, $parameters, $result_of_verify );
+
+ Where $parameters is a the hash reference passed to "verify" in
+ Authen::TypeKey, and $result_of_verify is the value returned by
+ "verify" in Authen::TypeKey.
+
+ "default_auth_store" will NOT be used automatically, you need to set
+ this parameter to "default" for that to happen. This is because most
+ TypeKey usage is not store-oriented.
+
+ user_class
+ If "auth_store" or the default store returns nothing from get_user,
+ this class will be used to instantiate an object by calling "new" on
+ the class with the return value from "verify" in Authen::TypeKey.
+
+SEE ALSO
+ Authen::TypeKey, Catalyst, Catalyst::Plugin::Authentication.
+
+AUTHOR
+ Christian Hansen
+
+ Yuval Kogman, "nothingmuch at woobling.org"
+
+LICENSE
+ This library is free software . You can redistribute it and/or modify it
+ under the same terms as perl itself.
+
Modified: trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/lib/Catalyst/Plugin/Authentication/Credential/TypeKey.pm
===================================================================
--- trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/lib/Catalyst/Plugin/Authentication/Credential/TypeKey.pm 2007-04-26 20:18:04 UTC (rev 6321)
+++ trunk/Catalyst-Plugin-Authentication-Credential-TypeKey/lib/Catalyst/Plugin/Authentication/Credential/TypeKey.pm 2007-04-26 20:32:52 UTC (rev 6322)
@@ -264,6 +264,8 @@
This is C<< $c->last_typekey_object->errstr >>
+=head3 get_typekey_object
+
=head3 EXTENDED METHODS
=head3 setup
More information about the Catalyst-commits
mailing list