Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
lemonldap-ng
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maxime Besson
lemonldap-ng
Commits
056688ca
Commit
056688ca
authored
Dec 19, 2016
by
Yadd
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some doc (#595)
parent
1b03f1fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
154 additions
and
20 deletions
+154
-20
lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm
lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm
+5
-2
lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Request.pm
lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Request.pm
+19
-0
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
+130
-18
No files found.
lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm
View file @
056688ca
...
...
@@ -122,8 +122,11 @@ sub sendError {
);
# SOAP responses
if
(
$req
->
accept
=~
m#(?:application|text)/xml#
or
$req
->
contentType
=~
m#(?:application|text)/xml#
)
if
(
$req
->
accept
=~
m#(?:application|text)/xml#
or
(
$req
->
contentType
and
$req
->
contentType
=~
m#(?:application|text)/xml#
)
)
{
my
$s
=
'
<soapenv:Body>
<soapenv:Fault>
...
...
lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI/Request.pm
View file @
056688ca
...
...
@@ -296,6 +296,15 @@ Content type of posted datas.
Length of posted datas.
=head3 respHeaders
Used to store response headers. Be careful, it contains an array, not a hash
reference because headers can be multi-valued.
Exemple:
$req->respHeaders( "Location" => "http://x.y.z/", Etag => "XYZ", );
=head2 Private accessors
=head3 _psgixBuffered
...
...
@@ -308,10 +317,20 @@ PSGI psgix.input variable.
=head2 Methods
=head3 parseBody()
Transform JSON or form/url-encoded POST content into GET parameters. Using this
it is possible to manage POST requests like GET requests.
=head3 jsonBodyToObj()
Get the content of a JSON POST request as Perl object.
=head3 wantJSON
Return true if current request ask JSON content (verify that "Accept" header
contains "application/json" or "text/json").
=head1 SEE ALSO
L<http://lemonldap-ng.org/>, L<Lemonldap::NG::Portal>, L<Lemonldap::NG::Handler>,
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Request.pm
View file @
056688ca
# Lemonldap::NG::Portal::Main::Request extends Lemonldap::NG::Common::PSGI::Request
# to add all parameters needed to manage authentication:
#
# - steps: list of methods to call
# - datas: free hash ref where plugins can store their datas
# - user infos:
# * id: Apache::Session id
# * sessionInfo: hash ref that will be stored in session DB
# * user: username given by authentication module, used by userDB module
# - query elements:
# * mustRedirect: boolean to indicate that response must be a redirection
# * urlNotBase64: boolean to indicate that url isn't Base64 encoded
# - menu elements:
# * info: info to display at login
# * menuError
# * notification: see notification plugin
# * errorType: returns positive/warning/negative depending on error (stored
# in error property)
package
Lemonldap::NG::Portal::Main::
Request
;
# Developpers, be careful: new() is never called so default values will not be
...
...
@@ -137,3 +119,133 @@ sub info {
# TODO: oldpassword
1
;
__END__
=head1 NAME
=encoding utf8
Lemonldap::NG::Portal::Main::Request - HTTP request object used in LLNG
portal methods.
=head1 SYNOPSIS
# Somewhere in a plugin...
sub run {
my ( $self, $req ) = @_;
# $req is a Lemonldap::NG::Portal::Main::Request object
...
}
=head1 DESCRIPTION
Lemonldap::NG::Portal::Main::Request extends Lemonldap::NG::Common::PSGI::Request
to add all parameters needed to manage portal jobs.
=head1 METHODS
=head2 Accessors
=head3 steps()
Stack of methods to call for this requests. It can be modified to change
authentication process
=head3 datas()
Free hash ref where plugins can store their datas. Using it is a LLNG best
practice
=head3 User information
=head4 id()
Session id (main cookie value).
=head4 sessionInfo()
Hash ref that will be stored in session DB.
=head4 user()
Username given by authentication module, used by userDB module.
=head3 mustRedirect()
Boolean to indicate that response must be a redirection (used for example when
request is a POST).
=head3 urlNotBase64
Boolean to indicate that url isn't Base64 encoded.
=head2 Other methods
=head3 info()
Store info to display in response.
=head3 menuError()
=head3 notification()
see notification plugin.
=head3 errorType()
Returns positive/warning/negative depending on value stored in error property.
=head1 SEE ALSO
L<http://lemonldap-ng.org/>, L<Lemonldap::NG::Portal>, L<Lemonldap::NG::Handler>,
L<Plack>, L<PSGI>, L<Lemonldap::NG::Common::PSGI>,
L<Lemonldap::NG::Common::PSGI::Router>, L<HTML::Template>,
=head1 AUTHORS
=over
=item Clement Oudot, E<lt>clem.oudot@gmail.comE<gt>
=item François-Xavier Deltombe, E<lt>fxdeltombe@gmail.com.E<gt>
=item Xavier Guimard, E<lt>x.guimard@free.frE<gt>
=item Thomas Chemineau, E<lt>thomas.chemineau@gmail.comE<gt>
=back
=head1 BUG REPORT
Use OW2 system to report bug or ask for features:
L<http://jira.ow2.org>
=head1 DOWNLOAD
Lemonldap::NG is available at
L<http://forge.objectweb.org/project/showfiles.php?group_id=274>
=head1 COPYRIGHT AND LICENSE
=over
=item Copyright (C) 2015-2016 by Xavier Guimard, E<lt>x.guimard@free.frE<gt>
=item Copyright (C) 2015-2016 by Clément Oudot, E<lt>clem.oudot@gmail.comE<gt>
=back
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see L<http://www.gnu.org/licenses/>.
=cut
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment