keybase-proofs 2.3.28 → 2.3.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## 2.3.30 (2025-02-28)
2
+
3
+ - Fix BaseScraper not properly handling promise rejections when fetching text
4
+ body.
5
+
6
+ ## 2.3.29 (2024-07-22)
7
+
8
+ - Fix Twitter scraper to handle empty result list case.
9
+
1
10
  ## 2.3.28 (2024-07-19)
2
11
 
3
12
  - Use version 2 API for X (formerly known as Twitter) hunting.
package/README.md CHANGED
@@ -2,3 +2,5 @@ proofs
2
2
  ======
3
3
 
4
4
  Public Keybase Proof System
5
+
6
+ Post issues to: https://github.com/keybase/keybase-issues
@@ -96,7 +96,7 @@
96
96
  (function(__iced_k) {
97
97
  __iced_deferrals = new iced.Deferrals(__iced_k, {
98
98
  parent: ___iced_passed_deferral,
99
- filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/server_test_progs/proofs/src/scrapers/base.iced",
99
+ filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/proofs/src/scrapers/base.iced",
100
100
  funcname: "BaseScraper.validate"
101
101
  });
102
102
  _this.check_status(args, __iced_deferrals.defer({
@@ -171,7 +171,7 @@
171
171
  return (function(__iced_k) {
172
172
  __iced_deferrals = new iced.Deferrals(__iced_k, {
173
173
  parent: ___iced_passed_deferral,
174
- filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/server_test_progs/proofs/src/scrapers/base.iced",
174
+ filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/proofs/src/scrapers/base.iced",
175
175
  funcname: "BaseScraper._get_url_body"
176
176
  });
177
177
  _this.libs.fetch(opts.url, opts, __iced_deferrals.defer({
@@ -213,7 +213,7 @@
213
213
  (function(__iced_k) {
214
214
  __iced_deferrals = new iced.Deferrals(__iced_k, {
215
215
  parent: ___iced_passed_deferral,
216
- filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/server_test_progs/proofs/src/scrapers/base.iced",
216
+ filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/proofs/src/scrapers/base.iced",
217
217
  funcname: "BaseScraper._get_url_body"
218
218
  });
219
219
  f.call(response, __iced_deferrals.defer({
@@ -234,9 +234,30 @@
234
234
  return __iced_k(cb(err, rc, body));
235
235
  });
236
236
  } else {
237
- return __iced_k(response.text().then(function(body) {
238
- return cb(err, rc, body);
239
- }));
237
+ f = callbackify(response.text);
238
+ (function(__iced_k) {
239
+ __iced_deferrals = new iced.Deferrals(__iced_k, {
240
+ parent: ___iced_passed_deferral,
241
+ filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/proofs/src/scrapers/base.iced",
242
+ funcname: "BaseScraper._get_url_body"
243
+ });
244
+ f.call(response, __iced_deferrals.defer({
245
+ assign_fn: (function() {
246
+ return function() {
247
+ err = arguments[0];
248
+ return body = arguments[1];
249
+ };
250
+ })(),
251
+ lineno: 129
252
+ }));
253
+ __iced_deferrals._fulfill();
254
+ })(function() {
255
+ if (err) {
256
+ _this.log("| _get_url_body response.text() failed with: " + (err.toString()));
257
+ rc = v_codes.CONTENT_FAILURE;
258
+ }
259
+ return __iced_k(cb(err, rc, body));
260
+ });
240
261
  }
241
262
  } catch (_error) {
242
263
  err = _error;
@@ -279,11 +300,11 @@
279
300
  return (function(__iced_k) {
280
301
  __iced_deferrals = new iced.Deferrals(__iced_k, {
281
302
  parent: ___iced_passed_deferral,
282
- filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/server_test_progs/proofs/src/scrapers/base.iced",
303
+ filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/proofs/src/scrapers/base.iced",
283
304
  funcname: "BaseBearerToken.get"
284
305
  });
285
306
  _this._lock.acquire(__iced_deferrals.defer({
286
- lineno: 160
307
+ lineno: 164
287
308
  }));
288
309
  __iced_deferrals._fulfill();
289
310
  });
@@ -315,7 +336,7 @@
315
336
  (function(__iced_k) {
316
337
  __iced_deferrals = new iced.Deferrals(__iced_k, {
317
338
  parent: ___iced_passed_deferral,
318
- filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/server_test_progs/proofs/src/scrapers/base.iced",
339
+ filename: "/Users/michal/SourceCode/keybase/go/src/github.com/keybase/proofs/src/scrapers/base.iced",
319
340
  funcname: "BaseBearerToken.get"
320
341
  });
321
342
  _this.base._get_url_body(opts, __iced_deferrals.defer({
@@ -326,7 +347,7 @@
326
347
  return body = arguments[2];
327
348
  };
328
349
  })(),
329
- lineno: 185
350
+ lineno: 189
330
351
  }));
331
352
  __iced_deferrals._fulfill();
332
353
  })(function() {
@@ -133,19 +133,23 @@
133
133
  });
134
134
  })(this)((function(_this) {
135
135
  return function() {
136
- var _i, _len, _ref1, _ref2;
136
+ var _i, _len, _ref1, _ref2, _ref3;
137
137
  _this.log("| search index " + u + " -> " + rc);
138
138
  if (rc !== v_codes.OK) {
139
139
 
140
140
  } else if ((typeof json === "undefined" || json === null) || (json.length === 0)) {
141
141
  rc = v_codes.EMPTY_JSON;
142
142
  } else if (json.data == null) {
143
- rc = v_codes.INVALID_JSON;
143
+ if (((_ref1 = json.meta) != null ? _ref1.result_count : void 0) === 0) {
144
+ rc = v_codes.NOT_FOUND;
145
+ } else {
146
+ rc = v_codes.INVALID_JSON;
147
+ }
144
148
  } else {
145
149
  rc = v_codes.NOT_FOUND;
146
- _ref1 = json.data;
147
- for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
148
- _ref2 = _ref1[i], text = _ref2.text, id = _ref2.id;
150
+ _ref2 = json.data;
151
+ for (i = _i = 0, _len = _ref2.length; _i < _len; i = ++_i) {
152
+ _ref3 = _ref2[i], text = _ref3.text, id = _ref3.id;
149
153
  if ((_this.find_sig_in_tweet({
150
154
  inside: text,
151
155
  proof_text_check: proof_text_check
@@ -231,7 +235,7 @@
231
235
  return json = arguments[2];
232
236
  };
233
237
  })(),
234
- lineno: 123
238
+ lineno: 129
235
239
  }));
236
240
  __iced_deferrals._fulfill();
237
241
  })(function() {
@@ -265,7 +269,7 @@
265
269
  funcname: "TwitterScraper.users_lookup"
266
270
  });
267
271
  setTimeout(__iced_deferrals.defer({
268
- lineno: 137
272
+ lineno: 143
269
273
  }), cursor_wait);
270
274
  __iced_deferrals._fulfill();
271
275
  })(__iced_k);
@@ -360,7 +364,7 @@
360
364
  return json = arguments[2];
361
365
  };
362
366
  })(),
363
- lineno: 175
367
+ lineno: 181
364
368
  }));
365
369
  __iced_deferrals._fulfill();
366
370
  })(function() {
@@ -397,7 +401,7 @@
397
401
  funcname: "TwitterScraper.get_follower_ids"
398
402
  });
399
403
  setTimeout(__iced_deferrals.defer({
400
- lineno: 191
404
+ lineno: 197
401
405
  }), cursor_wait);
402
406
  __iced_deferrals._fulfill();
403
407
  })(__iced_k);
@@ -513,7 +517,7 @@
513
517
  return body_obj = arguments[2];
514
518
  };
515
519
  })(),
516
- lineno: 282
520
+ lineno: 288
517
521
  }));
518
522
  __iced_deferrals._fulfill();
519
523
  });
@@ -596,7 +600,7 @@
596
600
  return tok = arguments[1];
597
601
  };
598
602
  })(),
599
- lineno: 343
603
+ lineno: 349
600
604
  }));
601
605
  __iced_deferrals._fulfill();
602
606
  });
@@ -629,7 +633,7 @@
629
633
  return tok = arguments[2];
630
634
  };
631
635
  })(),
632
- lineno: 352
636
+ lineno: 358
633
637
  }));
634
638
  __iced_deferrals._fulfill();
635
639
  });
@@ -662,7 +666,7 @@
662
666
  return body = arguments[2];
663
667
  };
664
668
  })(),
665
- lineno: 363
669
+ lineno: 369
666
670
  }));
667
671
  __iced_deferrals._fulfill();
668
672
  })(__iced_k);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "keybase-proofs",
3
- "version": "2.3.28",
3
+ "version": "2.3.30",
4
4
  "description": "Publicly-verifiable proofs of identity",
5
5
  "main": "lib/main.js",
6
6
  "scripts": {
@@ -126,8 +126,12 @@ class BaseScraper
126
126
  rc = v_codes.CONTENT_FAILURE
127
127
  cb err, rc, body
128
128
  else
129
- response.text().then (body) ->
130
- cb err, rc, body
129
+ f = callbackify response.text
130
+ await f.call response, defer err, body
131
+ if err
132
+ @log "| _get_url_body response.text() failed with: #{err.toString()}"
133
+ rc = v_codes.CONTENT_FAILURE
134
+ cb err, rc, body
131
135
  catch err
132
136
  cb err, rc, null
133
137
  else
@@ -75,7 +75,13 @@ exports.TwitterScraper = class TwitterScraper extends BaseScraper
75
75
  @log "| search index #{u} -> #{rc}"
76
76
  if rc isnt v_codes.OK then #noop
77
77
  else if not json? or (json.length is 0) then rc = v_codes.EMPTY_JSON
78
- else if not json.data? then rc = v_codes.INVALID_JSON
78
+ else if not json.data?
79
+ if json.meta?.result_count is 0
80
+ # No results.
81
+ rc = v_codes.NOT_FOUND
82
+ else
83
+ # Unknown JSON structure.
84
+ rc = v_codes.INVALID_JSON
79
85
  else
80
86
  rc = v_codes.NOT_FOUND
81
87
  for {text, id},i in json.data