package Lemonldap::NG::Common::PSGI::Cli::Lib;
use strict;
use JSON;
use Mouse;
use Lemonldap::NG::Common::PSGI;
our $VERSION = '2.0.10';
has iniFile => ( is => 'ro', isa => 'Str' );
has app => (
$query //= '';
return $self->app->( {
'HTTP_ACCEPT' => 'application/json, text/plain, */*',
'SCRIPT_NAME' => '',
'HTTP_ACCEPT_ENCODING' =
ody->can('read') );
return $self->app->( {
'HTTP_ACCEPT' => 'application/json, text/plain, */*',
'SCRIPT_NAME' => '',
'HTTP_ACCEPT_ENCODING' =
ame => $args->{resourceName}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
=> $args->{results}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
eMask => $args->{updateMask}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
Link => $args->{productLink}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
:Common::Safelib;
use strict;
use Encode;
use MIME::Base64;
use Lemonldap::NG::Common::IPv6;
use JSON::XS;
use Net::CIDR;
use Digest::SHA;
use Date::Parse;
our $VERSION = '2.20.0';
# Set here all t
uri$attribute/;
}
my $json = JSON::XS->new;
sub has2f_internal {
my ( $session, $type ) = @_;
return 0 unless $session->{_2fDevices};
my $_2fDevices = eval { $json->decode( $session->{_
y => $args->{validateOnly}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
nly => $args->{validateOnly}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
package Lemonldap::NG::Common::CliSessions;
use strict;
use Mouse;
use JSON;
use Lemonldap::NG::Common::Conf;
use Lemonldap::NG::Common::Logger::Std;
use Lemonldap::NG::Common::Apache::Session;
use L
ile} );
return { %$res, %$localConf };
},
);
sub _to_json {
my $self = shift;
my $obj = shift;
return to_json( $obj, { pretty => 1, canonical => 1 } );
}
sub _search {
m
_}->{_session_id} . "\n" } keys %{$res};
}
else {
print $o $self->_to_json( [ values %{$res} ] );
}
}
return 0;
}
sub backup {
my $self = shift;
m
remove => $args->{remove}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
=> $args->{results}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
ame => $args->{resourceName}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
ame => $args->{resourceName}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
package Lemonldap::NG::Common::Session;
use strict;
use Exporter 'import';
use Digest::SHA;
use JSON;
use Lemonldap::NG::Common::Apache::Session;
use Lemonldap::NG::Common::Apache::Session::Generate
package Lemonldap::NG::Common::Notifications;
use strict;
use Mouse;
use JSON qw(to_json);
our $VERSION = '2.21.0';
extends 'Lemonldap::NG::Common::Module';
sub import {
if ( $_[1] eq 'XML' )
s 'Lemonldap::NG::Common::Notifications::JSON',
'Lemonldap::NG::Common::Module';
}
}
has extension => (
is => 'rw',
default => 'json'
);
has notifField => (
is =>
l = ( $1 eq 'Pending' ? $self->getAll() : $self->getExisting() );
$all = { map { $_ => to_json( $all->{$_} ) } keys %$all };
return ( $forAll ? { %$all, %$forAll } : $all );
}
ame => $args->{resourceName}};
# Delete the unassigned fields in this object for a more concise JSON payload
remove_unassigned_fields($self, $args);
bless $self, $class;
return $self;
}
1;
:UserAgent;
use JSON qw(from_json to_json);
our $VERSION = '2.18.0';
#parameter baseUrl, user, password, realm, lwpOpts
BEGIN {
*Lemonldap::NG::Common::Conf::getJson = \&getJson;
*Lemonldap
sub getJson {
my $self = shift;
my $url = shift;
my $resp = $self->ua->get( $self->base . $url, @_ );
if ( $resp->is_success ) {
my $res;
eval { $res = from_json( $res
ented for now';
return undef;
}
sub lastCfg {
my $self = shift;
my $res = $self->getJson('latest') or return;
return $res->{cfgNum};
}
# lock and unlock must not be requested by the
he::Session;
use base qw(Apache::Session);
use Lemonldap::NG::Common::Apache::Session::Serialize::JSON;
use Lemonldap::NG::Common::Apache::Session::Store;
use Lemonldap::NG::Common::Apache::Session::L
p::NG::Common::Apache::Session::Serialize::JSON::serialize;
$self->{unserialize} =
\&Lemonldap::NG::Common::Apache::Session::Serialize::JSON::unserialize;
if ( $backend =~ /^
$self->{unserialize} =
\&Lemonldap::NG::Common::Apache::Session::Serialize::JSON::unserializeBase64;
}
}
if ( $self->{args}->{generateModule} ) {
my $gene
::Conf::Backends::File;
use strict;
use Lemonldap::NG::Common::Conf::Constants; #inherits
use JSON;
use Encode;
our $VERSION = '2.20.2';
our $initDone;
sub Lemonldap::NG::Common::Conf::_lock {
Common::Conf::_file {
my ( $self, $cfgNum ) = @_;
return "$self->{dirName}/lmConf-$cfgNum.json";
}
sub prereq {
my $self = shift;
unless ( $self->{dirName} ) {
$Lemonldap::NG:
ed: $! \n";
$self->unlock;
return UNKNOWN_ERROR;
}
binmode(FILE);
my $json_options = {
allow_nonref => 1,
(
$self->{prettyPrint}
? (
mmon::Conf::Constants;
use Lemonldap::NG::Common::Util qw/display2F getPSessionID/;
use JSON qw(from_json to_json);
our $VERSION = '2.21.0';
has sessionTypes => ( is => 'rw' );
# Boolean value to t
return $session->error
? $self->sendError( $req, $session->error, 200 )
: $self->sendJSONresponse( $req, { result => 1 } );
}
sub deleteOIDCConsent {
my ( $self, $req ) = @_;
my
ts;
if ( $session->data->{_oidcConsents} ) {
$_oidcConsents = eval {
from_json( $session->data->{_oidcConsents}, { allow_nonref => 1 } );
};
if ($@) {