Commit 935109be authored by Xavier Guimard's avatar Xavier Guimard

More doc

parent 60a18f12
......@@ -6,8 +6,8 @@
package Lemonldap::NG::Portal;
our $VERSION = '2.0.0';
use Lemonldap::NG::Portal::SharedConf;
use base 'Lemonldap::NG::Portal::SharedConf';
use Lemonldap::NG::Portal::Main;
use base 'Lemonldap::NG::Portal::Main';
......@@ -45,7 +45,83 @@ described below.
Lemonldap::NG::Portal provides portal components. See
L<> for more.
The portal object is based on L<Lemonldap::NG::Handler::Try>: underlying
handler tries to authenticate user and then follow the routes (auth/unauth)
declared during initialization.
=head2 Initialization
The intialisation process subscribes portal to handler configuration reload and
ask for handler initialization (L<Lemonldap::NG::Portal::Main::Init>).
So configuration read is triggered by handler at each reload.
During configuration reload, every enabled components are loaded as plugins:
=item authentication module
=item userDB module
=item other enabled plugins (issuers,...)
init() is called for each plugin. If one plugin initialization fails (init()
returns 0), the portal responds a 500 status code for each request.
Plugins can declare unauthRoutes/authRoutes during this initialization (=
/path/info). Methods declared in this way must be declared in the plugin class.
They will be called this the $req argument: the HTTP request
=head2 Main route
The "/" route is declared in L<Lemonldap::NG::Portal::Main::Init> it points to
different methods in L<Lemonldap::NG::Portal::Main::Run>. Theses methods choose
methods to call in the process and call do().
do() stores methods to call in $req->steps and launches
Lemonldap::NG::Portal::Main::Process::process(). This method removes each method
stored in $req->steps and launches it. If the result is PE_OK, proces()
continues, else it returns the error code.
If the request was an Ajax one, do() responds in JSON format else it manages
redirection if any. Else it calls
Lemonldap::NG::Portal::Main::Display::display() to have template and arguments,
then it launch Lemonldap::NG::Common::PSGI::sendHtml() with them.
Portal main object is defined in Lemonldap::NG::Portal::Main::* classes. Other
components are plugins. Plugins must not store any hash key in the main object.
Main and plugin keys must be initializated during initialization. They must
be read-only during receiving requests.
The L<Lemonldap::NG::Portal::Main::Request> request has fixed keys. A plugin
that wants to store a temporary key must store it in $req->datas or use
defined keys, but it must never create a root key. Plugin keys may have
explicit names to avoid conflicts.
Whole configuration is always available. It is stored in $self->conf. It must
not be modified by anyone even during initialization or receiving request
(during initialization, copy the value in the plugin namespace instead).
All plugins can dial with the portal methods using $self->p whoch points to
portal main object. Some main methods are mapped to the plugin namespace:
=item lmLog()
=item error() accessor (use it to store error during initialization)
Most of the documentation is available on the website
......@@ -131,6 +131,9 @@ All these methods must return a Lemonldap::NG::Portal::Main::Constants value.
They are called with one argument: a L<Lemonldap::NG::Portal::Main::Request>
Note: if you want to change process() next steps, you just have to change
$req->steps array.
=head4 extractFormInfo($req)
First authentication method called during authentication process. It must set
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment