there doesn't seem to be anything here
diff --git a/go/pvl/kit_test.go b/go/pvl/kit_test.go index 2d082857b249..54211636e6da 100644 --- a/go/pvl/kit_test.go +++ b/go/pvl/kit_test.go @@ -99,10 +99,10 @@ func TestKitRedditMax(t *testing.T) { testRemoteUsername: "maxtaco", // remote (service) username armoredSig: string(armoredSig), - testResponseFile: "testdata/reddit-max.xml", + testResponseFile: "testdata/reddit-max.html", testAPIURL: "https://www.reddit.com/r/KeybaseProofs/comments/2clf9c/my_keybase_proof_redditmaxtaco_keybasemax/.json", - urloverride: "https://old.reddit.com/r/KeybaseProofs/comments/2clf9c/my_keybase_proof_redditmaxtaco_keybasemax/.rss", + urloverride: "https://old.reddit.com/r/KeybaseProofs/comments/2clf9c/my_keybase_proof_redditmaxtaco_keybasemax/", shouldwork: true, } @@ -110,7 +110,7 @@ func TestKitRedditMax(t *testing.T) { // Try a response for a different proof, should not work utBad := ut - utBad.testResponseFile = "testdata/reddit-terribletext5299.xml" + utBad.testResponseFile = "testdata/reddit-terribletext5299.html" utBad.shouldwork = false utBad.errstatus = keybase1.ProofStatus_BAD_USERNAME runKitUnitTest(t, &utBad) @@ -126,10 +126,10 @@ func TestKitRedditTerribleText5299(t *testing.T) { testRemoteUsername: "terrible-text5299", // remote (service) username armoredSig: armoredSig, - testResponseFile: "testdata/reddit-terribletext5299.xml", + testResponseFile: "testdata/reddit-terribletext5299.html", testAPIURL: "https://www.reddit.com/r/KeybaseProofs/comments/1pqpxtp/my_keybase_proof_redditterribletext5299/.json", - urloverride: "https://old.reddit.com/r/KeybaseProofs/comments/1pqpxtp/my_keybase_proof_redditterribletext5299/.rss", + urloverride: "https://old.reddit.com/r/KeybaseProofs/comments/1pqpxtp/my_keybase_proof_redditterribletext5299/", shouldwork: true, } diff --git a/go/pvl/testdata/reddit-max.html b/go/pvl/testdata/reddit-max.html new file mode 100644 index 000000000000..0ae6b1355103 --- /dev/null +++ b/go/pvl/testdata/reddit-max.html @@ -0,0 +1,88 @@ +
there doesn't seem to be anything here
blocks. There may be more than one
- # code block in the post, though (see max's proof), extract and concatenate
- # them all into one register.
+ , error: ["TITLE_NOT_FOUND", "Missing signature ID (%{sig_id_medium}) in post title '%{title}'"] } },
+ # Grab the rendered post body. The signature lives in / blocks
+ # whose newlines are preserved in the HTML, so pulling the whole usertext-body
+ # text into one register is enough to recover a multi-line PGP signature
+ # (see max's proof) as well as single-line NaCl ones.
{ selector_css: {
- , selectors: ["code", { contents: true }]
- , into: "code_raw"
- , multi: true
- , error: ["CONTENT_MISSING", "Could not find content in XML"] } },
- # The content in .rss endpoint is stripped out of newlines. We are going to
- # normalize whitespace and replace all spaces with newlines to recover the
- # matching multiline PGP signature so it matches the `sig` register. This has
- # no effect on NaCl signatures.
- { whitespace_normalize: {
- , from: "code_raw"
- , into: "code_nw" } },
- { replace_all: {
- , old: " "
- , new: "\n"
- , from: "code_nw"
- , into: "code" } },
- # Finally, find the signature in the normalized text.
+ , selectors: ["div.thing.link.self", "div.usertext-body"]
+ , into: "post_body"
+ , error: ["CONTENT_MISSING", "Could not find entry element"] } },
+ # Finally, find the signature in the post body.
{ assert_find_base64: {
, needle: "sig"
- , haystack: "code"
+ , haystack: "post_body"
, error: ["TEXT_NOT_FOUND", "Signature not found in body"] } },
]]
rooter: [[
Want to add to the discussion?
Post a comment!