Commit 96263e0e authored by Xavier Guimard's avatar Xavier Guimard

Clean repo

parent 98e9e3a9
......@@ -13,4 +13,4 @@ describe('Lemonldap::NG', function() {
expect(browser.getCurrentUrl()).toMatch(new RegExp('^http://auth.example.com(:' + process.env.TESTWEBSERVERPORT + ')?/\\?url=aHR0cDovL3Rlc3QxLmV4YW1wbGUuY29tOjE5ODc2Lw=='));
});
});
});
});
\ No newline at end of file
......@@ -4,7 +4,7 @@ package Lemonldap::NG::Common::Conf::Backends::JSONFile;
use Lemonldap::NG::Common::Conf::File;
our @ISA = qw(Lemonldap::NG::Common::Conf::Backends::File);
our @ISA = qw(Lemonldap::NG::Common::Conf::Backends::File);
our $VERSION = '2.0.0';
1;
......
......@@ -23,7 +23,7 @@ use constant HANDLERSECTION => "handler";
use constant MANAGERSECTION => "manager";
use constant SESSIONSEXPLORERSECTION => "sessionsExplorer";
use constant APPLYSECTION => "apply";
our $hashParameters = qr/^(?:(?:l(?:o(?:ca(?:lSessionStorageOption|tionRule)|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|(?:(?:d(?:emo|bi)|facebook|webID)ExportedVa|exported(?:Heade|Va))r|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|c(?:as(?:StorageOption|Attribute)|ombModule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idc(?:RPMetaData(?:(?:Option(?:sExtraClaim)?|ExportedVar)s|Node)|OPMetaData(?:(?:ExportedVar|Option)s|J(?:SON|WKS)|Node)|S(?:erviceMetaDataAuthnContext|torageOptions))|penIdExportedVars)|s(?:aml(?:S(?:PMetaData(?:(?:ExportedAttribute|Option)s|Node|XML)|torageOptions)|IDPMetaData(?:(?:ExportedAttribute|Option)s|Node|XML))|(?:laveExportedVar|TokenScope)s|essionDataToRemember)|p(?:ersistentStorageOptions|o(?:rtalSkinRules|st))|a(?:uthChoiceModules|pplicationList)|v(?:hostOptions|irtualHost)|SSLVarIf)$/;
our $hashParameters = qr/^(?:(?:l(?:o(?:ca(?:lSessionStorageOption|tionRule)|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|(?:(?:d(?:emo|bi)|facebook|webID)ExportedVa|exported(?:Heade|Va))r|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|c(?:as(?:StorageOption|Attribute)|ombModule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idc(?:RPMetaData(?:(?:Option(?:sExtraClaim)?|ExportedVar)s|Node)|OPMetaData(?:(?:ExportedVar|Option)s|J(?:SON|WKS)|Node)|S(?:erviceMetaDataAuthnContext|torageOptions))|penIdExportedVars)|s(?:aml(?:S(?:PMetaData(?:(?:ExportedAttribute|Option)s|Node|XML)|torageOptions)|IDPMetaData(?:(?:ExportedAttribute|Option)s|Node|XML))|essionDataToRemember|laveExportedVars)|p(?:ersistentStorageOptions|o(?:rtalSkinRules|st))|a(?:uthChoiceModules|pplicationList)|v(?:hostOptions|irtualHost)|SSLVarIf)$/;
our @sessionTypes = ( 'remoteGlobal', 'cas', 'global', 'localSession', 'persistent', 'saml', 'oidc' );
......
......@@ -20,7 +20,7 @@ our $specialNodeHash = {
};
our $doubleHashKeys = 'issuerDBGetParameters';
our $simpleHashKeys = '(?:(?:l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|c(?:as(?:StorageOption|Attribute)|ombModule)|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|s(?:(?:amlStorageOption|laveExportedVar|TokenScope)s|essionDataToRemember)|o(?:idcS(?:erviceMetaDataAuthnContext|torageOptions)|penIdExportedVars)|a(?:uthChoiceModules|pplicationList)|SSLVarIf)';
our $simpleHashKeys = '(?:(?:l(?:o(?:calSessionStorageOption|goutService)|dapExportedVar|wp(?:Ssl)?Opt)|(?:(?:d(?:emo|bi)|facebook|webID)E|e)xportedVar|g(?:r(?:antSessionRule|oup)|lobalStorageOption)|n(?:otificationStorageOption|ginxCustomHandler)|c(?:as(?:StorageOption|Attribute)|ombModule)|p(?:ersistentStorageOption|ortalSkinRule)|re(?:moteGlobalStorageOption|loadUrl)|CAS_proxiedService|macro)s|o(?:idcS(?:erviceMetaDataAuthnContext|torageOptions)|penIdExportedVars)|s(?:(?:amlStorageOption|laveExportedVar)s|essionDataToRemember)|a(?:uthChoiceModules|pplicationList)|SSLVarIf)';
our $specialNodeKeys = '(?:(?:saml(?:ID|S)|oidc[OR])PMetaDataNode|virtualHost)s';
our $oidcOPMetaDataNodeKeys = 'oidcOPMetaData(?:Options(?:C(?:lient(?:Secret|ID)|heckJWTSignature|onfigurationURI)|TokenEndpointAuthMethod|(?:JWKSTimeou|Promp)t|I(?:DTokenMaxAge|con)|S(?:toreIDToken|cope)|U(?:iLocales|seNonce)|Display(?:Name)?|AcrValues|MaxAge)|ExportedVars|J(?:SON|WKS))';
our $oidcRPMetaDataNodeKeys = 'oidcRPMetaData(?:Options(?:I(?:DToken(?:Expiration|SignAlg)|con)|(?:RedirectUri|ExtraClaim)s|AccessTokenExpiration|Client(?:Secret|ID)|BypassConsent|DisplayName|UserIDAttr)|ExportedVars)';
......
......@@ -5,17 +5,17 @@ use strict;
our $VERSION = '2.0.0';
sub fetchId {
my($class) = @_;
my ($class) = @_;
my $token = $class->header_in('X-Llng-Token');
return $class->Lemonldap::NG::Handler::Main::fetchId() unless($token);
return $class->Lemonldap::NG::Handler::Main::fetchId() unless ($token);
$class->logger->debug('Found token header');
my $s $class->tsv->{cipher}->decrypt($s);
my($t,$_session_id,@vhosts) = split /:/, $s;
unless(@vhosts) {
my $s = $class->tsv->{cipher}->decrypt($token);
my ( $t, $_session_id, @vhosts ) = split /:/, $s;
unless (@vhosts) {
$class->userLogger->error('Bad token');
return 0;
}
unless($t <= time and $t > time -15) {
unless ( $t <= time and $t > time - 15 ) {
$class->userLogger->warn('Expired token');
return 0;
}
......
......@@ -338,7 +338,7 @@ sub headersInit {
$headers ||= $conf->{exportedHeaders};
# Creation of the subroutine which will generate headers
foreach my $vhost ( keys %{ $headers } ) {
foreach my $vhost ( keys %{$headers} ) {
my %headers = %{ $headers->{$vhost} };
$class->tsv->{headerList}->{$vhost} = [ keys %headers ];
my $sub = '';
......
......@@ -13,24 +13,48 @@ init('Lemonldap::NG::Handler::Server');
my $res;
# Authorizated queries
ok( $res = $client->_get( '/', undef, 'test3.example.com', "lemonldap=$sessionId", VHOSTTYPE => 'DevOps' ),
'Authorizated query' );
ok(
$res = $client->_get(
'/', undef,
'test3.example.com', "lemonldap=$sessionId",
VHOSTTYPE => 'DevOps'
),
'Authorizated query'
);
ok( $res->[0] == 200, 'Code is 200' ) or explain( $res->[0], 200 );
count(2);
ok( $res = $client->_get( '/testyes', undef, 'test3.example.com', "lemonldap=$sessionId", VHOSTTYPE => 'DevOps' ),
'Authorizated query' );
ok(
$res = $client->_get(
'/testyes', undef,
'test3.example.com', "lemonldap=$sessionId",
VHOSTTYPE => 'DevOps'
),
'Authorizated query'
);
ok( $res->[0] == 200, 'Code is 200' ) or explain( $res->[0], 200 );
count(2);
# Denied queries
ok( $res = $client->_get( '/deny', undef, 'test3.example.com', "lemonldap=$sessionId", VHOSTTYPE => 'DevOps' ),
'Denied query' );
ok(
$res = $client->_get(
'/deny', undef,
'test3.example.com', "lemonldap=$sessionId",
VHOSTTYPE => 'DevOps'
),
'Denied query'
);
ok( $res->[0] == 403, 'Code is 403' ) or explain( $res->[0], 403 );
count(2);
ok( $res = $client->_get( '/testno', undef, 'test3.example.com', "lemonldap=$sessionId", VHOSTTYPE => 'DevOps' ),
'Denied query' );
ok(
$res = $client->_get(
'/testno', undef,
'test3.example.com', "lemonldap=$sessionId",
VHOSTTYPE => 'DevOps'
),
'Denied query'
);
ok( $res->[0] == 403, 'Code is 403' ) or explain( $res->[0], 403 );
count(2);
......@@ -56,7 +80,7 @@ sub LWP::UserAgent::request {
}
}';
$httpResp = HTTP::Response->new( 200, 'OK' );
$httpResp->header( 'Content-Type', 'application/json' );
$httpResp->header( 'Content-Type', 'application/json' );
$httpResp->header( 'Content-Length', length($s) );
$httpResp->content($s);
return $httpResp;
......
......@@ -34,7 +34,7 @@ sub init {
if ( my $localconf = $self->confAcc->getLocalConf(MANAGERSECTION) ) {
foreach ( keys %$localconf ) {
$args->{$_} //= $localconf->{$_};
$self->{$_} = $args->{$_} unless(/^(?:l|userL)ogger$/);
$self->{$_} = $args->{$_} unless (/^(?:l|userL)ogger$/);
}
}
......
......@@ -2784,13 +2784,6 @@ qr/^(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-
'staticPrefix' => {
'type' => 'text'
},
'sTokenScopes' => {
'type' => 'keyTextContainer'
},
'sTokenService' => {
'default' => 0,
'type' => 'bool'
},
'storePassword' => {
'default' => 0,
'type' => 'bool'
......
......@@ -989,7 +989,7 @@ sub extractFormInfo {
$infos->{Artifact} = $req->datas->{_proxiedArtifact};
$infos->{ProxyID} = $samlID;
my $samlSessionInfo = $self->getSamlSession(undef, $infos);
my $samlSessionInfo = $self->getSamlSession( undef, $infos );
return PE_SAML_SESSION_ERROR unless $samlSessionInfo;
......@@ -1180,7 +1180,6 @@ sub authFinish {
. $nameid->dump
. " and SessionIndex $session_index for session $id" );
my $infos;
$infos->{type} = 'saml'; # Session type
$infos->{_utime} = $utime; # Creation time
......@@ -1189,7 +1188,7 @@ sub authFinish {
$infos->{_sessionIndex} = $session_index; # SAML SessionIndex
# Save SAML session
my $samlSessionInfo = $self->getSamlSession(undef, $infos);
my $samlSessionInfo = $self->getSamlSession( undef, $infos );
return PE_SAML_SESSION_ERROR unless $samlSessionInfo;
......
......@@ -505,7 +505,8 @@ qq'<h3 trspan="oidcConsent,$display_name">The application $display_name would li
if ( $flow eq "authorizationcode" ) {
# Store data in session
my $codeSession = $self->getOpenIDConnectSession(undef,
my $codeSession = $self->getOpenIDConnectSession(
undef,
{
redirect_uri => $oidc_request->{'redirect_uri'},
scope => $oidc_request->{'scope'},
......@@ -516,7 +517,7 @@ qq'<h3 trspan="oidcConsent,$display_name">The application $display_name would li
);
# Generate code
my $code = $codeSession->id();
my $code = $codeSession->id();
$self->logger->debug("Generated code: $code");
......@@ -543,7 +544,8 @@ qq'<h3 trspan="oidcConsent,$display_name">The application $display_name would li
# Store data in access token
# Generate access_token
my $accessTokenSession = $self->getOpenIDConnectSession(undef,
my $accessTokenSession = $self->getOpenIDConnectSession(
undef,
{
scope => $oidc_request->{'scope'},
rp => $rp,
......@@ -654,7 +656,8 @@ qq'<h3 trspan="oidcConsent,$display_name">The application $display_name would li
my ($hash_level) = ( $alg =~ /(?:\w{2})(\d{3})/ );
# Store data in session
my $codeSession = $self->getOpenIDConnectSession(undef,
my $codeSession = $self->getOpenIDConnectSession(
undef,
{
redirect_uri => $oidc_request->{'redirect_uri'},
scope => $oidc_request->{'scope'},
......@@ -665,7 +668,7 @@ qq'<h3 trspan="oidcConsent,$display_name">The application $display_name would li
);
# Generate code
my $code = $codeSession->id();
my $code = $codeSession->id();
$self->logger->debug("Generated code: $code");
......@@ -675,7 +678,8 @@ qq'<h3 trspan="oidcConsent,$display_name">The application $display_name would li
if ( $response_type =~ /\btoken\b/ ) {
# Generate access_token
my $accessTokenSession = $self->getOpenIDConnectSession(undef,
my $accessTokenSession = $self->getOpenIDConnectSession(
undef,
{
scope => $oidc_request->{'scope'},
rp => $rp,
......@@ -895,7 +899,8 @@ sub token {
$self->logger->debug("Found corresponding user: $user_id");
# Generate access_token
my $accessTokenSession = $self->getOpenIDConnectSession(undef,
my $accessTokenSession = $self->getOpenIDConnectSession(
undef,
{
scope => $codeSession->data->{scope},
rp => $rp,
......
......@@ -251,7 +251,7 @@ has server => ( is => 'rw' );
sub notificationServer {
my ( $self, $req ) = @_;
unless ($self->imported) {
unless ( $self->imported ) {
eval {
require Lemonldap::NG::Common::PSGI::SOAPServer;
require Lemonldap::NG::Common::PSGI::SOAPService;
......@@ -259,9 +259,7 @@ sub notificationServer {
if ($@) {
return $self->p->sendError( $req, $@, 500 );
}
$self->server(
Lemonldap::NG::Common::PSGI::SOAPServer->new
);
$self->server( Lemonldap::NG::Common::PSGI::SOAPServer->new );
$self->imported(1);
}
unless ( $req->env->{HTTP_SOAPACTION} ) {
......@@ -275,7 +273,7 @@ sub notificationServer {
}
sub newNotification {
my($self,$req,$xml) = @_;
my ( $self, $req, $xml ) = @_;
return $self->notifObject->newNotification($xml);
}
......
......@@ -258,7 +258,8 @@ sub buildAuthorizationCodeAuthnRequest {
my $nonce;
if ($use_nonce) {
my $nonceSession = $self->getOpenIDConnectSession( undef, { '_utime' => time });
my $nonceSession =
$self->getOpenIDConnectSession( undef, { '_utime' => time } );
$nonce = $nonceSession->id;
}
......@@ -640,7 +641,7 @@ sub getOpenIDConnectSession {
cacheModuleOptions => $self->conf->{localSessionStorageOptions},
id => $id,
kind => "OpenIDConnect",
($info ? (info => $info):()),
( $info ? ( info => $info ) : () ),
}
);
......@@ -673,7 +674,6 @@ sub storeState {
}
return unless ($infos);
# Session type
$infos->{_type} = "state";
......@@ -686,7 +686,7 @@ sub storeState {
$infos->{_utime} = $time + ( $stateTimeout - $timeout );
# Create state session and store infos
my $stateSession = $self->getOpenIDConnectSession( undef, $infos);
my $stateSession = $self->getOpenIDConnectSession( undef, $infos );
return unless $stateSession;
# Return session ID
......
......@@ -15,16 +15,16 @@ has ua => (
);
sub restCall {
my($self,$url,$content) = @_;
my ( $self, $url, $content ) = @_;
my $hreq = HTTP::Request->new( POST => $url );
$hreq->header( 'Content-Type' => 'application/json' );
$hreq->content(to_json($content));
$hreq->content( to_json($content) );
my $resp = $self->ua->request($hreq);
unless ( $resp->is_success ) {
die $resp->status_line;
}
my $res = eval { from_json( $resp->content ) };
die "Bad REST response: $@" if($@);
die "Bad REST response: $@" if ($@);
return $res;
}
......
......@@ -1780,7 +1780,7 @@ sub createArtifactResponse {
# Load artifact message into login response
my $art_session = $self->loadArtifact($artifact_id);
utf8::decode($art_session->{message});
utf8::decode( $art_session->{message} );
eval { $login->set_artifact_message( $art_session->{message} ); };
if ($@) {
$self->checkLassoError($@);
......
......@@ -90,7 +90,7 @@ sub display {
&& $req->datas->{login},
ASK_LOGINS => $req->param('checkLogins') || 0,
CONFIRMKEY => $self->stamp(),
LIST => $req->datas->{list} || [],
LIST => $req->datas->{list} || [],
REMEMBER => $req->datas->{confirmRemember},
);
}
......
......@@ -25,8 +25,8 @@ sub modifyPassword {
my ( $self, $req, $pwd ) = @_;
# Call the modify password method
my $code =
$self->ldap->userModifyPassword( $req->userData->{dn}, $pwd, $req->datas->{oldpassword} );
my $code = $self->ldap->userModifyPassword( $req->userData->{dn},
$pwd, $req->datas->{oldpassword} );
unless ( $code == PE_PASSWORD_OK ) {
$self->ldap->unbind;
......
......@@ -26,8 +26,10 @@ sub init {
sub confirm {
my ( $self, $req, $pwd ) = @_;
my $res = eval {
$self->restCall( $self->conf->{restPwdConfirmUrl},
{ user => $req->user, password => $pwd } );
$self->restCall(
$self->conf->{restPwdConfirmUrl},
{ user => $req->user, password => $pwd }
);
};
if ($@) {
$self->logger("Pwd confirm error: $@");
......@@ -39,8 +41,10 @@ sub confirm {
sub modifyPassword {
my ( $self, $req, $pwd ) = @_;
my $res = eval {
$self->restCall( $self->conf->{restPwdModifyUrl},
{ user => $req->user, password => $pwd } );
$self->restCall(
$self->conf->{restPwdModifyUrl},
{ user => $req->user, password => $pwd }
);
};
if ($@) {
$self->logger("Pwd confirm error: $@");
......
......@@ -246,7 +246,7 @@ sub setAttributes {
my $infos = {};
%$infos = %$args;
my $session = $self->p->getApacheSession($id, info => $infos);
my $session = $self->p->getApacheSession( $id, info => $infos );
unless ($session) {
$self->logger->warn("Session $id does not exists ($@)");
......@@ -288,7 +288,7 @@ sub newSession {
%$infos = %$args;
$infos->{_utime} = time();
my $session = $self->p->getApacheSession(undef, info => $infos);
my $session = $self->p->getApacheSession( undef, info => $infos );
unless ($session) {
$self->logger->error("Unable to create session");
......
......@@ -32,13 +32,13 @@ sub computeLogin {
# @result Lemonldap::NG::Portal constant
sub createUser {
my ( $self, $req ) = @_;
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{ $req->datas->{registerInfo}->{login} }
= {
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{ $req->datas
->{registerInfo}->{login} } = {
uid => $req->datas->{registerInfo}->{login},
cn => $req->datas->{registerInfo}->{firstname} . ' '
. $req->datas->{registerInfo}->{lastname},
mail => $req->datas->{registerInfo}->{login} . '@badwolf.org',
};
};
return PE_OK;
}
......
......@@ -14,17 +14,17 @@ SKIP: {
my $client = LLNG::Manager::Test->new(
{
ini => {
logLevel => 'error',
useSafeJail => 1,
authentication => 'LDAP',
portal => 'http://auth.example.com/',
userDB => 'Same',
passwordDB => 'LDAP',
logLevel => 'error',
useSafeJail => 1,
authentication => 'LDAP',
portal => 'http://auth.example.com/',
userDB => 'Same',
passwordDB => 'LDAP',
portalRequireOldPassword => 1,
ldapServer => 'ldap://127.0.0.1:19389/',
ldapBase => 'ou=users,dc=example,dc=com',
managerDn => 'cn=admin,dc=example,dc=com',
managerPassword => 'admin',
ldapServer => 'ldap://127.0.0.1:19389/',
ldapBase => 'ou=users,dc=example,dc=com',
managerDn => 'cn=admin,dc=example,dc=com',
managerPassword => 'admin',
}
}
);
......
......@@ -30,8 +30,7 @@ SKIP: {
switch ('issuer');
ok(
$res = $issuer->_post(
'/',
IO::String->new('user=russian&password=russian'),
'/', IO::String->new('user=russian&password=russian'),
length => 29
),
'Auth query'
......@@ -495,7 +494,7 @@ sub sp {
samlIDPMetaDataOptionsSignSLOMessage => 1,
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsAllowLoginFromIDP => 1,
}
},
......
......@@ -544,7 +544,7 @@ sub sp {
samlIDPMetaDataOptionsSignSLOMessage => 1,
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
}
},
samlIDPMetaDataExportedAttributes => {
......
......@@ -30,8 +30,7 @@ SKIP: {
switch ('issuer');
ok(
$res = $issuer->_post(
'/',
IO::String->new('user=russian&password=russian'),
'/', IO::String->new('user=russian&password=russian'),
length => 29
),
'Auth query'
......@@ -523,7 +522,7 @@ sub sp {
samlIDPMetaDataOptionsSignSLOMessage => 1,
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsAllowLoginFromIDP => 1,
}
},
......
......@@ -539,7 +539,7 @@ sub sp {
samlIDPMetaDataOptionsSignSLOMessage => 1,
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
}
},
samlIDPMetaDataExportedAttributes => {
......
......@@ -30,8 +30,7 @@ SKIP: {
switch ('issuer');
ok(
$res = $issuer->_post(
'/',
IO::String->new('user=russian&password=russian'),
'/', IO::String->new('user=russian&password=russian'),
length => 29
),
'Auth query'
......@@ -506,7 +505,7 @@ sub sp {
samlIDPMetaDataOptionsSignSLOMessage => 1,
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsAllowLoginFromIDP => 1,
}
},
......
......@@ -556,7 +556,7 @@ sub sp {
samlIDPMetaDataOptionsSignSLOMessage => 1,
samlIDPMetaDataOptionsCheckSSOMessageSignature => 1,
samlIDPMetaDataOptionsCheckSLOMessageSignature => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
samlIDPMetaDataOptionsForceUTF8 => 1,
}
},
samlIDPMetaDataExportedAttributes => {
......
......@@ -241,6 +241,7 @@ sub LWP::UserAgent::request {
while ( my $name = shift @{ $res->[1] } ) {
$httpResp->header( $name, shift( @{ $res->[1] } ) );
}
#print STDERR Dumper($res->[2]);
$httpResp->content( join( '', @{ $res->[2] } ) );
count(4);
......
......@@ -48,7 +48,8 @@ SKIP: {
'SOAP client'
);
$soap->default_ns('urn:Lemonldap/NG/Common/PSGI/SOAPService');
ok( $soap->call( 'newNotification', $xml )->result() ==1, ' SOAP call returns 1' );
ok( $soap->call( 'newNotification', $xml )->result() == 1,
' SOAP call returns 1' );
# Try yo authenticate
# -------------------
......
# Try to launch an LDAP server
if($ENV{LLNGTESTLDAP}) {
my $slapd_bin = $ENV{LLNGTESTLDAP_SLAPD_BIN} || '/usr/sbin/slapd';
if ( $ENV{LLNGTESTLDAP} ) {
my $slapd_bin = $ENV{LLNGTESTLDAP_SLAPD_BIN} || '/usr/sbin/slapd';
my $slapadd_bin = $ENV{LLNGTESTLDAP_SLAPADD_BIN} || '/usr/sbin/slapadd';
my $slapd_schema_dir = $ENV{LLNGTESTLDAP_SCHEMA_DIR} || '/etc/slapd/schema';
eval { mkdir 't/testslapd/slapd.d' };
eval { mkdir 't/testslapd/data' };
system('cp t/testslapd/slapd.ldif t/testslapd/slapd-test.ldif');
system("/bin/sed -i 's:__SCHEMA_DIR__:$slapd_schema_dir:' t/testslapd/slapd-test.ldif");
system($slapadd_bin . ' -F t/testslapd/slapd.d -n 0 -l t/testslapd/slapd-test.ldif');
system($slapadd_bin . ' -F t/testslapd/slapd.d -n 1 -l t/testslapd/users.ldif');
system($slapd_bin . ' -s 256 -h "ldap://127.0.0.1:19389/" -F t/testslapd/slapd.d');
system(
"/bin/sed -i 's:__SCHEMA_DIR__:$slapd_schema_dir:' t/testslapd/slapd-test.ldif"
);
system( $slapadd_bin
. ' -F t/testslapd/slapd.d -n 0 -l t/testslapd/slapd-test.ldif' );
system( $slapadd_bin
. ' -F t/testslapd/slapd.d -n 1 -l t/testslapd/users.ldif' );
system( $slapd_bin
. ' -s 256 -h "ldap://127.0.0.1:19389/" -F t/testslapd/slapd.d' );
}
sub stopLdapServer {
if($ENV{LLNGTESTLDAP}) {
if ( $ENV{LLNGTESTLDAP} ) {
open F, 't/testslapd/slapd.pid';
my $pid = join '', <F>;
system "kill $pid";
......
......@@ -247,13 +247,13 @@ has ini => (
eval
'sub Lemonldap::NG::Common::Logger::Std::error {return $_[0]->warn($_[1])}';
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{french} = {
uid => 'french',
cn => 'Frédéric Accents',
uid => 'french',
cn => 'Frédéric Accents',
mail => 'fa@badwolf.org',
};
$Lemonldap::NG::Portal::UserDB::Demo::demoAccounts{russian} = {
uid => 'russian',
cn => 'Русский',
uid => 'russian',
cn => 'Русский',
mail => 'ru@badwolf.org',
};
$self;
......
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