From d81bf10070550fd2600a3167410b319871c37ba5 Mon Sep 17 00:00:00 2001 From: Yarmo Mackenbach Date: Sat, 24 Oct 2020 17:30:22 +0200 Subject: [PATCH] Add proof.format field to service provider data structure --- README.md | 1 + src/serviceproviders/dns.js | 3 ++- src/serviceproviders/hackernews.js | 3 ++- src/serviceproviders/twitter.js | 3 ++- src/serviceproviders/xmpp.js | 3 ++- 5 files changed, 9 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c331608..3ded25b 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,7 @@ The object returned by a service provider consists of: - uri (string: the URI containing the proof to be by humans and machines) - fetch (string: see below) - useProxy (boolean: should the request be sent using a proxy) + - format (string: [json, text]) - claim (object) - fingerprint (string: the fingerprint that verifies the claim if found in the proof) - format (string: see below [uri, message, fingerprint]) diff --git a/src/serviceproviders/dns.js b/src/serviceproviders/dns.js index d90895e..c622893 100644 --- a/src/serviceproviders/dns.js +++ b/src/serviceproviders/dns.js @@ -31,7 +31,8 @@ const processURI = (uri, opts) => { proof: { uri: `https://dns.shivering-isles.com/dns-query?name=${match[1]}&type=TXT`, fetch: null, - useProxy: false + useProxy: false, + format: 'json' }, claim: { fingerprint: null, diff --git a/src/serviceproviders/hackernews.js b/src/serviceproviders/hackernews.js index e0d32b4..63c493e 100644 --- a/src/serviceproviders/hackernews.js +++ b/src/serviceproviders/hackernews.js @@ -31,7 +31,8 @@ const processURI = (uri, opts) => { proof: { uri: `https://hacker-news.firebaseio.com/v0/user/${match[1]}.json`, fetch: null, - useProxy: true + useProxy: true, + format: 'json' }, claim: { fingerprint: null, diff --git a/src/serviceproviders/twitter.js b/src/serviceproviders/twitter.js index 1116f14..670b65c 100644 --- a/src/serviceproviders/twitter.js +++ b/src/serviceproviders/twitter.js @@ -31,7 +31,8 @@ const processURI = (uri, opts) => { proof: { uri: uri, fetch: `https://mobile.twitter.com/${match[1]}/status/${match[2]}`, - useProxy: false + useProxy: false, + format: 'text' }, claim: { fingerprint: null, diff --git a/src/serviceproviders/xmpp.js b/src/serviceproviders/xmpp.js index 5cc28ba..3d7b215 100644 --- a/src/serviceproviders/xmpp.js +++ b/src/serviceproviders/xmpp.js @@ -33,7 +33,8 @@ const processURI = (uri, opts) => { ? `https://${opts.XMPP_VCARD_SERVER_DOMAIN}/api/vcard/${output.display}/DESC` : null, fetch: null, - useProxy: false + useProxy: false, + format: 'json' }, claim: { fingerprint: null,