Skip to content

[#321] Resolve "support captcha token in registration flow"

Closes #321 (closed)

context

  • problem:
    • we are starting to get captcha required errors on prod
    • this is bad b/c it blocks us from: (1) registering new phone numbers, (2) re-registering old phone numbers to recover from a corrupted keystore
  • solution:

changes

support captchaToken argument in register endpoint

  • allow optional captchaToken argument in /phoneNumbers/register
  • if present, pass it to phoneNumberService.register and signal.register

add captcha token arg (-c) to boost register

side-effects:

modify signal configs

  • decrease registration batch size from 5 to 4 (to avoid triggering rate limit errors on excessive registrations)
  • increase signaldRequestTimeout from 10 to 20 (since this is now effectively the timeout for verifications)

fix _check-env bug causing non-deterministic ngrok discovery

  • symptom: sometimes _check-env incorrectly deletes the first character from the ngrok tunnel url assigned to SIGNALBOOST_HOST_URL in dev mode, with the result that twilio numbers are created with incorrect callback urls and we can never receive sms'es sent to this number and thus never successfully verify new numbers with signal
  • cause: we wrongly assumed that ngroks tunnels endpoint would always return the http and https tunnels in the same order and based our sub-string finding command off of this assumption -- stripping the first 8 digits from the public_url field in the first tunnel on the assumption that this tunnel's url would always start with https://. however, sometimes it starts with http://, and in those cases, we trim the first digit from the tunnel url
  • fix: use sed to deterministically strip either http:// or https:// from the tunnel url so that the ordering doesn't matter
Edited by aguestuser

Merge request reports