Mark some properties "lazy" to be sure conf is intialized (#595)
This commit is contained in:
parent
6efec8525f
commit
c761cc5781
|
@ -628,8 +628,7 @@ sub metadatas {
|
|||
. $c );
|
||||
}
|
||||
else {
|
||||
$self->logger->info(
|
||||
"REST request to get full configuration $c");
|
||||
$self->logger->info("REST request to get full configuration $c");
|
||||
}
|
||||
return $self->sendJSONresponse(
|
||||
$req,
|
||||
|
|
|
@ -5,7 +5,7 @@ use base 'Exporter';
|
|||
@EXPORT = qw(&isIPv6 &net6 &expand6);
|
||||
|
||||
sub isIPv6 {
|
||||
my($ip) = @_;
|
||||
my ($ip) = @_;
|
||||
return $ip =~ /^[a-z0-9:]+$/i;
|
||||
}
|
||||
|
||||
|
|
|
@ -292,7 +292,8 @@ sub forbidden {
|
|||
}
|
||||
|
||||
if ( $session->{_upgrade} ) {
|
||||
return $class->goToPortal( $class->unparsed_uri, undef, '/upgradesession' );
|
||||
return $class->goToPortal( $class->unparsed_uri, undef,
|
||||
'/upgradesession' );
|
||||
}
|
||||
|
||||
# Log forbidding
|
||||
|
|
|
@ -495,6 +495,7 @@ sub scanTree {
|
|||
push @sessionTypes, $1
|
||||
if ( $leaf =~ /^(.*)(?<!notification)StorageOptions$/ );
|
||||
my $attr = $attributes->{$leaf} or die("Missing attribute $leaf");
|
||||
|
||||
#print STDERR "| $attr->{documentation} | $leaf |\n";
|
||||
$jleaf = { id => "$prefix$leaf", title => $leaf };
|
||||
unless ( $attr->{type} ) {
|
||||
|
|
|
@ -136,7 +136,8 @@ ok( $res->{count} == 1, 'One A subnet' );
|
|||
ok( $res->{values}->[0]->{count} == 4, 'All sessions found' );
|
||||
$res = &client->jsonResponse( '/sessions/global', 'groupBy=net4(ipAddr,2)' );
|
||||
ok( $res->{count} == 3, 'Three B subnet' );
|
||||
ok( $res->{values}->[1]->{count} == 2, 'All sessions found' ) or print STDERR Dumper($res);
|
||||
ok( $res->{values}->[1]->{count} == 2, 'All sessions found' )
|
||||
or print STDERR Dumper($res);
|
||||
count(4);
|
||||
|
||||
$res = &client->jsonResponse( '/sessions/global', 'orderBy=net4(ipAddr)' );
|
||||
|
|
|
@ -16,6 +16,7 @@ extends 'Lemonldap::NG::Portal::Auth::LDAP';
|
|||
|
||||
has adPwdMaxAge => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
my $res = $conf->{ADPwdMaxAge} || 0;
|
||||
|
@ -25,6 +26,7 @@ has adPwdMaxAge => (
|
|||
|
||||
has adPwdExpireWarning => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
my $res = $conf->{ADPwdExpireWarning} || 0;
|
||||
|
|
|
@ -19,6 +19,7 @@ extends 'Lemonldap::NG::Portal::Auth::Base', 'Lemonldap::NG::Portal::Lib::CAS';
|
|||
# Act as a proxy if proxied services configured
|
||||
has proxy => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
return
|
||||
ref( $_[0]->conf->{CAS_proxiedServices} ) eq 'HASH'
|
||||
|
|
|
@ -17,6 +17,7 @@ has stackSub => ( is => 'rw' );
|
|||
|
||||
has wrapUserLogger => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
Lemonldap::NG::Portal::Lib::Combination::UserLogger->new(
|
||||
$_[0]->{userLogger} );
|
||||
|
|
|
@ -23,6 +23,7 @@ extends 'Lemonldap::NG::Portal::Auth::Base';
|
|||
|
||||
has secret => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
return $_[0]->conf->{openIdSecret}
|
||||
|| $_[0]->conf->{cipher}->encrypt(0);
|
||||
|
@ -31,6 +32,7 @@ has secret => (
|
|||
|
||||
has listIsWhite => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
( $_[0]->conf->{openIdIDPList} =~ /^(\d);/ )[0] + 0;
|
||||
}
|
||||
|
@ -38,6 +40,7 @@ has listIsWhite => (
|
|||
|
||||
has idpList => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
Lemonldap::NG::Common::Regexp::reDomainsToHost(
|
||||
( $_[0]->conf->{openIdIDPList} =~ /^\d;(.*)$/ )[0] );
|
||||
|
|
|
@ -302,8 +302,8 @@ sub authLogout {
|
|||
my $logout_url = $self->conf->{portal} . '?logout=1';
|
||||
$req->urldc(
|
||||
$self->buildLogoutRequest(
|
||||
$endsession_endpoint,
|
||||
$req->{sessionInfo}->{_oidc_id_token}, $logout_url
|
||||
$endsession_endpoint, $req->{sessionInfo}->{_oidc_id_token},
|
||||
$logout_url
|
||||
)
|
||||
);
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ our $VERSION = '2.0.0';
|
|||
|
||||
has service => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
return $_[0]->{conf}->{pamService} || 'login';
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ has radius => ( is => 'rw' );
|
|||
|
||||
has authnLevel => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{radiusAuthnLevel};
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ our $VERSION = '2.0.0';
|
|||
|
||||
has twitterRequestTokenURL => (
|
||||
is => 'ro',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{twitterRequestTokenURL}
|
||||
|| 'https://api.twitter.com/oauth/request_token';
|
||||
|
@ -19,6 +20,7 @@ has twitterRequestTokenURL => (
|
|||
|
||||
has twitterAuthorizeURL => (
|
||||
is => 'ro',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{twitterAuthorizeURL}
|
||||
|| 'https://api.twitter.com/oauth/authorize';
|
||||
|
@ -27,6 +29,7 @@ has twitterAuthorizeURL => (
|
|||
|
||||
has twitterAccessTokenURL => (
|
||||
is => 'ro',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->conf->{twitterAccessTokenURL}
|
||||
|| 'https://api.twitter.com/oauth/access_token';
|
||||
|
|
|
@ -20,6 +20,7 @@ extends 'Lemonldap::NG::Portal::Auth::Base';
|
|||
|
||||
has SSLField => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
return ( $_[0]->{conf}->{SSLVar} || 'SSL_CLIENT_S_DN_Email' );
|
||||
}
|
||||
|
|
|
@ -24,6 +24,7 @@ extends 'Lemonldap::NG::Portal::Auth::Base';
|
|||
|
||||
has authnLevel => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
return ( $conf->{portal} =~ /^https/ ? 2 : 1 );
|
||||
|
@ -109,7 +110,9 @@ sub extractFormInfo {
|
|||
$self->logger->debug("Captcha code verified");
|
||||
}
|
||||
elsif ( $self->ott ) {
|
||||
unless ( $req->datas->{tokenVerified} or $self->ott->getToken($token) ) {
|
||||
unless ( $req->datas->{tokenVerified}
|
||||
or $self->ott->getToken($token) )
|
||||
{
|
||||
$self->ott->setToken($req);
|
||||
$self->userLogger->warn('Token expired');
|
||||
return PE_TOKENEXPIRED;
|
||||
|
@ -150,7 +153,8 @@ sub getDisplayType {
|
|||
}
|
||||
|
||||
sub setSecurity {
|
||||
my($self,$req) = @_;
|
||||
my ( $self, $req ) = @_;
|
||||
|
||||
# If captcha is enable, prepare it
|
||||
if ( $self->captcha ) {
|
||||
$self->captcha->setCaptcha($req);
|
||||
|
|
|
@ -23,6 +23,7 @@ extends 'Lemonldap::NG::Portal::Main::Issuer';
|
|||
|
||||
has secret => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
return $_[0]->conf->{openIdIssuerSecret}
|
||||
|| $_[0]->conf->{cipher}->encrypt(0);
|
||||
|
@ -31,6 +32,7 @@ has secret => (
|
|||
|
||||
has listIsWhite => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
( $_[0]->conf->{openIdSPList} =~ /^(\d);/ )[0] + 0;
|
||||
}
|
||||
|
@ -38,6 +40,7 @@ has listIsWhite => (
|
|||
|
||||
has spList => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
Lemonldap::NG::Common::Regexp::reDomainsToHost(
|
||||
( $_[0]->conf->{openIdSPList} =~ /^\d;(.*)$/ )[0] );
|
||||
|
|
|
@ -28,6 +28,7 @@ sub beforeAuth { 'exportRequestParameters' }
|
|||
|
||||
has configStorage => (
|
||||
is => 'ro',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->{p}->HANDLER->localConfig->{configStorage};
|
||||
}
|
||||
|
@ -114,7 +115,9 @@ sub run {
|
|||
$oidc_request->{$param} = $req->param($param);
|
||||
$self->logger->debug( "OIDC request parameter $param: "
|
||||
. $oidc_request->{$param} );
|
||||
$self->p->setHiddenFormValue( $req, $param, $oidc_request->{$param}, '', 0 );
|
||||
$self->p->setHiddenFormValue( $req, $param,
|
||||
$oidc_request->{$param},
|
||||
'', 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -840,7 +843,9 @@ qq'<h3 trspan="oidcConsent,$display_name">The application $display_name would li
|
|||
$req->urldc($response_url);
|
||||
return PE_REDIRECT;
|
||||
}
|
||||
return $req->param('confirm') == 1 ? ($err ? $err : PE_LOGOUT_OK ) : PE_OK;
|
||||
return $req->param('confirm') == 1
|
||||
? ( $err ? $err : PE_LOGOUT_OK )
|
||||
: PE_OK;
|
||||
}
|
||||
|
||||
$req->info(
|
||||
|
|
|
@ -9,21 +9,46 @@ our $VERSION = '2.0.0';
|
|||
|
||||
extends 'Lemonldap::NG::Common::Module';
|
||||
|
||||
has width =>
|
||||
( is => 'rw', default => sub { $_[0]->{conf}->{captchaWidth} || 220 } );
|
||||
has height =>
|
||||
( is => 'rw', default => sub { $_[0]->{conf}->{captchaHeight} || 40 } );
|
||||
has lines =>
|
||||
( is => 'rw', default => sub { $_[0]->{conf}->{captchaLines} || 5 } );
|
||||
has scramble =>
|
||||
( is => 'rw', default => sub { $_[0]->{conf}->{captchaScramble} || 1 } );
|
||||
has fgColor =>
|
||||
( is => 'rw', default => sub { $_[0]->{conf}->{captchaFg} || '#403030' } );
|
||||
has bgColor =>
|
||||
( is => 'rw', default => sub { $_[0]->{conf}->{captchaBg} || '#FF644B' } );
|
||||
has rndmax =>
|
||||
( is => 'rw', default => sub { $_[0]->{conf}->{captcha_size} || 6 } );
|
||||
has timeout => ( is => 'rw', default => sub { $_[0]->{conf}->{formTimeout} } );
|
||||
has width => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{captchaWidth} || 220 }
|
||||
);
|
||||
has height => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{captchaHeight} || 40 }
|
||||
);
|
||||
has lines => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{captchaLines} || 5 }
|
||||
);
|
||||
has scramble => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{captchaScramble} || 1 }
|
||||
);
|
||||
has fgColor => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{captchaFg} || '#403030' }
|
||||
);
|
||||
has bgColor => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{captchaBg} || '#FF644B' }
|
||||
);
|
||||
has rndmax => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{captcha_size} || 6 }
|
||||
);
|
||||
has timeout => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { $_[0]->{conf}->{formTimeout} }
|
||||
);
|
||||
|
||||
has ott => (
|
||||
is => 'rw',
|
||||
|
|
|
@ -10,6 +10,7 @@ extends 'Lemonldap::NG::Common::Module';
|
|||
|
||||
has timeout => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->{conf}->{timeout};
|
||||
}
|
||||
|
@ -17,6 +18,7 @@ has timeout => (
|
|||
|
||||
has cache => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $c = $_[0]->{conf};
|
||||
if ( !$c->{tokenUseGlobalStorage} ) {
|
||||
|
|
|
@ -10,6 +10,7 @@ has module =>
|
|||
|
||||
has moduleOpts => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my %opts = %{ $_[0]->{conf}->{globalStorageOptions} || {} };
|
||||
$opts{backend} = $_[0]->{conf}->{globalStorage};
|
||||
|
|
|
@ -9,6 +9,7 @@ our $VERSION = '2.0.0';
|
|||
|
||||
has ua => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
return Lemonldap::NG::Common::UserAgent->new( $_[0]->{conf} );
|
||||
}
|
||||
|
|
|
@ -29,10 +29,12 @@ has random => (
|
|||
);
|
||||
has charset => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub { return $_[0]->{conf}->{mailCharset} || 'utf-8' }
|
||||
);
|
||||
has transport => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
return $transport if $transport;
|
||||
my $conf = $_[0]->{conf};
|
||||
|
|
|
@ -150,7 +150,10 @@ sub display {
|
|||
}
|
||||
|
||||
# 2.3 Case : user authenticated but an error was returned (bas url,...)
|
||||
elsif ( not $req->datas->{noerror} and $req->userData and %{ $req->userData } ) {
|
||||
elsif ( not $req->datas->{noerror}
|
||||
and $req->userData
|
||||
and %{ $req->userData } )
|
||||
{
|
||||
$skinfile = 'error';
|
||||
%templateParams = (
|
||||
AUTH_ERROR => $req->error,
|
||||
|
|
|
@ -28,6 +28,7 @@ has path => ( is => 'rw' );
|
|||
|
||||
has _ott => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $ott = $_[0]->{p}->loadModule('::Lib::OneTimeToken');
|
||||
$ott->timeout( $_[0]->{conf}->{formTimeout} );
|
||||
|
|
|
@ -15,6 +15,7 @@ extends 'Lemonldap::NG::Common::Module';
|
|||
|
||||
has menuModules => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
my $conf = $_[0]->{conf}->{menuModule};
|
||||
my @res;
|
||||
|
@ -31,6 +32,7 @@ has menuModules => (
|
|||
|
||||
has imgPath => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
return $_[0]->{conf}->{impgPath}
|
||||
|| $_[0]->{conf}->{staticPrefix} . '/logos';
|
||||
|
|
|
@ -74,10 +74,12 @@ sub controlUrl {
|
|||
}
|
||||
}
|
||||
$req->{datas}->{_url} ||= '';
|
||||
my ($url, $issuerUrl);
|
||||
if ( ($url = $req->param('url')) or ($issuerUrl = $req->param('issuerUrldc')) ) {
|
||||
my ( $url, $issuerUrl );
|
||||
if ( ( $url = $req->param('url') )
|
||||
or ( $issuerUrl = $req->param('issuerUrldc') ) )
|
||||
{
|
||||
|
||||
if($issuerUrl) {
|
||||
if ($issuerUrl) {
|
||||
$req->urlNotBase64(1);
|
||||
$url = $issuerUrl;
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ sub _run {
|
|||
$req->id(0);
|
||||
$self->p->rebuildCookies($req);
|
||||
my $res = $self->run( $req, $token );
|
||||
delete $req->{authResult} if($res);
|
||||
delete $req->{authResult} if ($res);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ sub verify {
|
|||
. $session->{ $self->conf->{whatToTrace} } );
|
||||
return PE_BADCREDENTIALS;
|
||||
}
|
||||
PE_OK
|
||||
PE_OK;
|
||||
}
|
||||
|
||||
# system() is used with an array to avoid shell injection
|
||||
|
|
|
@ -38,6 +38,7 @@ extends 'Lemonldap::NG::Portal::Main::Plugin',
|
|||
# Form timout token generator (used even if requireToken is not set)
|
||||
has ott => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $ott =
|
||||
$_[0]->{p}->loadModule('Lemonldap::NG::Portal::Lib::OneTimeToken');
|
||||
|
|
|
@ -51,6 +51,7 @@ extends 'Lemonldap::NG::Portal::Main::Plugin';
|
|||
|
||||
has configStorage => (
|
||||
is => 'ro',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->{p}->HANDLER->localConfig->{configStorage};
|
||||
}
|
||||
|
@ -58,6 +59,7 @@ has configStorage => (
|
|||
|
||||
has exportedAttr => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
if ( $conf->{exportedAttr} and $conf->{exportedAttr} !~ /^\s*\+/ ) {
|
||||
|
|
|
@ -35,6 +35,7 @@ has registerModule => ( is => 'rw' );
|
|||
# Register url to set in the mail
|
||||
has registerUrl => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $p = $_[0]->conf->{portal};
|
||||
$p =~ s#/*$##;
|
||||
|
@ -45,6 +46,7 @@ has registerUrl => (
|
|||
# Mail timeout token generator
|
||||
has mailott => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $ott =
|
||||
$_[0]->{p}->loadModule('Lemonldap::NG::Portal::Lib::OneTimeToken');
|
||||
|
|
|
@ -24,6 +24,7 @@ has server => ( is => 'rw' );
|
|||
|
||||
has configStorage => (
|
||||
is => 'ro',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->{p}->HANDLER->localConfig->{configStorage};
|
||||
}
|
||||
|
@ -31,6 +32,7 @@ has configStorage => (
|
|||
|
||||
has exportedAttr => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
if ( $conf->{exportedAttr} and $conf->{exportedAttr} !~ /^\s*\+/ ) {
|
||||
|
|
|
@ -26,6 +26,7 @@ use constant beforeLogout => 'logout';
|
|||
|
||||
has ott => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $ott =
|
||||
$_[0]->{p}->loadModule('Lemonldap::NG::Portal::Lib::OneTimeToken');
|
||||
|
@ -37,6 +38,7 @@ has ott => (
|
|||
# Default timeout: 1 month
|
||||
has timeout => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
$_[0]->{conf}->{stayConnectedTimeout} || 2678400;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ extends 'Lemonldap::NG::Portal::Main::Plugin';
|
|||
|
||||
has ott => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
default => sub {
|
||||
my $ott =
|
||||
$_[0]->{p}->loadModule('Lemonldap::NG::Portal::Lib::OneTimeToken');
|
||||
|
@ -66,9 +67,9 @@ sub confirm {
|
|||
return $self->p->do( $req, [ sub { PE_TOKENEXPIRED } ] );
|
||||
}
|
||||
}
|
||||
$req->steps(['controlUrl']);
|
||||
$req->steps( ['controlUrl'] );
|
||||
my $res = $self->p->process($req);
|
||||
return $self->p->do( $req, [ sub { $res } ] ) if($res);
|
||||
return $self->p->do( $req, [ sub { $res } ] ) if ($res);
|
||||
if ( $upg or $req->param('confirm') == 1 ) {
|
||||
$req->datas->{noerror} = 1;
|
||||
$self->p->setHiddenFormValue(
|
||||
|
|
|
@ -12,6 +12,7 @@ our $VERSION = '2.0.0';
|
|||
|
||||
has table => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
return $conf->{dbiUserTable} || $conf->{dbiAuthTable};
|
||||
|
@ -20,6 +21,7 @@ has table => (
|
|||
|
||||
has pivot => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
return $conf->{userPivot} || $conf->{dbiAuthLoginCol};
|
||||
|
@ -28,6 +30,7 @@ has pivot => (
|
|||
|
||||
has exportedVars => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
my $conf = $_[0]->{conf};
|
||||
return { %{ $conf->{exportedVars} }, %{ $conf->{dbiExportedVars} } };
|
||||
|
|
|
@ -10,6 +10,7 @@ our $VERSION = '2.0.0';
|
|||
|
||||
has vars => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
return {
|
||||
%{ $_[0]->conf->{exportedVars} },
|
||||
|
|
|
@ -11,6 +11,7 @@ our $VERSION = '2.0.0';
|
|||
|
||||
has ldapGroupAttributeNameSearch => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
return $_[0]->{conf}->{ldapGroupAttributeNameSearch}
|
||||
? [
|
||||
|
@ -30,6 +31,7 @@ has ldapGroupAttributeNameSearch => (
|
|||
|
||||
has attrs => (
|
||||
is => 'rw',
|
||||
lazy => 1,
|
||||
builder => sub {
|
||||
return [
|
||||
values %{ $_[0]->{conf}->{exportedVars} },
|
||||
|
|
|
@ -317,7 +317,8 @@ ywIDAQAB
|
|||
",
|
||||
samlSPMetaDataXML => {
|
||||
"sp.com" => {
|
||||
samlSPMetaDataXML => samlSPMetaDataXML('sp','HTTP-POST')
|
||||
samlSPMetaDataXML =>
|
||||
samlSPMetaDataXML( 'sp', 'HTTP-POST' )
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -364,7 +365,8 @@ sub sp {
|
|||
},
|
||||
samlIDPMetaDataXML => {
|
||||
idp => {
|
||||
samlIDPMetaDataXML => samlIDPMetaDataXML('idp','HTTP-POST')
|
||||
samlIDPMetaDataXML =>
|
||||
samlIDPMetaDataXML( 'idp', 'HTTP-POST' )
|
||||
}
|
||||
},
|
||||
samlOrganizationDisplayName => "SP",
|
||||
|
|
|
@ -334,7 +334,8 @@ ywIDAQAB
|
|||
",
|
||||
samlSPMetaDataXML => {
|
||||
"sp.com" => {
|
||||
samlSPMetaDataXML => samlSPMetaDataXML('sp','HTTP-POST')
|
||||
samlSPMetaDataXML =>
|
||||
samlSPMetaDataXML( 'sp', 'HTTP-POST' )
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -380,7 +381,8 @@ sub sp {
|
|||
},
|
||||
samlIDPMetaDataXML => {
|
||||
idp => {
|
||||
samlIDPMetaDataXML => samlIDPMetaDataXML('idp','HTTP-POST')
|
||||
samlIDPMetaDataXML =>
|
||||
samlIDPMetaDataXML( 'idp', 'HTTP-POST' )
|
||||
}
|
||||
},
|
||||
samlOrganizationDisplayName => "SP",
|
||||
|
|
|
@ -297,7 +297,8 @@ ywIDAQAB
|
|||
",
|
||||
samlSPMetaDataXML => {
|
||||
"sp.com" => {
|
||||
samlSPMetaDataXML => samlSPMetaDataXML('sp','HTTP-Redirect')
|
||||
samlSPMetaDataXML =>
|
||||
samlSPMetaDataXML( 'sp', 'HTTP-Redirect' )
|
||||
},
|
||||
},
|
||||
}
|
||||
|
@ -344,7 +345,8 @@ sub sp {
|
|||
},
|
||||
samlIDPMetaDataXML => {
|
||||
idp => {
|
||||
samlIDPMetaDataXML => samlIDPMetaDataXML('idp','HTTP-Redirect')
|
||||
samlIDPMetaDataXML =>
|
||||
samlIDPMetaDataXML( 'idp', 'HTTP-Redirect' )
|
||||
}
|
||||
},
|
||||
samlOrganizationDisplayName => "SP",
|
||||
|
|
|
@ -108,7 +108,7 @@ SKIP: {
|
|||
);
|
||||
expectOK($res);
|
||||
my $idpId = expectCookie($res);
|
||||
ok($res->[2]->[0] =~ /trmsg="84"/, 'Reject reason is 84');
|
||||
ok( $res->[2]->[0] =~ /trmsg="84"/, 'Reject reason is 84' );
|
||||
}
|
||||
|
||||
count($maintests);
|
||||
|
|
|
@ -72,6 +72,7 @@ ok(
|
|||
count(1);
|
||||
|
||||
($query) = expectRedirection( $res, qr#^http://auth.rp.com/?\?(.*)$# );
|
||||
|
||||
# Push OP response to RP
|
||||
switch ('rp');
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ ok(
|
|||
);
|
||||
count(1);
|
||||
my $idpId = expectCookie($res);
|
||||
ok($res->[2]->[0] =~ /trmsg="84"/, 'Reject reason is 84');
|
||||
ok( $res->[2]->[0] =~ /trmsg="84"/, 'Reject reason is 84' );
|
||||
count(1);
|
||||
|
||||
#print STDERR Dumper($res);
|
||||
|
|
|
@ -50,7 +50,9 @@ ok(
|
|||
count(1);
|
||||
expectOK($res);
|
||||
|
||||
ok( mail() =~ m#a href="http://auth.example.com/register\?(.*?)"#, 'Found register token') or print STDERR Dumper($main::mail);
|
||||
ok( mail() =~ m#a href="http://auth.example.com/register\?(.*?)"#,
|
||||
'Found register token' )
|
||||
or print STDERR Dumper($main::mail);
|
||||
$query = $1;
|
||||
ok( $query =~ /register_token=/, 'Found register_token' );
|
||||
count(2);
|
||||
|
@ -62,7 +64,11 @@ ok(
|
|||
expectOK($res);
|
||||
count(1);
|
||||
|
||||
ok( mail() =~ m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s, 'Found user and password');
|
||||
ok(
|
||||
mail() =~
|
||||
m#Your login is.+?<b>(\w+)</b>.*?Your password is.+?<b>(.*?)</b>#s,
|
||||
'Found user and password'
|
||||
);
|
||||
$user = $1;
|
||||
$pwd = $2;
|
||||
ok( $user eq 'fbar', 'Get good login' );
|
||||
|
|
Loading…
Reference in New Issue
Block a user