4.5.1. AAPlugin way of working
When SPS calls the AAPlugin, it does so by creating an AAPlugin (or more likely derived class) instance. The
initialization of the instance processes the given plugin configuration and sets the logging level appropriately.
On the new AAPlugin instance SPS will make a call to authenticate
, authorize
or session_ended
. In all cases
AAPlugin first collects the input parameters in
self.connection
and sets up
self.cookie
and self.session_cookie
attributes.
In case of authenticate
the prescribed steps in AAPlugin._authentication_steps()
are executed and if
that was successful then the steps in AAPlugin._post_successful_authentication_steps()
are also executed.
The later steps can ask further questions from the user and do other housekeeping tasks.
In case of authorize
the prescribed steps in AAPlugin._authorization_steps()
are executed, where the last
step is to call AAPlugin.do_authorize()
.
In case of session_ended
the prescribed steps in AAPlugin._session_ended_steps()
are executed, where the last
step is to call AAPlugin.do_session_ended()
.
If a step returns with a verdict such as accept, deny or need info, then AAPlugin will add values stored in
self.cookie
and self.session_cookie
to the verdict
and return the result to SPS.
If a step returns with None, then AAPlugin marks it as done, and does not call it again in case the plugin returns
need info and the plugin is invoked again with the same callback.