Commit 08647bb9 authored by Christophe Maudoux's avatar Christophe Maudoux

Improve unit test (#1636)

parent 84e23070
......@@ -43,7 +43,7 @@ our $authParameters = {
demoParams => [qw(demoExportedVars)],
facebookParams => [qw(facebookAuthnLevel facebookExportedVars facebookAppId facebookAppSecret facebookUserField)],
kerberosParams => [qw(krbKeytab krbByJs krbAuthnLevel krbRemoveDomain)],
ldapParams => [qw(ldapAuthnLevel ldapExportedVars ldapServer ldapPort ldapBase managerDn managerPassword ldapTimeout ldapVersion ldapRaw LDAPFilter AuthLDAPFilter mailLDAPFilter ldapSearchDeref ldapGroupBase ldapGroupObjectClass ldapGroupAttributeName ldapGroupAttributeNameUser ldapGroupAttributeNameSearch ldapGroupRecursive ldapGroupAttributeNameGroup ldapPpolicyControl ldapSetPassword ldapChangePasswordAsUser ldapPwdEnc ldapUsePasswordResetAttribute ldapPasswordResetAttribute ldapPasswordResetAttributeValue ldapAllowResetExpiredPassword)],
ldapParams => [qw(ldapAuthnLevel ldapExportedVars ldapServer ldapPort ldapBase managerDn managerPassword ldapTimeout ldapVersion ldapRaw LDAPFilter AuthLDAPFilter mailLDAPFilter ldapSearchDeref ldapGroupBase ldapGroupObjectClass ldapGroupAttributeName ldapGroupAttributeNameUser ldapGroupAttributeNameSearch ldapGroupDecodeSearchedValue ldapGroupRecursive ldapGroupAttributeNameGroup ldapPpolicyControl ldapSetPassword ldapChangePasswordAsUser ldapPwdEnc ldapUsePasswordResetAttribute ldapPasswordResetAttribute ldapPasswordResetAttributeValue ldapAllowResetExpiredPassword)],
linkedinParams => [qw(linkedInAuthnLevel linkedInClientID linkedInClientSecret linkedInFields linkedInUserField linkedInScope)],
nullParams => [qw(nullAuthnLevel)],
oidcParams => [qw(oidcAuthnLevel oidcRPCallbackGetParam oidcRPStateTimeout)],
......
......@@ -1353,6 +1353,10 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
'ldapGroupBase' => {
'type' => 'text'
},
'ldapGroupDecodeSearchedValue' => {
'default' => 0,
'type' => 'bool'
},
'ldapGroupObjectClass' => {
'default' => 'groupOfNames',
'type' => 'text'
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -151,6 +151,7 @@ site/coffee/portal.coffee
site/coffee/redirect.coffee
site/coffee/registerbrowser.coffee
site/coffee/ssl.coffee
site/coffee/sslChoice.coffee
site/coffee/totpregistration.coffee
site/coffee/u2fcheck.coffee
site/coffee/u2fregistration.coffee
......@@ -274,6 +275,8 @@ site/htdocs/static/common/js/registerbrowser.js
site/htdocs/static/common/js/registerbrowser.min.js
site/htdocs/static/common/js/ssl.js
site/htdocs/static/common/js/ssl.min.js
site/htdocs/static/common/js/sslChoice.js
site/htdocs/static/common/js/sslChoice.min.js
site/htdocs/static/common/js/totpregistration.js
site/htdocs/static/common/js/totpregistration.min.js
site/htdocs/static/common/js/u2f-api.js
......@@ -355,6 +358,7 @@ site/templates/bootstrap/samlSpSoapLogout.tpl
site/templates/bootstrap/sessionArray.tpl
site/templates/bootstrap/simpleInfo.tpl
site/templates/bootstrap/sslform.tpl
site/templates/bootstrap/sslformChoice.tpl
site/templates/bootstrap/standardform.tpl
site/templates/bootstrap/totp2fcheck.tpl
site/templates/bootstrap/totp2fregister.tpl
......
......@@ -6,21 +6,31 @@ require 't/test-lib.pm';
my $res;
my $client = LLNG::Manager::Test->new(
{
ini => {
{ ini => {
logLevel => 'error',
useSafeJail => 1,
authentication => 'SSL',
userDB => 'Null',
SSLVar => 'SSL_CLIENT_S_DN_Custom',
sslByAjax => 1,
sslHost => 'https://authssl.example.com:19876'
}
}
);
ok(
$res = $client->_get(
'/', custom => { SSL_CLIENT_S_DN_Custom => 'dwho' }
),
ok( $res = $client->_get( '/', accept => 'text/html' ), 'Get Menu' );
ok( $res->[2]->[0]
=~ m%<script type="application/init">\{"sslHost":"https://authssl.example.com:19876"\}</script>%,
' SSL AJAX URL found'
) or print STDERR Dumper( $res->[2]->[0] );
ok( $res->[2]->[0] =~ qr%<img src="/static/common/modules/SSL.png"%,
'Found 5_ssl Logo' )
or print STDERR Dumper( $res->[2]->[0] );
count(3);
ok( $res
= $client->_get( '/',
custom => { SSL_CLIENT_S_DN_Custom => 'dwho' } ),
'Auth query'
);
expectOK($res);
......@@ -29,8 +39,7 @@ count(1);
&Lemonldap::NG::Handler::Main::cfgNum( 0, 0 );
$client = LLNG::Manager::Test->new(
{
ini => {
{ ini => {
logLevel => 'error',
useSafeJail => 1,
authentication => 'SSL',
......@@ -39,12 +48,11 @@ $client = LLNG::Manager::Test->new(
}
);
ok(
$res = $client->_get(
'/', custom => { SSL_CLIENT_S_DN_Email => 'dwho' }
),
ok( $res
= $client->_get( '/', custom => { SSL_CLIENT_S_DN_Email => 'dwho' } ),
'Auth query'
);
expectOK($res);
expectCookie($res);
count(1);
......
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