Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Maxime Besson
lemonldap-ng
Commits
1a16c2db
Commit
1a16c2db
authored
Apr 03, 2016
by
Yadd
Browse files
First running test (#595)
parent
13051ce0
Changes
8
Hide whitespace changes
Inline
Side-by-side
lemonldap-ng-handler/lib/Lemonldap/NG/Handler/Main/SharedVariables.pm
View file @
1a16c2db
...
...
@@ -36,7 +36,7 @@ our $_v = { session => {}, datas => {} };
BEGIN
{
# Thread shared accessors
foreach
(
qw(tsv cfgNum lastCheck checkTime confAcc localConfig logLevel _logLevel logLevels)
qw(tsv cfgNum lastCheck checkTime confAcc localConfig logLevel _logLevel logLevels
lmConf
)
)
{
eval
"
sub
$_
{
...
...
lemonldap-ng-manager/t/05-rest-api.t
View file @
1a16c2db
#!/usr/bin/env perl -I pl/lib
#
# Test REST API with valid and invalid requests.
# Check also metadatas request (root of a conf)
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main.pm
View file @
1a16c2db
...
...
@@ -9,7 +9,6 @@ extends(
'
Lemonldap::NG::Handler::PSGI::Try
',
'
Lemonldap::NG::Portal::Main::Init
',
'
Lemonldap::NG::Portal::Main::Run
',
'
Lemonldap::NG::Portal::Main::Process
',
);
1
;
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Main/Run.pm
View file @
1a16c2db
...
...
@@ -14,6 +14,8 @@ use Mouse;
use
Lemonldap::NG::Portal::Main::
Constants
;
use
Lemonldap::NG::Portal::Main::
Request
;
extends
'
Lemonldap::NG::Portal::Main::Process
';
our
$VERSION
=
'
2.0.0
';
# List constants
...
...
lemonldap-ng-portal/lib/Lemonldap/NG/Portal/Plugins/CDA.pm
View file @
1a16c2db
...
...
@@ -14,7 +14,7 @@ sub changeUrldc {
my
$urldc
=
$req
->
datas
->
{
urldc
};
if
(
$req
->
id
and
$urldc
!~
m#^https?://[^/]*$self->{conf}->{domain}(:\d+)?/#oi
and
$self
->
isTrustedUrl
(
$urldc
)
)
and
$self
->
p
->
isTrustedUrl
(
$urldc
)
)
{
my
$ssl
=
$urldc
=~
/^https/
;
$self
->
lmLog
(
'
CDA request
',
'
debug
'
);
...
...
lemonldap-ng-portal/t/01-AuthDemo.t
0 → 100644
View file @
1a16c2db
use
Test::
More
;
use
strict
;
require
'
t/test-lib.pm
';
print
STDERR
Dumper
(
&client
);
done_testing
(
count
()
);
lemonldap-ng-portal/t/lmConf-1.js
0 → 100644
View file @
1a16c2db
{
"
authentication
"
:
"
Demo
"
,
"
cfgAuthor
"
:
"
The LemonLDAP::NG team
"
,
"
cfgAuthorIP
"
:
"
127.0.0.1
"
,
"
cfgDate
"
:
1428138808
,
"
cfgLog
"
:
"
Handler test conf
"
,
"
cfgNum
"
:
"
1
"
,
"
cookieName
"
:
"
lemonldap
"
,
"
demoExportedVars
"
:
{
"
cn
"
:
"
cn
"
,
"
mail
"
:
"
mail
"
,
"
uid
"
:
"
uid
"
},
"
domain
"
:
"
example.com
"
,
"
exportedHeaders
"
:
{
"
test1.example.com
"
:
{
"
Auth-User
"
:
"
$uid
"
},
"
test2.example.com
"
:
{
"
Auth-User
"
:
"
$uid
"
}
},
"
exportedVars
"
:
{
"
UA
"
:
"
HTTP_USER_AGENT
"
},
"
globalStorage
"
:
"
Apache::Session::File
"
,
"
globalStorageOptions
"
:
{
"
Directory
"
:
"
t/sessions
"
,
"
LockDirectory
"
:
"
t/sessions/lock
"
,
"
generateModule
"
:
"
Lemonldap::NG::Common::Apache::Session::Generate::SHA256
"
},
"
groups
"
:
{},
"
key
"
:
"
qwertyui
"
,
"
locationRules
"
:
{
"
manager.example.com
"
:
{
"
(?#Configuration)^/(manager
\\
.html|conf/)
"
:
"
$uid eq
\"
dwho
\"
"
,
"
(?#Notifications)^/notifications
"
:
"
$uid eq
\"
dwho
\"
or $uid eq
\"
rtyler
\"
"
,
"
(?#Sessions)^/sessions
"
:
"
$uid eq
\"
dwho
\"
or $uid eq
\"
rtyler
\"
"
,
"
default
"
:
"
$uid eq
\"
dwho
\"
"
},
"
test1.example.com
"
:
{
"
^/logout
"
:
"
logout_sso
"
,
"
^/deny
"
:
"
deny
"
,
"
default
"
:
"
accept
"
},
"
test2.example.com
"
:
{
"
^/logout
"
:
"
logout_sso
"
,
"
default
"
:
"
accept
"
}
},
"
macros
"
:
{
"
_whatToTrace
"
:
"
$_auth eq 'SAML' ?
\"
$_user
\\
@$_idpConfKey
\"
:
\"
$_user
\"
"
},
"
portal
"
:
"
http://auth.example.com/
"
,
"
reloadUrls
"
:
{},
"
userDB
"
:
"
Demo
"
,
"
whatToTrace
"
:
"
_whatToTrace
"
}
lemonldap-ng-portal/t/test-lib.pm
0 → 100644
View file @
1a16c2db
# Base library for portal tests
use
strict
;
use
Data::
Dumper
;
use
5.10.0
;
use_ok
('
Lemonldap::NG::Common::PSGI::Cli::Lib
');
use_ok
('
Lemonldap::NG::Portal::Main
');
our
$client
;
our
$count
=
3
;
$
Data::Dumper::
Deparse
=
1
;
ok
(
$client
=
Lemonldap::NG::Common::PSGI::Cli::
Lib
->
new
(
{
app
=>
Lemonldap::NG::Portal::
Main
->
run
(
{
configStorage
=>
{
type
=>
'
File
',
dirName
=>
'
t
'
},
logLevel
=>
'
warn
',
cookieName
=>
'
lemonldap
',
securedCookie
=>
0
,
https
=>
0
,
}
),
}
),
'
Portal app
'
);
sub
client
{
return
$client
;
}
sub
count
{
my
$c
=
shift
;
$count
+=
$c
if
(
$c
);
return
$count
;
}
sub
explain
{
my
(
$get
,
$ref
)
=
@_
;
$get
=
Dumper
(
$get
)
if
(
ref
$get
);
print
STDERR
"
Expect
$ref
, get
$get
\n
";
}
1
;
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