Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

jifty::manual::tutorialrest(3pm) [debian man page]

Jifty::Manual::TutorialRest(3pm)			User Contributed Perl Documentation			  Jifty::Manual::TutorialRest(3pm)

NAME
Jifty::Manual::TutorialRest - Web Services DESCRIPTION
This builds on Jifty::Manual::Tutorial, so make sure you have a running jifty that roughly resembles the step-by-step from there. SETUP
You must add this to your site_config.yml framework: Plugins: - REST: {} See Jifty::Plugin::REST. The commands assume that you have LWP installed with the GET alias. If not, you'll need to use the longhand lwp-request -m GET, or curl, or your browser. help Make sure it is working: $ GET http://localhost:8888/=/help Accessing resources: ... You should see some text describing the services, not html (that's longhand for 404.) Check the config and restart the server. GET
Just list the models. $ GET http://localhost:8888/=/model.yml --- - MyWeblog.Model.Post List the Post schema. $ GET http://localhost:8888/=/model/Post.yml --- body: label: Content name: body readable: 1 sort_order: 1 type: text writable: 1 id: mandatory: 1 name: id readable: 1 type: serial writable: 0 title: default: Untitled post label: Title name: title readable: 1 sort_order: 0 type: text writable: 1 You did make some posts, right? $ GET http://localhost:8888/=/model/Post/id.yml --- - 1 - 2 Dump the data: $ GET http://localhost:8888/=/model/Post/id/1.yml --- body: 'This is my post, the content of which is this, which is mine.' id: 1 title: my first post $ GET http://localhost:8888/=/model/Post/id/2.yml --- body: "Content of another post. Got to go, the cat's on fire." id: 2 title: post deux POST
TODO not working Actually, it looks like it is not supposed to work this way. Why not? $ echo '--- body: "A post via web services" id: 3 title: "posting from the command-line" ' | lwp-request -m POST http://localhost:8888/=/model/Post.yml POST http://localhost:8888/=/model/Post/id/3.yml --> 404 Not Found PUT
TODO not working $ echo '--- title: "posting from the cli" ' | lwp-request -m PUT http://localhost:8888/=/model/Post/3.yml 500 Can't read entity body: Connection reset by peer DELETE
$ lwp-request -m DELETE http://localhost:8888/=/model/Post/id/3.yml --- content: {} error: ~ field_errors: {} field_warnings: {} message: Deleted success: 1 perl v5.14.2 2010-09-25 Jifty::Manual::TutorialRest(3pm)

Check Out this Related Man Page

Jifty::Plugin::AuthzLDAP(3pm)				User Contributed Perl Documentation			     Jifty::Plugin::AuthzLDAP(3pm)

NAME
Jifty::Plugin::AuthzLDAP - Jifty plugin to a add dynamic ldap authorization DESCRIPTION
Jifty plugin. Provide ldap authorization with filters table and cache. CONFIGURATION NOTES
in etc/config.yml Plugins: - AuthzLDAP: LDAPbind: cn=testldap,ou=admins,dc=myorg,dc=org # LDAPpass: test # password LDAPhost: ldap.myorg.org # ldap host LDAPbase: ou=people,dc=myorg.. # ldap base LDAPuid: uid # optional CacheTimout: 20 # minutes, optional, default 20 minutes in application create a LDAPFilter model use base qw/Jifty::Plugin::AuthzLDAP::Model::LDAPFilter/; in LDAPFilter model create your filters, something like name |filter |is_group is_admin|(!eduPersonAffiliation=STUDENT)|0 in_admin|cn=admin,ou=groups,dc=my.org |1 to protect access to /admin in "TestApp" application create a lib/TestApp/Dispatcher.pm use strict; use warnings; package TestApp::Dispatcher; use Jifty::Dispatcher -base; before '/admin/*' => run { # Authentication Jifty->web->tangent(url => '/login') if (! Jifty->web->current_user->id); # Authorization my $user = Jifty->web->current_user->user_object->name; Jifty->web->tangent(url => '/error/AccessDenied') if (! Jifty::Plugin::AuthzLDAP->ldapvalidate($user,'is_admin') ); }; 1 SEE ALSO
Net::LDAP METHODS
init load config parameters, connect to ldap, create memory cache BASE CACHE DN LDAP BASE UID PASS LDAPFilterClass accesors to conf parametres bind Bind to ldap ldapvalidate NAME FILTERNAME return 1 if NAME validate FILTER or NAME-FILTERNAME in cache else return 0 If FILTERNAME is flagged as is_group, search if user is uniquemember of this group as supported by the Netscape Directory Server AUTHOR
Yves Agostini, <yvesago@cpan.org> LICENSE
Copyright 2007-2009 Yves Agostini. All Rights Reserved. This program is free software and may be modified and distributed under the same terms as Perl itself. perl v5.10.0 2009-05-15 Jifty::Plugin::AuthzLDAP(3pm)
Man Page