NAME
POE::Component::Lightspeed::Authentication - Protect your local kernel!
SYNOPSIS
use POE;
use POE::Component::Lightspeed::Authentication qw( auth_register auth_unregister );
# Spawn your client/server session here and connect to the network
# Register a callback for incoming POST messages heading towards session 'MyPrivateSession'
auth_register( 'post', \&MyAuthRoutine, 'MyPrivateSession' );
# Register a callback for incoming CALL messages for any session
auth_register( 'call', \&MyCallRoutine, '*' );
# Remove our post callback
auth_unregister( 'post', 'MyPrivateSession' );
ABSTRACT
This module presents an easy API to insert Authentication hooks into Lightspeed
DESCRIPTION
All you need to do is import the 2 subroutines provided.
AVAILABLE HOOKS
post
Hooks into incoming post() calls from remote sessions. The hook subroutine will be given these arguments:
- 'post'
- Destination session
- Destination state
- The remote session ( extract information from it via $session->remote_kernel/session/state/file/line )
call
Hooks into incoming call() calls from remote sessions. The hook subroutine will be given these arguments:
- 'call'
- Destination session
- Destination state
- The RSVP in the format [ KERNEL, SESSION, STATE ]
- The remote session ( extract information from it via $session->remote_kernel/session/state/file/line )
callreply
Hooks into incoming post() calls from remote sessions replying to a call(). The hook subroutine will be given these arguments:
- 'callreply'
- Destination session
- Destination state
- The remote session ( extract information from it via $session->remote_kernel/session/state/file/line )
introspection
Hooks into incoming introspection requests. The hook subroutine will be given these arguments:
- 'introspection'
- 'session' or 'state'
# The session introspection request will only get 2 more argument:
- The RSVP in the format [ KERNEL, SESSION, STATE ]
- The remote session ( extract information from it via $session->remote_kernel/session/state/file/line )
# The state introspection request will get 3 more arguments:
- The Destination session
- The RSVP in the format [ KERNEL, SESSION, STATE ]
- The remote session ( extract information from it via $session->remote_kernel/session/state/file/line )
monitor_register
Hooks into incoming monitor requests. The hook subroutine will be given these arguments:
- 'monitor_register'
- The various monitor types
- The argument for the monitor
- The RSVP for the monitor
- The remote session ( extract information from it via $session->remote_kernel/session/state/file/line )
monitor_unregister
Hooks into incoming monitor requests. The hook subroutine will be given these arguments:
- 'monitor_unregister'
- The various monitor types
- The argument for the monitor
- The RSVP for the monitor
- The remote session ( extract information from it via $session->remote_kernel/session/state/file/line )
METHODS
auth_register
Requires a minimum of 2 arguments
- The hook type ( post/call/callreply/introspection )
- The hook subroutine reference
The extra argument is the session or the introspection type, defaults to '*' if none was supplied
Returns true on success, undef on failure
auth_unregister
Requires a minimum of 1 argument
- The hook type ( post/call/callreply/introspection )
The extra argument is the session or the introspection type, defaults to '*' if none was supplied
Returns true on success, undef on failure
EXPORT
Exports the 2 subs in EXPORT_OK
QUIRKS
- It will not run the specific auth hook and the generic auth hook ( '*' ), it picks only one to run!
- Certain types of incoming results can have a RSVP going to our own kernel, those messages are not run through
the Authentication system, as it doesn't make sense to have the remote information point to ourself...
- Yes, the monitor hooks won't work as the Lightspeed::Monitor module is still in the works =]
SEE ALSO
AUTHOR
Apocalypse <apocal@cpan.org>
COPYRIGHT AND LICENSE
Copyright 2005 by Apocalypse
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.