[Pkg-privacy-commits] [msva-perl] 20/356: add a bit more debugging to the agent, response messages too.

Ximin Luo infinity0 at moszumanska.debian.org
Mon Aug 24 07:41:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository msva-perl.

commit 1a36d59ec2955809bac31fd5f6a959bdbc3b1b46
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Sat Jan 9 16:59:41 2010 -0500

    add a bit more debugging to the agent, response messages too.
---
 msva | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/msva b/msva
index 0c28569..785c061 100755
--- a/msva
+++ b/msva
@@ -30,7 +30,9 @@ use strict;
       printf STDERR ("Got POST %s\n", $path);
 
       my ($status, $object) = $handler->($cgi);
-      printf("HTTP/1.0 %s\r\nContent-Type: application/json\r\n\r\n%s", $status, to_json ($object));
+      my $ret = to_json($object);
+      printf STDERR ("returning: %s\n", $ret);
+      printf("HTTP/1.0 %s\r\nContent-Type: application/json\r\n\r\n%s", $status, $ret);
 
     } else {
       printf("HTTP/1.0 404 Not Found -- not handled by Monkeysphere validation agent\r\nContent-Type: text/plain\r\n\r\nHTTP/1.0 404 Not Found -- the path:\r\n   %s\r\nis not handled by the MonkeySphere validation agent.\r\nPlease try one of the following paths instead:\r\n\r\n%s\r\n", $path, ' * '.join("\r\n * ", keys %dispatch) );
@@ -41,15 +43,16 @@ use strict;
     my $cgi  = shift;   # CGI.pm object
     return if !ref $cgi;
 
-    # FIXME: these should be opening up a json blob instead of using CGI params.
+    # open a json blob instead of using CGI params.
     my $data = from_json($cgi->param('POSTDATA'));
 
     use Data::Dumper;
     print STDERR Dumper($data);
 
-    my $ret = { valid => 'true' };
-    # my $status = '404 no match found for the public key in this certificate';
-    # or:
+    my $uid = $data->{context}.'://'.$data->{uid};
+
+    my $ret = { valid => JSON::true,
+                message => sprintf('tried to validate "%s" through the OpenPGP Web of Trust', $uid) };
     my $status = '200 match found, authentication details to follow';
 
     return $status, $ret;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/msva-perl.git



More information about the Pkg-privacy-commits mailing list