Lemonldap-NG-Manager
view release on metacpan - search on metacpan
view release on metacpan or search on metacpan
lib/Lemonldap/NG/Manager/Api/Menu/App.pm view on Meta::CPAN
return $self->sendError( $req, $res->{msg}, 400 )
unless ( $res->{res} eq 'ok' );
return $self->sendJSONresponse(
$req,
{ message => "Successful operation" },
code => 201
);
}
sub updateMenuApp {
my ( $self, $req ) = @_;
my $catConfKey = $req->params('confKey')
or return $self->sendError( $req, 'Category confKey is missing', 400 );
my $appConfKey = $req->params('appConfKey')
or return $self->sendError( $req, 'Application confKey is missing', 400 );
my $update = $req->jsonBodyToObj;
lib/Lemonldap/NG/Manager/Api/Menu/Cat.pm view on Meta::CPAN
return $self->sendError( $req, $res->{msg}, 400 )
unless ( $res->{res} eq 'ok' );
return $self->sendJSONresponse(
$req,
{ message => "Successful operation" },
code => 201
);
}
sub updateMenuCat {
my ( $self, $req ) = @_;
my $confKey = $req->params('confKey')
or return $self->sendError( $req, 'confKey is missing', 400 );
my $update = $req->jsonBodyToObj;
return $self->sendError( $req, "Invalid input: " . $req->error, 400 )
unless ($update);
$self->logger->debug(
lib/Lemonldap/NG/Manager/Api/Providers/CasApp.pm view on Meta::CPAN
return $self->sendError( $req, $res->{msg}, 400 )
unless ( $res->{res} eq 'ok' );
return $self->sendJSONresponse(
$req,
{ message => "Successful operation" },
code => 201
);
}
sub updateCasApp {
my ( $self, $req ) = @_;
my $confKey = $req->params('confKey')
or return $self->sendError( $req, 'confKey is missing', 400 );
my $update = $req->jsonBodyToObj;
return $self->sendError( $req, "Invalid input: " . $req->error, 400 )
unless ($update);
$self->logger->debug(
lib/Lemonldap/NG/Manager/Api/Providers/OidcRp.pm view on Meta::CPAN
return $self->sendError( $req, $res->{msg}, 400 )
unless ( $res->{res} eq 'ok' );
return $self->sendJSONresponse(
$req,
{ message => "Successful operation" },
code => 201
);
}
sub updateOidcRp {
my ( $self, $req ) = @_;
my $confKey = $req->params('confKey')
or return $self->sendError( $req, 'confKey is missing', 400 );
my $update = $req->jsonBodyToObj;
return $self->sendError( $req, "Invalid input: " . $req->error, 400 )
unless ($update);
if ( $update->{redirectUris} ) {
lib/Lemonldap/NG/Manager/Api/Providers/SamlSp.pm view on Meta::CPAN
unless ( $res->{res} eq 'ok' );
$res = $self->_pushSamlSp( $conf, $confKey, $replace, 1 );
return $self->sendError( $req, $res->{msg}, 400 )
unless ( $res->{res} eq 'ok' );
return $self->sendJSONresponse( $req, undef, code => 204 );
}
sub updateSamlSp {
my ( $self, $req ) = @_;
my $res;
my $confKey = $req->params('confKey')
or return $self->sendError( $req, 'confKey is missing', 400 );
my $update = $req->jsonBodyToObj;
return $self->sendError( $req, "Invalid input: " . $req->error, 400 )
unless ($update);
lib/Lemonldap/NG/Manager/Notifications.pm view on Meta::CPAN
unless ( eval { $self->notifAccess->newNotification($newNotif) } ) {
$self->logger->error("Notification not created: $@");
return $self->sendError( $req, "Notification not created: $@", 200 );
}
else {
return $self->sendJSONresponse( $req, { result => 1 } );
}
}
sub updateNotification {
my ( $self, $req ) = @_;
my $json = $req->jsonBodyToObj;
unless ( defined($json) ) {
return $self->sendError( $req, undef, 200 );
}
# For now, only "mark as done" is proposed
unless ( $json->{done} ) {
return $self->sendError( $req, 'Only "done=1" is accepted for now',
t/04-menu-api.t view on Meta::CPAN
check200( $test, $res );
my $hits = from_json( $res->[2]->[0] );
my $counter = @{$hits};
ok(
$counter eq $expectedHits,
"$test: check if nb of hits returned ($counter) matches expectation ($expectedHits)"
);
count(1);
}
sub update {
my ( $test, $type, $confKey, $obj ) = splice @_;
my $j = $_json->encode($obj);
#diag Dumper($j);
my $res;
ok(
$res = &client->_patch(
"/api/v1/menu/$type/$confKey", '',
IO::String->new($j), 'application/json',
length($j)
t/04-providers-api.t view on Meta::CPAN
"$test: check if $attrPath value \"$key\" matches expected value \"$expectedValue\""
);
count(1);
}
sub checkGetNotFound {
my ( $test, $type, $confKey ) = splice @_;
check404( $test, get( $test, $type, $confKey ) );
}
sub update {
my ( $test, $type, $confKey, $obj ) = splice @_;
my $j = $_json->encode($obj);
#diag Dumper($j);
my $res;
ok(
$res = &client->_patch(
"/api/v1/providers/$type/$confKey", '',
IO::String->new($j), 'application/json',
length($j)
view all matches for this distributionview release on metacpan - search on metacpan
( run in 1.457 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )