package Lemonldap::NG::Common::Conf::Backends::CDBI;
use strict;
use utf8;
use JSON;
use Lemonldap::NG::Common::Conf::Backends::_DBI;
our $VERSION = '2.22.0';
our @ISA = qw(Lemonldap::NG::Common
my $cfgNum = $fields->{cfgNum};
my $req;
my $lastCfg = $self->lastCfg;
$fields = to_json($fields);
my $query =
$lastCfg == $cfgNum
? "UPDATE $self->{dbiTable} SET data=?
;
return 0;
}
my $r;
if ( $row->[0] =~ /^\s*\{/s ) {
eval { $r = from_json( $row->[0], { allow_nonref => 1 } ); };
}
else { # Old format
require Storable
package Lemonldap::NG::Common::PSGI::Request;
use strict;
use Mouse;
use JSON;
use Plack::Request;
use URI::Escape;
our $VERSION = '2.19.0';
our @ISA = ('Plack::Request');
# http :/
->{$k} = $v;
}
sub wantJSON {
return 1
if ( defined $_[0]->accept
and $_[0]->accept =~ m#(?:application|text)/json# );
return 0;
}
# JSON parser
sub jsonBodyToObj {
my $sel
f = shift;
return $self->{json_body} if ( $self->{json_body} );
unless ( $self->content_type =~ /application\/json/ ) {
$self->error('Data is not JSON');
return undef;
}
package Lemonldap::NG::Common::Conf::Wrapper;
use strict;
use JSON;
our $VERSION = '2.0.3';
sub TIEHASH {
my ( $class, $conf, $overrides ) = @_;
my %h = %$overrides;
foreach ( keys %h )
{
if ( $h{$_} =~ /^[\[\{]/ ) {
my $tmp = eval { JSON::from_json( $h{$_} ) };
if ($@) {
print STDERR "Wrapper: unable to compile $_ key, skipping\n";
::Common::Cli;
use strict;
use JSON;
use Mouse;
use Lemonldap::NG::Common::Conf;
use Lemonldap::NG::Common::EmailTransport;
use constant booleanOptions => qr/^(?:json)$/;
our $VERSION = '2.22.0';
$res);
return $res;
},
);
has cfgNum => (
is => 'rw',
isa => 'Int',
);
has json => ( is => 'rw' );
sub info {
my ($self) = @_;
my $conf =
$self->confAccess->getCo
->{cfgDate} ||= 0;
$conf->{cfgLog} ||= "No log provided";
if ( $self->json ) {
print JSON->new->pretty->allow_nonref->encode( {
num => $conf->{cfgNum},
Header getJWTPayload getJWTSignature getJWTSignedData)
; # symbols to export on request
use JSON;
use MIME::Base64 qw/encode_base64 decode_base64/;
our $VERSION = '2.21.0';
# Gets the Access T
json whether or not to decode as JSON
# @return JSON string
sub getJWTPart {
my ( $jwt, $part ) = @_;
my @jwt_parts = split( /\./, $jwt );
return undef unless @jwt_parts > 1;
my $json
_hash;
eval { $json_hash = from_json( decode_base64url( $jwt_parts[$part] ) ); };
return undef if ($@);
return $json_hash;
}
# Return the JWT data that has to be signed by the OP
# @param
se Mouse;
use HTTP::Status;
use JSON;
use Lemonldap::NG::Common::PSGI::Constants;
use Lemonldap::NG::Common::PSGI::Request;
our $VERSION = '2.22.0';
our $_json = JSON->new->allow_nonref;
# PROPERTI
ses methods
sub sendJSONresponse {
my ( $self, $req, $j, %args ) = @_;
$args{code} ||= 200;
$args{headers} ||= [ $req->spliceHdrs ];
my $type = 'application/json; charset=utf-8';
args{pretty} ) {
# This avoids changing the settings of the $_json reference
$j = to_json(
$j,
{
allow_
package Lemonldap::NG::Common::Conf::RESTServer;
use strict;
use JSON 'from_json';
use Mouse;
use Lemonldap::NG::Common::Conf::Constants;
use Lemonldap::NG::Common::Conf::ReConstants;
our $VERSION =
ontent (for SAML/OIDC metadata)
# 31 - Complex subnodes
# ----------------
## @method PSGI-JSON-response complexNodesRoot($req, $query, $tpl)
# Respond to root requests for virtual hosts and SA
m $query Configuration root key
#@param $tpl Javascript template to use (see JS/JSON generator script)
#@return PSGI JSON response
sub complexNodesRoot {
my ( $self, $req, $query, $tpl ) = @_;
package Lemonldap::NG::Common::Conf::Serializer;
use strict;
use utf8;
use Encode;
use JSON;
use Lemonldap::NG::Common::Conf::Constants;
our $VERSION = '2.0.12';
BEGIN {
*Lemonldap::NG::Common:
y $v = $conf->{$k};
# 1.Hash ref
if ( ref($v) ) {
$fields->{$k} = to_json($v);
}
else {
$fields->{$k} = $v;
}
}
return $fields
}
$conf->{$k} = (
$v =~ /./
? eval { from_json( $v, { allow_nonref => 1 } ) }
: {}
);
if ($@) {
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;
=> $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;
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;
= {update => $args->{update}};
# 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;
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;
= {result => $args->{result}};
# 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;
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;
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;