[Jifty-commit] r7210 - in plugins/Jifty-Plugin-OpenID: lib/Jifty/Plugin

Jifty commits jifty-commit at lists.jifty.org
Tue Jun 9 16:43:32 EDT 2009


Author: yves
Date: Tue Jun  9 16:43:31 2009
New Revision: 7210

Added:
   plugins/Jifty-Plugin-OpenID/Changes
   plugins/Jifty-Plugin-OpenID/README
Modified:
   plugins/Jifty-Plugin-OpenID/Makefile.PL
   plugins/Jifty-Plugin-OpenID/lib/Jifty/Plugin/OpenID.pm

Log:
ready to upload to cpan
 * update Makefile.PL for new Module::Install, all_from file
 * add Changes and README
 * add Author (from svn log) and copyright notice
 * fix pod error


Added: plugins/Jifty-Plugin-OpenID/Changes
==============================================================================
--- (empty file)
+++ plugins/Jifty-Plugin-OpenID/Changes	Tue Jun  9 16:43:31 2009
@@ -0,0 +1,4 @@
+Revision history for Perl module Jifty::Plugin::OpenID
+
+0.10 Tue, 09 Jun 2009 22:28:10 +0200
+    - original version for CPAN

Modified: plugins/Jifty-Plugin-OpenID/Makefile.PL
==============================================================================
--- plugins/Jifty-Plugin-OpenID/Makefile.PL	(original)
+++ plugins/Jifty-Plugin-OpenID/Makefile.PL	Tue Jun  9 16:43:31 2009
@@ -1,6 +1,6 @@
-use inc::Module::Install 0.46;
+use inc::Module::Install;
 name('Jifty-Plugin-OpenID');
-version_from('lib/Jifty/Plugin/OpenID.pm');
+all_from('lib/Jifty/Plugin/OpenID.pm');
 
 requires('Jifty');
 requires('Net::OpenID::Consumer');

Added: plugins/Jifty-Plugin-OpenID/README
==============================================================================
--- (empty file)
+++ plugins/Jifty-Plugin-OpenID/README	Tue Jun  9 16:43:31 2009
@@ -0,0 +1,94 @@
+NAME
+    Jifty::Plugin::OpenID - Provides OpenID authentication for your jifty
+    app
+
+DESCRIPTION
+    Provides OpenID authentication for your app
+
+USAGE
+  Config
+    please provide "OpenIDSecret" in your etc/config.yml , the "OpenIDUA" is
+    optional , OpenID Plugin will use LWPx::ParanoidAgent by default.
+
+        --- 
+        application:
+            OpenIDSecret: 1234
+            OpenIDUA: LWP::UserAgent
+
+    or you can set "OpenIDUserAgent" environment var in command-line:
+
+        OpenIDUserAgent=LWP::UserAgent bin/jifty server
+
+    if you are using LWPx::ParanoidAgent as your openid agent. you will need
+    to provide "JIFTY_OPENID_WHITELIST_HOST" for your own OpenID server.
+
+        export JIFTY_OPENID_WHITELIST_HOST=123.123.123.123
+
+  User Model
+    Create your user model , and let it uses
+    Jifty::Plugin::OpenID::Mixin::Model::User to mixin "openid" column. and
+    a "name" method.
+
+        use TestApp::Record schema {
+
+            column email =>
+                type is 'varchar';
+
+        };
+        use Jifty::Plugin::OpenID::Mixin::Model::User;
+
+        sub name {
+            my $self = shift;
+            return $self->email;
+        }
+
+    Note: you might need to declare a "name" method. because the OpenID
+    CreateOpenIDUser action and SkeletonApp needs current_user->username to
+    show welcome message and success message , which calls
+    "brief_description" method. See Jifty::Record for "brief_description"
+    method.
+
+  View
+    OpenID plugin provides AuthenticateOpenID Action. so that you can render
+    an AuthenticateOpenID in your template:
+
+        form {
+            my $openid = new_action( class   => 'AuthenticateOpenID',
+                                    moniker => 'authenticateopenid' );
+            render_action( $openid );
+        };
+
+    this action renders a form which provides openid url field. and you will
+    need to provide a submit button in your form.
+
+        form {
+            my $openid = new_action( class   => 'AuthenticateOpenID',
+                                    moniker => 'authenticateopenid' );
+
+            # ....
+
+            render_action( $openid );
+            outs_raw(
+                Jifty->web->return(
+                    to     => '/openid_verify_done',
+                    label  => _("Login with OpenID"),
+                    submit => $openid
+                ));
+        };
+
+    the "to" field is for verified user to redirect to. so that you will
+    need to implement a template called "/openid_verify_done":
+
+        template '/openid_verify_done' => page {
+            h1 { "Done" };
+        };
+
+AUTHORS
+    Alex Vandiver, Cornelius <cornelius.howl {at} gmail.com >
+
+LICENSE
+    Copyright 2005-2009 Best Practical Solutions, LLC.
+
+    This program is free software and may be modified and distributed under
+    the same terms as Perl itself.
+

Modified: plugins/Jifty-Plugin-OpenID/lib/Jifty/Plugin/OpenID.pm
==============================================================================
--- plugins/Jifty-Plugin-OpenID/lib/Jifty/Plugin/OpenID.pm	(original)
+++ plugins/Jifty-Plugin-OpenID/lib/Jifty/Plugin/OpenID.pm	Tue Jun  9 16:43:31 2009
@@ -55,7 +55,7 @@
     }
 
 Note: you might need to declare a C<name> method. because the OpenID
-CreateOpenIDUser action and SkeletonApp needs current_user-E<>>username to show
+CreateOpenIDUser action and SkeletonApp needs current_user->username to show
 welcome message and success message , which calls C<brief_description> method.
 See L<Jifty::Record> for C<brief_description> method.
 
@@ -140,4 +140,16 @@
     );
 }
 
+=head1 AUTHORS
+
+Alex Vandiver, Cornelius  <cornelius.howl {at} gmail.com >
+
+=head1 LICENSE
+
+Copyright 2005-2009 Best Practical Solutions, LLC.
+
+This program is free software and may be modified and distributed under the same terms as Perl itself.
+
+=cut
+
 1;


More information about the Jifty-commit mailing list