Skip to content

Resolve "admin can destroy channel with DESTROY command"

feed back requested to merge 106-admin-destroy-channel into master

Closes #106 (closed)

Example Scenarios

Maintainer destroys a number that is NOT associated with a channel

❯ boost create-number -u signalboost.ngrok.io

--- checking environment...
--- provisioning 1 number(s) with area code (unspecified) at url signalboost.ngrok.io
[
  {
    "status": "VERIFIED",
    "phoneNumber": "+12133418044",
    "twilioSid": "PN33207610bbd0eab2d9d476ed70b63a5e"
  }
]

❯ boost destroy -u signalboost.ngrok.io -n +12133418044

{
  "status": "SUCCESS",
  "msg": "All records of phone number have been destroyed."
}

Maintainer destroys a number that IS associated with a channel

❯ boost create-number -u signalboost.ngrok.io

--- checking environment...
--- provisioning 1 number(s) with area code (unspecified) at url signalboost.ngrok.io
[
  {
    "status": "VERIFIED",
    "phoneNumber": "+19543562041",
    "twilioSid": "PN8a7984841c14de33c44dcc2a994622c6"
  }
]

❯ boost create-channel -n destroytest -a +13472529127 -u signalboost.ngrok.io -p +19543562041

--- checking environment...
--- provisioning new channel [destroytest] on phone number +19543562041 at url signalboost.ngrok.io
{
  "status": "ACTIVE",
  "phoneNumber": "+19543562041",
  "name": "destroytest",
  "admins": [
    "+13472529127"
  ]
}

❯ boost destroy -u signalboost.ngrok.io -n +19543562041

{
  "status": "SUCCESS",
  "msg": "All records of phone number have been destroyed."
}

Maintainer destroys a number that has been previously recycled

❯ boost create-number -u signalboost.ngrok.io

--- checking environment...
--- provisioning 1 number(s) with area code (unspecified) at url signalboost.ngrok.io
[
  {
    "status": "VERIFIED",
    "phoneNumber": "+14124890173",
    "twilioSid": "PNa710a2ace3f983e0cdc0f17f3133c793"
  }
]

❯ boost create-channel -n destroytest -a +13472529127 -u signalboost.ngrok.io -p +14124890173

--- checking environment...
--- provisioning new channel [destroytest] on phone number +14124890173 at url signalboost.ngrok.io
{
  "status": "ACTIVE",
  "phoneNumber": "+14124890173",
  "name": "destroytest",
  "admins": [
    "+13472529127"
  ]
}

❯ boost recycle -u signalboost.ngrok.io -n +14124890173

[
  {
    "status": "SUCCESS",
    "data": {
      "status": "VERIFIED",
      "phoneNumber": "+14124890173",
      "twilioSid": "PNa710a2ace3f983e0cdc0f17f3133c793"
    }
  }
]

❯ boost destroy -u signalboost.ngrok.io -n +14124890173

{
  "status": "SUCCESS",
  "msg": "All records of phone number have been destroyed."
}

Maintainer attempts to destroy a number that is NOT in the database at all

❯ boost destroy -u signalboost.ngrok.io -n +12133418044

{
  "status": "ERROR",
  "message": "No records found for +12133418044"
}

Maintainer attempts to destroy a number that is NOT a valid number

❯ boost destroy -u signalboost.ngrok.io -n +1213341

> ERROR: -n must be a valid phone number prefixed by a country code

Admin of channel sends DESTROY to channel

image

Edited by feed back

Merge request reports

Loading