environments/ppa-mbqj77/deployments/1
Xavier Guimard 9 years ago
parent 8d6bc6ba8e
commit 7c676d8d99
  1. 2
      e2e-tests/manager/11-oidcop-config.js
  2. 3
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/File.pm
  3. 3
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/RDBI.pm
  4. 10
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/Serializer.pm
  5. 3
      lemonldap-ng-common/lib/Lemonldap/NG/Common/Conf/_DBI.pm
  6. 3
      lemonldap-ng-common/lib/Lemonldap/NG/Common/PSGI.pm
  7. 2
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager.pm
  8. 9
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Build.pm
  9. 3
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Conf/Parser.pm
  10. 3
      lemonldap-ng-manager/lib/Lemonldap/NG/Manager/Lib.pm
  11. 4
      lemonldap-ng-manager/t/07-utf8.t
  12. 3
      lemonldap-ng-manager/t/10-save-unchanged-conf.t
  13. 4
      lemonldap-ng-manager/t/20-test-coverage.t
  14. 6
      lemonldap-ng-portal/example/oauth2.pl

@ -53,4 +53,4 @@ describe('Lemonldap::NG Manager', function() {
expect(element(by.id('textinput')).getAttribute('value')).toEqual('http://my-partner.com');
});
});
});
});

@ -81,8 +81,7 @@ sub store {
my ( $self, $fields ) = @_;
my $mask = umask;
umask( oct('0027') );
unless ( open FILE, '>', $self->_file( $fields->{cfgNum} ) )
{
unless ( open FILE, '>', $self->_file( $fields->{cfgNum} ) ) {
$Lemonldap::NG::Common::Conf::msg = "Open file failed: $! \n";
$self->unlock;
return UNKNOWN_ERROR;

@ -54,8 +54,7 @@ sub load {
my ( $self, $cfgNum, $fields ) = @_;
$fields = $fields ? join( ",", @$fields ) : '*';
my $sth =
$self->_dbh
->prepare( "SELECT cfgNum,field,value from "
$self->_dbh->prepare( "SELECT cfgNum,field,value from "
. $self->{dbiTable}
. " WHERE cfgNum=?" );
$sth->execute($cfgNum);

@ -9,10 +9,10 @@ use Lemonldap::NG::Common::Conf::Constants;
our $VERSION = '1.9.0';
BEGIN {
*Lemonldap::NG::Common::Conf::normalize = \&normalize;
*Lemonldap::NG::Common::Conf::unnormalize = \&unnormalize;
*Lemonldap::NG::Common::Conf::serialize = \&serialize;
*Lemonldap::NG::Common::Conf::unserialize = \&unserialize;
*Lemonldap::NG::Common::Conf::normalize = \&normalize;
*Lemonldap::NG::Common::Conf::unnormalize = \&unnormalize;
*Lemonldap::NG::Common::Conf::serialize = \&serialize;
*Lemonldap::NG::Common::Conf::unserialize = \&unserialize;
*Lemonldap::NG::Common::Conf::oldUnserialize = \&oldUnserialize;
}
@ -91,7 +91,7 @@ sub unserialize {
my $conf;
# Parse fields
foreach my $k (keys %$fields) {
foreach my $k ( keys %$fields ) {
my $v = $fields->{$k};
if ( $k =~ $hashParameters ) {
unless ( utf8::is_utf8($v) ) {

@ -24,7 +24,8 @@ sub prereq {
'"dbiChain" is required in *DBI configuration type';
return 0;
}
$Lemonldap::NG::Common::Conf::msg .= 'Warning: "dbiUser" parameter is not set'
$Lemonldap::NG::Common::Conf::msg .=
'Warning: "dbiUser" parameter is not set'
unless ( $self->{dbiUser} );
$self->{dbiTable} ||= "lmConfig";
1;

@ -104,7 +104,8 @@ sub sendJSONresponse {
if ( ref $j ) {
$j = $_json->encode($j);
}
return [ $args{code}, [ 'Content-Type' => $type, @{$args{headers}} ], [$j] ];
return [ $args{code}, [ 'Content-Type' => $type, @{ $args{headers} } ],
[$j] ];
}
sub sendError {

@ -53,7 +53,7 @@ sub init {
split( /[,\s]+/, $self->{enabledModules} );
extends 'Lemonldap::NG::Handler::PSGI', @enabledModules;
my @working;
for ( my $i = 0; $i < @enabledModules ; $i++ ) {
for ( my $i = 0 ; $i < @enabledModules ; $i++ ) {
my $mod = $enabledModules[$i];
no strict 'refs';
if ( &{"${mod}::addRoutes"}($self) ) {

@ -124,7 +124,8 @@ sub run {
$self->scanTree( $mainTree, $jsonTree, '', '' );
$script = "\n\nfunction setScopeVars(scope) {\n";
foreach my $v (@angularScopeVars) {
$script .= " scope.$v->[0] = scope$v->[1];\n scope.getKey(scope.$v->[0]);\n";
$script .=
" scope.$v->[0] = scope$v->[1];\n scope.getKey(scope.$v->[0]);\n";
}
$script .= "}";
open F, ">>", $self->confTreeFile || die $!;
@ -347,9 +348,9 @@ sub buildZeroConf {
printf STDERR $format, $self->firstLmConfFile;
open( F, '>', $self->firstLmConfFile ) or die($!);
my $tmp = Lemonldap::NG::Manager::Conf::Zero::zeroConf(
'__DNSDOMAIN__', '__SESSIONDIR__',
'__PSESSIONDIR__', '__NOTIFICATIONDIR__'
);
'__DNSDOMAIN__', '__SESSIONDIR__',
'__PSESSIONDIR__', '__NOTIFICATIONDIR__'
);
$tmp->{cfgNum} = 1;
print F $jsonEnc->encode($tmp);
close F;

@ -299,7 +299,8 @@ sub _scanNodes {
# SAML
elsif ( $base =~ /^saml(?:S|ID)PMetaDataNodes$/ ) {
hdebug('SAML');
if ( defined $leaf->{data} and ref( $leaf->{data} ) eq 'ARRAY' ) {
if ( defined $leaf->{data} and ref( $leaf->{data} ) eq 'ARRAY' )
{
hdebug(" SAML data is an array, serializing");
$leaf->{data} = join ';', @{ $leaf->{data} };
}

@ -10,8 +10,7 @@ use Lemonldap::NG::Common::PSGI::Constants;
has '_confAcc' => ( is => 'rw', isa => 'Lemonldap::NG::Common::Conf' );
has 'configStorage' => ( is => 'rw', isa => 'HashRef', default => sub { {} } );
has 'currentConf' =>
( is => 'rw', required => 1, default => sub { {} } );
has 'currentConf' => ( is => 'rw', required => 1, default => sub { {} } );
has 'protection' => ( is => 'rw', isa => 'Str', default => 'manager' );
our $VERSION = '1.9.0';

@ -10,9 +10,11 @@ my $str = "The LemonLDAP::NG team \x{c2}\x{a9}";
require 't/test-lib.pm';
my $href = &client->jsonResponse('/confs/1/cfgAuthor');
#binmode STDERR;
ok( $href->{value} eq $str, 'Value is well encoded' ) or print STDERR "Expect '$href->{value}' eq '$str'";
ok( $href->{value} eq $str, 'Value is well encoded' )
or print STDERR "Expect '$href->{value}' eq '$str'";
count(1);
done_testing( count() );

@ -31,7 +31,8 @@ while ( my $body = &body() ) {
&client->_post( '/confs/', 'cfgNum=1', $body, 'application/json' ),
"$desc: positive result"
);
ok( $res->[0] == 200, "$desc: result code is 200" ) or print STDERR Dumper($res);
ok( $res->[0] == 200, "$desc: result code is 200" )
or print STDERR Dumper($res);
ok(
$resBody = from_json( $res->[2]->[0] ),
"$desc: result body contains JSON text"

@ -35,7 +35,9 @@ foreach my $attr ( keys %$attrs ) {
);
$count++;
}
if ( $attr =~ qr/^$simpleHashKeys$/o or $attrs->{$attr}->{type} =~ /Container$/ ) {
if ( $attr =~ qr/^$simpleHashKeys$/o
or $attrs->{$attr}->{type} =~ /Container$/ )
{
if ( $attrs->{$attr}->{default} ) {
ok(
ref( $attrs->{$attr}->{default} ) eq 'HASH',

@ -64,8 +64,7 @@ if ( $cgi->param("test") eq "request" ) {
iss => $client_id,
aud => [$portal_url]
};
my $request_payload =
encode_base64( to_json($request_paylod_hash), "" );
my $request_payload = encode_base64( to_json($request_paylod_hash), "" );
my $request_header_hash = { typ => "JWT", alg => "HS256" };
my $request_header = encode_base64( to_json($request_header_hash), "" );
@ -663,8 +662,7 @@ else {
iss => $client_id,
aud => [$portal_url]
};
my $request_payload =
encode_base64( to_json($request_paylod_hash), "" );
my $request_payload = encode_base64( to_json($request_paylod_hash), "" );
my $request_header_hash = { typ => "JWT", alg => "HS256" };
my $request_header = encode_base64( to_json($request_header_hash), "" );

Loading…
Cancel
Save