Commit 0415370f authored by Xavier Guimard's avatar Xavier Guimard

More REST debug

parent 47dc4936
Pipeline #6219 passed with stage
in 13 minutes and 15 seconds
...@@ -38,6 +38,14 @@ sub authenticate { ...@@ -38,6 +38,14 @@ sub authenticate {
$self->setSecurity($req); $self->setSecurity($req);
return PE_ERROR; return PE_ERROR;
} }
$self->logger->debug( "REST result:" . ( $res->{result} || 'undef' ) );
if ( $res->{info} ) {
eval {
$self->logger->debug(" $_ => $res->{info}->{$_}")
foreach ( keys %{ $res->{info} } );
};
}
$self->logger->error( 'No "info": ' . $@ ) if ($@);
unless ( $res->{result} ) { unless ( $res->{result} ) {
$self->userLogger->warn( $self->userLogger->warn(
"Bad credentials for " . $req->user . ' (' . $req->address . ')' ); "Bad credentials for " . $req->user . ' (' . $req->address . ')' );
......
...@@ -17,6 +17,13 @@ has ua => ( ...@@ -17,6 +17,13 @@ has ua => (
sub restCall { sub restCall {
my ( $self, $url, $content ) = @_; my ( $self, $url, $content ) = @_;
$self->logger->debug("REST: trying to call $url with:");
eval {
foreach ( keys %$content ) {
$self->logger->debug(
" $_: " . ( /password/ ? '****' : $content->{$_} ) );
}
};
my $hreq = HTTP::Request->new( POST => $url ); my $hreq = HTTP::Request->new( POST => $url );
$hreq->header( 'Content-Type' => 'application/json' ); $hreq->header( 'Content-Type' => 'application/json' );
$hreq->content( to_json($content) ); $hreq->content( to_json($content) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment